Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to "rotate" PSYS_SRC_ACCEL with the object

Napple Pye
Registered User
Join date: 4 Feb 2007
Posts: 10
02-17-2007 18:43
Hello,

My issue is similar to those 2 :
Getting Particles to Emit at the Object's Angle
Need Help with Particle Script

I want the particles (stream) to rotate with the object.

The difference is that I use PSYS_SRC_TARGET_KEY / PSYS_PART_TARGET_POS_MASK which has the bad consequence of making particles (PSYS_SRC_BURST_SPEED in particular) independent from the object's rotation.

I make particles travel in an arc between emitter & receiver.
The only way I found to do this is with PSYS_SRC_ACCEL

I have 3 problems :

- How to convert llGetRot() into PSYS_SRC_ACCEL

- How to keep the distance between the top of the arc and the middle of the distance between emitter and receiver.
(The value I use for a default setting called bottom_front is <0.3,0.0,-0.3>;)

- How to update PSYS_SRC_ACCEL
llParticleSystem() is in a custom function that is in a listen()
my_psys_src_accel is a global variable, but when I update it in a timer() it is not updated in llParticleSystem().

PS: The distance between emitter and receiver is constant and they both have the same rotation.
Elsewhere Essex
Registered User
Join date: 8 Sep 2006
Posts: 50
02-18-2007 07:39
i havent tested yet, but to turn your rotation from llGetRot into a suitable vector for ACCEL i think it may be:
CODE

vector Rot2Vec(rotation rot){
vector rot_vec = llRot2Euler(rot);
rot_vec *= RAD_TO_DEG;
return rot_vec;
}

for some reason thee is something about llRot2Euler() that doesn't like rotation greater than 90 degress and wil lock there. not sure of a way around that. i leave that to one of the math guru's around here