Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with rotating my tires, please?

Rutherford Beresford
Registered User
Join date: 2 Sep 2007
Posts: 45
03-28-2009 10:21
I'm using the llSetTargetOmega to try to make a tire rotate when my vehicle is in motion. My problem is, as the vehicle moves AND TURNS, the relative x, y, and z axis change. How do I code a script that will allow my cylinder prim to always rotate, as if it were a tire, regardless of the direction in which my vehicle is facing?

Thank you!
Rutherford Beresford
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
03-28-2009 10:51
I've only tried it by moving the object in the edit window rather than putting in a motor and driving round, but
CODE
default
{
state_entry()
{
llTargetOmega(<0.0,0.0,1.0>*llGetLocalRot(), 1, PI);
}
}
seems to do it.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-28-2009 11:14
You might consider trying an animated texture rather than an actual rotating prim as well.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
03-28-2009 11:18
Hewee's got the right idea, that's the best way to go about it, no muss, no fuss, no rotation issues.
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Rutherford Beresford
Registered User
Join date: 2 Sep 2007
Posts: 45
Thank you
03-28-2009 12:11
I was using animated textures but I kinda liked the realism of a rotating prim. Thanks to all for their suggestions.
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
03-28-2009 14:14
Nevertheless, if your vehicle is physical, I don't think using llTargetOmega is a very good idea. This is because all the work that's done client-side when llTargetOmega is running on non-physics objects has to be done server-side when the object is physical.

So your wheels are physical, then you're going to place a considerable burden on the sim.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-28-2009 16:11
From: Innula Zenovka
Nevertheless, if your vehicle is physical, I don't think using llTargetOmega is a very good idea. This is because all the work that's done client-side when llTargetOmega is running on non-physics objects has to be done server-side when the object is physical.

So your wheels are physical, then you're going to place a considerable burden on the sim.

If they are child prims of a vehicle object, the wheels cannot be physical. llTargetOmega() in child prims is ALWAYS handled on the client side, whether or not the object/root prim itself is physical.
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
03-28-2009 17:35
From: Hewee Zetkin
If they are child prims of a vehicle object, the wheels cannot be physical. llTargetOmega() in child prims is ALWAYS handled on the client side, whether or not the object/root prim itself is physical.
Oh.. that's good to know .. I have clearly been labouring under a huge misapprehension and making some unnecessary work for myself. Thanks.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-29-2009 02:32
From: Hewee Zetkin
If they are child prims of a vehicle object, the wheels cannot be physical. llTargetOmega() in child prims is ALWAYS handled on the client side, whether or not the object/root prim itself is physical.

and a good thing that since texture animation motion can't be set by side, it's global to the prim (not that it matters for toroids and spheroids.
_____________________
|
| . "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...
| -
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
03-29-2009 04:56
From: Void Singer
and a good thing that since texture animation motion can't be set by side, it's global to the prim (not that it matters for toroids and spheroids.
Precisely so. Because neither of us thought I could use llTargetOmega on a some child prims of a physical object, a customer and I recently spent ages making textures and trying to coordinate the texture animation speeds for some extra prims that we could ill afford in a detailed physics vehicle.