Jump to content
  • Advertisement
Sign in to follow this  
hi_ferro

PhysX and 2D rotation

This topic is 3875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to implement PhysX to this 2D engine that require a rotation in degrees to rotate my sprites. Everything works fine with collision and so on, it's just the rotation left. So, how do i extract the X rotation from PhysX?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by hi_ferro
I'm trying to implement PhysX to this 2D engine that require a rotation in degrees to rotate my sprites. Everything works fine with collision and so on, it's just the rotation left. So, how do i extract the X rotation from PhysX?
I'm not familiar with the PhysX interface, but I'm assuming you can acquire the current transform for your object in some form or another (e.g. as a matrix). I'm also assuming that you've got things set up so that changes in orientation are constrained to a particular axis.

So, what do you have available to you? A matrix? A quaternion and a position vector? Something else? Whatever information you have at your disposal, you should be able to compute the angle for your sprite with a little trig.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!