About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
particle.matrix
Author Message
Mardok Offline
Member

Post: #1
particle.matrix
Hi,
I have a car + exhaust pipe and smoke particles.
Particles have constant velocity x = - 4.

Particles matrix = actor.matrix();

But if i'm driving my car - particles direction is still the same, why?

What should i do to achieve the desired effect ?

[Image: mspaintdemo.jpg]

PHP Code:
----------------------------------::update() function
if(
exhaust_particle->update())
{
     
exhaust_particle->matrix actor.matrix();
}
----------------------------------------------------- 
(This post was last modified: 02-20-2011 07:10 PM by Mardok.)
02-20-2011 07:03 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #2
RE: particle.matrix
Try add this under exhaust_particle->matrix:

exhaust_particle->vel_constant=actor.matrix().angles();
02-20-2011 07:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #3
RE: particle.matrix
No, no effect.

I think particle->matrix = actor.matrix should be enough.... but it doesn't work.
:(
02-20-2011 11:29 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #4
RE: particle.matrix
In my problem it worked as I want.
02-20-2011 11:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #5
RE: particle.matrix
What was your problem pfft ? Write about... maybe this will help...

You said : exhaust_particle->vel_constant = actor.matrix().angles();
But i don't want change vel_constant :/ vel_constant it's defined in my particle file and its only (X: -4)
02-21-2011 12:13 AM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #6
RE: particle.matrix
I wanted make some dirt under wheels. And it's always behind car when I put this line. It isn't exactly the same situation as yours but I hoped that it help you.
(This post was last modified: 02-21-2011 12:26 AM by Harry.)
02-21-2011 12:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #7
RE: particle.matrix
vel_constant tells what direction it should point at - it takes in a vector
(This post was last modified: 02-21-2011 12:29 AM by Dandruff.)
02-21-2011 12:28 AM
Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #8
RE: particle.matrix
(02-21-2011 12:22 AM)Harry Wrote:  I wanted make some dirt under wheels. And it's always behind car when I put this line. It isn't exactly the same situation as yours but I hoped that it help you.

Just you got lucky ;]
02-21-2011 12:37 AM
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #9
RE: particle.matrix
if you put it vel_constant = -4 you're actually putting vel_constant = (-4,-4,-4) so try harrys solution.

also, exhaust_particle->matrix = actor.matrix(); just says that the particle is in the same position as the actor; it doesn't tell the particle what direction it should shoot at.

I think you put vel_constant as -4 because of its ambiguous name. To change the particles actual "velocity", i think you would use exhaust_particle->accel->set(x,y,z);
(This post was last modified: 02-21-2011 12:57 AM by Dandruff.)
02-21-2011 12:38 AM
Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #10
RE: particle.matrix
I don't need change vel_const... my smoke particle it's defined in Model Editor -> Particle and vel_cons (X= -4)

Problem is if i'm rotating my car, particle matrix is still the same, smoke direction is always the same.. :(

Look at screenshot
02-21-2011 12:55 AM
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #11
RE: particle.matrix
sorry, i edited my post. reread it smile

edit : ah, you said velocity x = - 4... misread, but try harrys solution anyways it should work
(This post was last modified: 02-21-2011 01:13 AM by Dandruff.)
02-21-2011 01:01 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #12
RE: particle.matrix
If you move the particles position it will effect the smoke particle as well... so the constant velocity is not needed at all what you guys want to believe... try it as test in the editor and move the particle wink

There is always evil somewhere, you just have to look for it properly.
(This post was last modified: 02-21-2011 01:48 AM by Dynad.)
02-21-2011 01:47 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #13
RE: particle.matrix
OK, maybe this example shows you my problem better.

I have some Dragster with two turbojet engines - engines spits flames (flames is a particle with cons_vel Z = 5.

update---------
{
flames_particle.matrix = dragster.actor.matrix();
}
update---------

If car goes up then flames is ok (because cons_vel Z = 5), but if dragster goes down then flames still the same direction?

What I should do to properly set flame ?

[Image: turbocar.jpg]
02-21-2011 03:02 AM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #14
RE: particle.matrix
If you don't use the constant vel, like i said in my other post, how does it look like?

So the constant vel is the same as moving the particle itself.. depends on how fast you go of course but thats just tweaking with the amount of particles.

There is always evil somewhere, you just have to look for it properly.
02-21-2011 04:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #15
RE: particle.matrix
Right now the direction of the smoke is going, lets say, down, but you want it to be relative to the actor and not the world.

By having vel_constant to be a constant number (z=5), it will always point in that direction relative to the world ( it will not pay any attention to the direction of the car, as shown in your diagram ).

Since you want the smoke to shoot away from the direction of the car, you would use directions relative to IT ( it will not pay any attention to its direction in the world - which is what we want ).


not done reply..
02-21-2011 05:06 AM
Find all posts by this user Quote this message in a reply
Post Reply