Particle entity / particle emitter

#1
I am trying to create the particle entity, but I am having trouble with this. I do it the same way I did way back in EaaS but it doesnt seem to work anymore.

I want to create particle entity in C++. I know how to spawn it and so on, but later i want to add impulse to it, but if I physicalize it as PE_PARTICLE i can't GetPhysics () and impulse crashes. I tried to make it PE_RIGID but then attaching particle emitter does not work. It is attaching it to rigid entity, particle doesn't even show up. But in this case Action (impulse) works. I load particle and attach it to the entity by using LoadParticleEmitter (slot). How can I attach emitter to my entity and still be able to use Impulse action when particle follows entity and get collision ? I looked into projectile.cpp from game SDK and bullet. But I can't find the solution.
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Particle entity / particle emitter

#3
I wouldn't post anything without previously reading that documents. It doesn't help me though. Still adding impulse doesn't work for PE_PARTICLE. also pe_params_particle have params.heading. But it doesn't work .

However I managed to separate my entity into 2 entities. First one is only collision listener, and second one is attached child - particle entity.

Anyways I am still looking for "cheaper" solution.
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Particle entity / particle emitter

#9
search

CProjectile::SetAspectProfile(EEntityAspects aspect, uint8 profile)

if (m_pPhysicalEntity->GetType() == PE_PARTICLE)
{
pe_params_particle particle;
particle.heading = totalVelocity.GetNormalized();
particle.velocity = totalVelocity.GetLength();

m_pPhysicalEntity->SetParams(&particle, bThreadSafe);
}
else if (m_pPhysicalEntity->GetType() == PE_RIGID)
{
pe_action_set_velocity vel;
vel.v = totalVelocity;

m_pPhysicalEntity->Action(&vel, bThreadSafe);
}

Re: Particle entity / particle emitter

#10
looks like you can not add force to particle but can change speed

bool isParticle = (m_pPhysicalEntity != NULL) && (m_pPhysicalEntity->GetType() == PE_PARTICLE);
if (isParticle)
{
SetUpParticleParams(pOwnerEntity, projectileDesc.bulletPierceabilityModifier);

pe_params_flags pf;
pf.flagsOR = particle_no_impulse;
if (m_pPhysicalEntity)
m_pPhysicalEntity->SetParams(&pf);
}

Who is online

Users browsing this forum: No registered users and 0 guests

cron