Box2D Forums

It is currently Tue May 21, 2013 12:21 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Jun 20, 2012 6:19 am 
Offline

Joined: Wed Jun 06, 2012 5:15 pm
Posts: 1
Hi There,

I am trying to make a sticky projectile without using the following method in this tutorial:
http://www.iforce2d.net/b2dtut/sticky-projectiles

I basically have a simple cannon that throws a ball with high velocity and I would like it to stick to a surface.

I tried the following approach by simply setting the following settings for the ball on contact however the ball keeps sliding slowly which I don't want:

Ball:
Object->setStatic(true);
Object->setAngularVelocity(0);
Object->setLinearVelocity(0,0);

Sticky Surface is a simple box with following physical properties:

Friction:5.0f //High Friction
Restitution: 0.0f //No Bounciness
Density:1.0


I really appreciate it if someone can help me out.

Thanks,

HS


Top
 Profile  
 
PostPosted: Wed Jun 20, 2012 12:43 pm 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1515
Location: Tokyo
Are you sure the body is being made static correctly? I don't think it's possible for the body to slide if it is a static body...
Are you doing body->SetType(b2_staticBody); ?
Perhaps you are using pseudo-code there, because there is no function setStatic in Box2D.


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: No registered users and 4 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