Sign in to follow this  

PhysX and 2D rotation

This topic is 3596 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
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

This topic is 3596 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this