Re: Align object to vector using Dgame framework

2015-07-14 Thread via Digitalmars-d-learn
On Tuesday, 14 July 2015 at 00:31:56 UTC, codenstuff wrote: On Monday, 13 July 2015 at 19:07:55 UTC, Márcio Martins wrote: On Monday, 13 July 2015 at 16:11:03 UTC, codenstuff wrote: [...] This is not really a game development forum but here you go: auto rads = atan2(object.velocity.y, object.

Re: Align object to vector using Dgame framework

2015-07-13 Thread codenstuff via Digitalmars-d-learn
On Monday, 13 July 2015 at 19:07:55 UTC, Márcio Martins wrote: On Monday, 13 July 2015 at 16:11:03 UTC, codenstuff wrote: [...] This is not really a game development forum but here you go: auto rads = atan2(object.velocity.y, object.velocity.x); // returns radians auto degs = angle * (180.0f

Re: Align object to vector using Dgame framework

2015-07-13 Thread via Digitalmars-d-learn
On Monday, 13 July 2015 at 16:11:03 UTC, codenstuff wrote: I've been using Dgame framework for simple simulations. I need moving object to be aligned to their velocity vectors. How is it possible to do that using Dgame? I see that shape object has setRotation and setRotationCenter. Not sure h

Align object to vector using Dgame framework

2015-07-13 Thread codenstuff via Digitalmars-d-learn
I've been using Dgame framework for simple simulations. I need moving object to be aligned to their velocity vectors. How is it possible to do that using Dgame? I see that shape object has setRotation and setRotationCenter. Not sure how to use these to achieve the effect. I realize that defau