How can I find the angle of Entity?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
SL RU
Posts: 6
Joined: Sat Apr 28, 2012 10:07 am

How can I find the angle of Entity?

Post by SL RU »

The question, in fact, in the topic. :)
I want to set the camera at an angle as the Entity.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: How can I find the angle of Entity?

Post by Norbo »

The Entity.Orientation quaternion and Entity.OrientationMatrix 3x3 matrix both provide the current orientation and can be used to orient a camera. If you want Euler angles, then you'll need to convert orientation to Euler angles using the desired convention (there is no built-in helper for this since there are many different possible conventions). On the other hand, I would suggest running away from Euler angles as fast as you can; working with the transforms directly turns out to be a lot easier with any nontrivial transform. :)
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: How can I find the angle of Entity?

Post by Norbo »

Also, if you want to make a camera look at an entity as opposed to using the entity's orientation directly, the XNA Matrix.CreateLookAt method would do the trick.
Post Reply