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?
how to the reposition of body
-
- Posts: 2
- Joined: Sat Sep 03, 2011 11:19 pm
- Contact:
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: how to the reposition of body
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/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 2
- Joined: Sat Sep 03, 2011 11:19 pm
- Contact:
Re: how to the reposition of body
Hi!But I always need to change the body's poision,how can I to do it ? Do have some good ideas?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.
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: how to the reposition of body
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/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Who is online
Users browsing this forum: No registered users and 21 guests