Bouncing ball physics
2 posters
Bouncing ball physics
Hi All,
I'm trying to figure out how to implement "bouncing" object physics using SIO2. Adding an object moving in the same direction as the camera is relatively easy using the tutorial code.
But how can I make an object bounce? Basically I'm confuses as to make an object move "X" degrees downward in front of the camera (or any other object for that matter).
Can anybody please tell me how I can compute the appropriate linear velocity to do this? I basically need to compute a velocity that points downward in front of an object? Any clues are much appreciated.
Cheers.
I'm trying to figure out how to implement "bouncing" object physics using SIO2. Adding an object moving in the same direction as the camera is relatively easy using the tutorial code.
But how can I make an object bounce? Basically I'm confuses as to make an object move "X" degrees downward in front of the camera (or any other object for that matter).
Can anybody please tell me how I can compute the appropriate linear velocity to do this? I basically need to compute a velocity that points downward in front of an object? Any clues are much appreciated.
Cheers.
matthew- Posts : 64
Join date : 2008-11-12
Re: Bouncing ball physics
setRestitution(1.0f) try it , and please tell me the result.
btw: the bounce effect depends on both of the collision objects.
btw: the bounce effect depends on both of the collision objects.
sw- Posts : 73
Join date : 2008-10-12
Bouncing Physics
'Ey Matt,
You to set the restitution to 1.0 what is that? The friction property is relatively obvious.
Basically, what I'm trying to achieve is to apply a bounce to a ping pong ball. Mayby you misunderstood my question.
That's why I'm wondering, how do I control the amount of "downward" swing in the direction of the camera? For example, I want to send an object either 20 or 30 degrees DOWN in the direction of the camera.
Cheers.
You to set the restitution to 1.0 what is that? The friction property is relatively obvious.
Basically, what I'm trying to achieve is to apply a bounce to a ping pong ball. Mayby you misunderstood my question.
That's why I'm wondering, how do I control the amount of "downward" swing in the direction of the camera? For example, I want to send an object either 20 or 30 degrees DOWN in the direction of the camera.
Cheers.
matthew- Posts : 64
Join date : 2008-11-12
Bouncing Physics Reply
Er... I meant to thank "sw" for replying to this question, earlier. Thanks for any help.
Cheers,
Matt
Cheers,
Matt
matthew- Posts : 64
Join date : 2008-11-12
Re: Bouncing ball physics
matthew wrote:Er... I meant to thank "sw" for replying to this question, earlier. Thanks for any help.
Cheers,
Matt
btVector3 forward(dest[0]-campos[0],dest[1]-campos[1],dest[2]-campos[2]);
forward.normalize();
/* you should adjust your Speed, gravity , dest . and apply -sinf(30) to Z axis, etc */
forward*=ping_pong_Speed;
yourPing_Pong->getWorldTransform().setOrigin(campos);
yourPing_Pong->setLinearVelocity(forward);
sw- Posts : 73
Join date : 2008-10-12
Similar topics
» Ball on surface physics
» physics object inside another physics object
» 3dsmax Exporter v1.2
» Physics in 1.3.1
» Physics Issue - 1.35 and 1.4
» physics object inside another physics object
» 3dsmax Exporter v1.2
» Physics in 1.3.1
» Physics Issue - 1.35 and 1.4
Permissions in this forum:
You cannot reply to topics in this forum