how to the reposition of body

Official forum for the Chipmunk2D Physics Library.
Post Reply
adams
Posts: 2
Joined: Sat Sep 03, 2011 11:19 pm
Contact:

how to the reposition of body

Post by adams »

Dear all:
I have a problem that I want to reposition of the body during some frame in the game.And how can I do it. Someone has good ideas?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: how to the reposition of body

Post by slembcke »

If you just want to "teleport" it occasionally, you can just directly set the position of the object. Setting the position of the body only becomes a problem when you keep doing it every frame.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
adams
Posts: 2
Joined: Sat Sep 03, 2011 11:19 pm
Contact:

Re: how to the reposition of body

Post by adams »

slembcke wrote:If you just want to "teleport" it occasionally, you can just directly set the position of the object. Setting the position of the body only becomes a problem when you keep doing it every frame.
Hi!But I always need to change the body's poision,how can I to do it ? Do have some good ideas?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: how to the reposition of body

Post by slembcke »

Then you need to make the body have infinite mass and moment of inertia and update both the position and velocity.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests