Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Phisical object, Rolls and Bounces

Astolfo Forcella
Registered User
Join date: 23 May 2007
Posts: 7
01-16-2008 02:26
Hello, I have spherical and physical object to which I apply an impulses (llApplyImpulse). If I set the rotation (llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);) the object rolls and bounces too much, if I disable the spin (llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);) the object rolls and bounces nearly not at all.
How I can set up an intermediate value?

p.s. sorry for my English :P
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
01-16-2008 02:50
There is no intermediate value for that. Axes are either locked or they are not.
Astolfo Forcella
Registered User
Join date: 23 May 2007
Posts: 7
01-16-2008 03:32
ok! the value of the axis rotation is only TRUE or FALSE but if I set the axis rotation value on true, when I apply an impulse There is a way to reduce the bounce?
Beezle Warburton
=o.O=
Join date: 10 Nov 2006
Posts: 1,169
01-16-2008 04:02
Have you tried the different material types?
_____________________
Though this be madness, yet there is method in't.
-- William Shakespeare

Warburton's Whimsies:
In SL
Apez.biz
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
01-16-2008 10:04
Or perhaps you need to adjust the strength of the impulse. One often sees

float strength = 42; // or whatever.
llApllyImpulse( .. strength*llGetMass() .. )

on the assumption that F = ma applies in SL, which is sort of does, but not precisely I think.


If the object is bouncing and rolling too much, reduce the strength.

Another possiblility is to add a governor script to the object. This script tracks how much the object is bounding and rolling, and if it is "excessive" according to your thinking, aply some small force to partially counteract it.

One other thing to remember...the physics engine in the beta test grid is Havok4, but in the live grid is havok1. The physics of SL are about to change dramatically, when Havok4 comes to the live grid. So, if you are creating physics based content, you might want to do it in beta and hold off releasing it in the live grid.
_____________________
So many monkeys, so little Shakespeare.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-16-2008 10:12
I've noticed that very small objects can bounce around like CRAZY. If they are rotating, they can even gain momentum--seemingly limitlessly--until they go off-world. And we thought there was no such thing as a perpetual motion machine. ;-)

From: Lee Ponzu
One often sees

float strength = 42; // or whatever.
llApllyImpulse( .. strength*llGetMass() .. )

on the assumption that F = ma applies in SL, which is sort of does, but not precisely I think.

An impulse actually doesn't represent a force. It represents a change in momentum. The applicable equation is actually:

p = mv
(p1 - p0) = m (v1 - v0)
v1 = v0 + (p1 - p0)/m

which does, in fact, work pretty well for llApplyImpulse() in SL (at least currently; hope Havok 4 doesn't mess that bit up). Unless there is friction due to contact with the ground at any rate.
Samuel Bishop
Registered User
Join date: 7 Mar 2006
Posts: 11
01-18-2008 06:24
Hewee,

Your equation is puzzling me, can you elaborate?
_____________________
Samuel Bishop
The Almigty Panda! lol
robtking@gmail.com
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-18-2008 09:36
Sure. Newtonian momentum is equal to mass times velocity. An "impulse" is simply a change in momentum. Mass doesn't change in the real world, and across a call to llApplyImpulse() it doesn't even change in SL, so a change in momentum is equal to the mass of the object times the change in velocity. The change in velocity can be thought of as "instantaneous" in this case, unlike a FORCE which causes acceleration over time. This is also how pushes work, though the effects of the pushing object's mass and the distance away make the implementation a little less understandable.

If you wonder whether the relationship holds, try it (but not on the ground where SL's "friction" messes with things). Impulses work great for those nifty little dash devices everyone uses, both to start the move and to cancel velocity at the end of the move.
Montecore Babcock
Registered User
Join date: 20 May 2006
Posts: 48
01-18-2008 15:55
From: Hewee Zetkin
Sure. Newtonian momentum is equal to mass times velocity. An "impulse" is simply a change in momentum. Mass doesn't change in the real world, and across a call to llApplyImpulse() it doesn't even change in SL, so a change in momentum is equal to the mass of the object times the change in velocity. The change in velocity can be thought of as "instantaneous" in this case, unlike a FORCE which causes acceleration over time. This is also how pushes work, though the effects of the pushing object's mass and the distance away make the implementation a little less understandable.

If you wonder whether the relationship holds, try it (but not on the ground where SL's "friction" messes with things). Impulses work great for those nifty little dash devices everyone uses, both to start the move and to cancel velocity at the end of the move.


So if I understand correctly, to stop an object from travelling you apply a negative impulse? To make a realistic slowdown, since you said the change is instantaneous, would you need to apply several negative impulses?
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-18-2008 16:23
From: Montecore Babcock
So if I understand correctly, to stop an object from travelling you apply a negative impulse? To make a realistic slowdown, since you said the change is instantaneous, would you need to apply several negative impulses?

Yes. A realistic slowdown would better be done with something like llMoveToTarget() or llSetForce(). But you can make something instantly stop by applying an impulse (if your object/attachment has enough energy, of course). See http://www.lslwiki.net/lslwiki/wakka.php?wakka=llApplyImpulse (I see the documentation on that page has fleshed out quite a bit since last I visited, too).
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-19-2008 01:14
side note: if you drop a physical ball, moving_end never triggers, the position values are constantly shifting a slight amount as if it were vibrating
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -