|
Oden Hax
Registered User
Join date: 19 Feb 2007
Posts: 2
|
03-26-2008 13:58
Scenario: I have made a vehicle where an av can sit. There is also an attachment that comes with that vehicle that when attached to (for example pelvis). I want it aligned to the vehicle and not the av.
I can get the in world vector and rotation for where I want the attachment to go but how do I translate that to the local vector and rotation for the attachment. I'm guessing at using llGetRootPosition and llGetRootRotation on the attachment would be involved but how?
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
03-26-2008 15:09
I don't think this is possible. An animation could move the av, and a script would have no knowledge of it. AFAIK, all offsets and rotations on an attachment are relative to the attachment point.
You can probably fake it and get close enough. You control the vehicle, so you know the sit offset. I'm assuming you control the animation as well. I think you can get the av's size, and from there make a guess about the world-position of his pelvis. So you could use all that information to position the attachment so that it more or less lines up with the base. At least, that's the approach I would take. If it requires very precise alignment, I'm not sure how to do this.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-26-2008 20:07
build you're base (the part sat upon) and align the root to the world axis (zero_rotation)
seat your av, and attach the extra part to the hips (the only reliable attach point for this kind of usage) move/rotate that into position, then detach.
all should be fine, and the attachment should work correctly for any av (hip is the av root, so it's the one constant across avs)
just note that the pose for the vehicle needs to be static and of a high priority (I'd go with 4) and that the hips need to be locked.
the reason for the high priority is so that other animations don't rotate the hips, which would cause your attachment to rotate with them, and out of alignment with the rest of the vehicle.
_____________________
| | . "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... | - 
|
|
Oden Hax
Registered User
Join date: 19 Feb 2007
Posts: 2
|
04-03-2008 09:43
Thanks for your reply... I have made some initial tests but I was using pelvis as an attachment point (found on google). Which is the correct, hip or pelvis? And how can I from the attachment get the rotation of the root prim (av)? The attachment seems tilted somewhat on Y axis in my case.
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
04-03-2008 15:37
STOMACH or PELVIS
all other attachment points drift from shape to shape.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-04-2008 10:44
pelvis is what I meant to write, stomach can occasionally work but may be a bit off for different height avs.
_____________________
| | . "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... | - 
|