04 June 2007

Physics R Phun

You know those height limitations? You can't teleport to a location above 768M. Physics-powered movement only. So grab a flight ring, hop on a vehicle, or be prepared to make a physics-based elevator. I've made sit target based movers before, and ones that use llSetPos(), so I think I'll make the elevator.

Physical things roll like crazy. Especially when there's an avatar standing on them. The next line is your friend. Memorize it.
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);

Box your avatar in the elevator. They'll shoot off like a rocket if you don't. And be careful about speed - if the object goes too fast, the avatar may fall thru the elevator.

Unless you make them sit. Don't trust them to sit. They'll have a smoother ride and the elevator can move faster if they sit. If you need them to sit, think about how you're going to enforce it.

llMoveToTarget() doesn't make for a smooth ride when you have to call it several times in a row. And each call is distance limited (64M) so you'll probably be looping thru it.

If the riders are sitting (and therefore part of the linkset), I could use llGetMass() and apply force. I'm wondering if I can do a mix of the two - use force for the majority of the movement, then switch to llMoveToTarget() for the last 50M to take advantage of the positioning and damping.

I have some concerns about what will happen if the elevator bumps into an airplane or other solid object... Theoretically, if I'm using llMoveToTarget(), the box should work its way around the obstacle ( unless it is at the target point). I wonder if it would bounce if I'm just using force? I need some airplanes...

No comments: