Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Absolute up rotation for attachments.

WarKirby Magojiro
Registered User
Join date: 24 Oct 2006
Posts: 49
06-15-2007 00:45
I'm trying to make an attachment which generates particles in a specific pattern. When the avatar is hovering, things look good.

But when the avatar flies, the body changes rotation sharply, and particles which should be oin the ground, are suddenly trailing behind in the air.

I'm looking for some way to make the attachment always point absolubtly upwards, so that the particles always emit downwards.

I've tried repeatedly calling llSetRot, llSetLocalRot, llLookAt, and no apparent results.

Is there any way to set an attachment to an absolute/world rotation, or must it be calculated from avatar rotation ?
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
06-15-2007 08:05
okay, maybe the forum wont eat my reply this time....
(i swear, they're using the forum servers as the temporary asset database :X )


you're using particles, so forget turning the object. you can use the accelleration setting to aim the particles. the accelleration setting happens to use global coordinates, so a negative z value is ALWAYS down.

PSYS_SRC_ACCEL


thats the parameter to look for/use. try setting it to < 0.0, 0.0, -1.0> and see how it works out for you.
_____________________
Why Johnny Can't Rotate:
http://forums.secondlife.com/showthread.php?t=94705
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
06-15-2007 08:44
It's not possible to orient attachments based on the world axes. The attachment can't know what kind of animation is playing at a given time and what it's doing to the avatar's rotation. Even worse, the animations may be slightly desynchronized between viewers, so what would look right for one person won't look right for another.
WarKirby Magojiro
Registered User
Join date: 24 Oct 2006
Posts: 49
06-15-2007 19:36
From: Bloodsong Termagant
okay, maybe the forum wont eat my reply this time....
(i swear, they're using the forum servers as the temporary asset database :X )


you're using particles, so forget turning the object. you can use the accelleration setting to aim the particles. the accelleration setting happens to use global coordinates, so a negative z value is ALWAYS down.

PSYS_SRC_ACCEL


thats the parameter to look for/use. try setting it to < 0.0, 0.0, -1.0> and see how it works out for you.


No. I can't forget turning the object. I'm already utilising the acelleration. The point being, that acelleration applies a force to particles after they are created. Not controls WHERE they're created. In this case, the particles are created a varialble (calculated) distance below the emitter. When the avatar is flying, below for the emitter becomes behind the avatar.

/me sighs.

As a backup plan,, though. I suppose I can have it only trigger when the agent is hovering still.

Althouh how might I do that. I can use llGetAgentInfo to test if the avatar is flying,but how to find if they're hovering still in the air, or flying around ? There doesn't seem to be an AGENT_MOVING flag.
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
06-16-2007 00:01
Does not llGetPos () get the av position? Then you can check for it changing.

I think there is also llGetVelocity ().
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
06-16-2007 04:38
Disclaimer: can't get in-world to test anything just now, so this is all wild speculation at best.

I would think that llGetRootRotation() might give you the wearing agent's rotation, for which you might be able to correct with llSetLocalRot() (maybe). For your purposes, I don't think you care what any animation has done to the rotation of the (viewer-side) avatar, and the rotations you'll get are for the (sim) agent. As Lex points out, though, if you manage to get the particles emitting from the world-bottom of the attachment as you wish, it may look very strange if the animation has greatly separated the viewer's avatar from its sim agent.

To make the ACCEL thing work without generating a strange arc from the emitter, you'd want to switch from any ANGLE pattern (which you're evidently using) to a DROP... which might entail another prim that does nothing but emit particles, to be able to precisely control whence the particles appear.

There are moving_start() and moving_end() events you might use for something--the wiki says they'll work for attachments. Or there's llGetAnimation() which should tell you if you're flying, hovering, etc.