Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Bouncier Physical Objects

Xerxes Qinan
Registered User
Join date: 12 Feb 2007
Posts: 10
03-02-2007 12:40
I'm trying to create a ping-pong table, oddly enough. The problem is, my ball won't bounce, no matter what material or hollowness I give it. How can I script it to be bouncier when it hits the ground?
Hamncheese Omlet
what's for breakfast?
Join date: 2 Apr 2006
Posts: 79
03-02-2007 12:55
look up llSetBuoyancy. It will counteract gravity
Xerxes Qinan
Registered User
Join date: 12 Feb 2007
Posts: 10
03-02-2007 14:33
Tried setting it to .5. Didn't do much. Is there another variable I should try?

EDIT: Okay, I'm pretty sure I know what I want to do. I'd like to, in the ball's collision event, check what direction it collided in and push it in the reverse direction. This allows it to bounce off both the table and eventually paddles.

How can I detect the direction? For example, if it falls on a table, how do I get "down" from that so as to convert it to "up?"
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
03-03-2007 10:27
Attempting to push in the opposite direction from the ball's movement in the collision event won't really help you. You'd have to know the angle of the plane that the object hit in order to calculate an angle of reflection from the angle of incidence, and SL doesn't give us any really good way of doing that.

One thing you could do instead would be to sleep for a brief period in the collision event, until the ping-pong ball has already bounced off the surface in question. Then, find the ball's velocity, and apply a little boost in that same direction to help it on its way.

One problem with this kind of thing is that spheres in the physics system are fairly granular: they'll act like what they are, that is, a plyhedron with pointy little corners. That means they'll often bounce in a direction you don't expect.