Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simulating a bearing with physical objects

Zetetic Aubret
Registered User
Join date: 18 Jan 2007
Posts: 7
07-25-2007 18:20
I'm trying to replicate the properties of a bearing with scripting. I have an axle that I want to have exactly one degree of rotational and positional freedom - the long axis of the axle itself.

The positional part of it isn't so bad, I've had good luck using llMoveToTarget to keep the center of the axis in place. I'm having much more trouble with the rotational part. It seems like the rotational functions available for objects don't give me enough control to say, basically, "change only the Z and X axes - leave the Y axis alone". Am I missing something? Are there any other tricky ways to accomplish this?

I've thought about building an actual bearing housing, but I'm afraid the friction and simulation problems with having constant contact between two rotating surfaces would be too much for the simulation engine to deal with gracefully.

Thanks!
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
07-26-2007 00:38
Your looking for
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Z, FALSE);
llSetStatus(STATUS_ROTATE_Y, TRUE);

http://wiki.secondlife.com/wiki/LlSetStatus
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Zetetic Aubret
Registered User
Join date: 18 Jan 2007
Posts: 7
07-26-2007 09:43
Ah, quite so. I didn't think to look for it in status. It works exactly as expected.

Thanks so much for your help!
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
07-26-2007 15:45
You are most welcome. It's certainly not the most obvious function name for that desired effect.
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum