Box2D Forums

It is currently Sun May 19, 2013 6:34 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Jan 15, 2012 7:44 pm 
Offline

Joined: Sat Nov 26, 2011 6:47 pm
Posts: 12
I have a body and it gets pulled by gravity downwards.
The body is dynamic.

How would I make it so the body never touches the ground?
IE: It floats/levitates in the air.

So for example, I have a circle body.
I want this body to oscillate up and down as if it has the effect that it is levitating.

It needs to stay in the same position though, but it needs to actually float so when you look at it,
you can tell that it's moving up and down/levitating.

Any ideas?


Top
 Profile  
 
PostPosted: Mon Jan 16, 2012 1:37 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1515
Location: Tokyo
You might find this page useful: http://www.iforce2d.net/b2dtut/suspension
In that example the target height is fixed so that it will stop moving after a while, but you could change the target height over time (sine function etc) to keep it moving.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group