Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Problems with object energy?

Troy Padar
Registered User
Join date: 3 Oct 2005
Posts: 8
03-27-2006 03:38
Hi,

I am having a good amount of problems trying to make a ball bounce properly on a surface.

First, I would rather do the ball movement myself instead of relying on SL's physics, but since it is not possible because it will never be fast or smooth enough, I was forced to work with a physical object.

So, here I am trying to apply impulse to the ball as it collides with a surface. It works ok for the most part, but it is very inconsistent. It ends up going flat from time to time. I was told to look into energy within SL. After several tests, it does point out that the ball is losing energy along the way and goes flat.

Is there any work around or tips on how to keep energy high in an object? It sounds really bad to me when you aren't able to keep a ball bouncing continuously and reliably for a few seconds.

That's just the first set of problems that I am having. I would like to be using llMoveToTarget as well for the ball from time to time, but that will be another energy nightmare as I did some tests and the ball goes flat reliably every time I try to bounce after moving it with llMoveToTarget (and yes, I did call llStopMoveToTarget).

Any ideas or hints would be very welcome. Thanks in advance!

Troy Padar
Krashnburn Hillquit
Registered User
Join date: 14 Feb 2006
Posts: 15
03-27-2006 07:20
The problem is probaly the size of your ball.(also try making it 95% hollow)

The time it takes for an object to regen from 0-1 energy is its mass divided by 200, so the less mass you have the faster you regain full energy.

I have not fooled with energy and llMoveToTarget yet, but once you know the mass, and regen time for your ball, simply adding a cool- down, after each llApplyImpulse, and after the llStopMoveToTarget should avoid any energy problems, if you reduce the mass, the cooldown should become to small to notice.