public unsafe override float HasTriggered(Particle parentParticle) { if (!FieldAccessor.IsValid()) { return(0f); } var remainingLifetime = (*((float *)parentParticle[FieldAccessor])); return((remainingLifetime <= MathUtil.ZeroTolerance) ? 1f : 0f); }
public unsafe override float HasTriggered(Particle parentParticle) { if (!FieldAccessor.IsValid() || !SecondFieldAccessor.IsValid()) { return(0f); } var deltaPosition = ((*((Vector3 *)parentParticle[FieldAccessor])) - (*((Vector3 *)parentParticle[SecondFieldAccessor]))).Length(); return(deltaPosition); }
public unsafe override float HasTriggered(Particle parentParticle) { if (!FieldAccessor.IsValid()) { return(0f); } var collisionAttribute = (*((ParticleCollisionAttribute *)parentParticle[FieldAccessor])); return((collisionAttribute.HasColided) ? 1f : 0f); }
public unsafe override bool HasTriggered(Particle parentParticle) { if (!FieldAccessor.IsValid()) { return(false); } // We store remaining lifetime in the particle field, so for progress [0..1) we need to take (1 - remaining) var currentLifetime = 1f - (*((float *)parentParticle[FieldAccessor])); return((currentLifetime >= LifetimeLowerLimit) ^ (currentLifetime <= LifetimeUpperLimit) ^ limitsAreInOrder); }