Nape Physics.
Discussions and help with Nape physics engine.


Home » Nape Physics » Help! » About body rotation
About body rotation [message #2694] Mon, 23 April 2012 15:53 Go to next message
wzh1989210  is currently offline wzh1989210
Messages: 2
Registered: April 2012
Junior Member
Hi,
I am new to nape.
I am creating a test for iphone.
when I use the body.rotation , the graphics' position changed. Why?
Before I use the rotation, the graphics' position is correct. really strange..


Thanks
Re: About body rotation [message #2695 is a reply to message #2694] Mon, 23 April 2012 16:40 Go to previous messageGo to next message
wzh1989210  is currently offline wzh1989210
Messages: 2
Registered: April 2012
Junior Member
BTW, the position of the graphic after body rotation seems to be random.....
Re: About body rotation [message #2696 is a reply to message #2695] Mon, 23 April 2012 18:00 Go to previous message
dELtaluca  is currently offline dELtaluca
Messages: 2225
Registered: July 2010
Location: Malden Rushett, Surrey
Senior Member
Administrator
by default, the graphics are updated like:

graphic.x = body.position.x;
graphic.y = body.position.y;
graphic.rotation = (body.rotation*180/Math.PI)%360;


I created nape!
Previous Topic:Out of bounds callback
Next Topic:The missile example
Goto Forum:
  


Current Time: Sun May 19 04:59:35 BST 2013

Total time taken to generate the page: 0.01374 seconds
.:: Contact :: Home ::.