public unsafe void LerpPoseFromState([Editor.DisplayParamName("粒子对象(CGfxParticle)")] ref CGfxParticle p, [Editor.DisplayParamName("粒子对象中状态对象1(int)")] int stateindex1, [Editor.DisplayParamName("粒子对象中状态对象2(int)")] int stateindex2, [Editor.DisplayParamName("过度系数(OnGetFactorDelegate)")] OnGetFactorDelegate GetFactor)
        {
            var   ps0    = p.GetState(stateindex1);
            var   ps1    = p.GetState(stateindex2);
            float factor = GetFactor == null ? 0 : GetFactor(p.mLife, p.mLifeTick);

            factor = (float)Math.Max(0.0, Math.Min(1.0, factor));
            CGfxParticlePose.Lerp(ref p.FinalPose, ref ps0->mPose, ref ps1->mPose, factor);
        }
Exemple #2
0
        public void BindTriggerEvent(ref CGfxParticle particle)
        {
            if (TriggeringEvent == null)
            {
                return;
            }

            var tag = particle.Tag as ParticleTag;

            if (tag == null)
            {
                tag          = new ParticleTag();
                particle.Tag = tag;
            }

            tag.TriggerEvent = TriggeringEvent;
        }
 public unsafe void SetFinalPoseRotation([Editor.DisplayParamName("粒子对象(CGfxParticle)")] ref CGfxParticle p, [Editor.DisplayParamName("旋转坐标轴(Quaternion)")] Quaternion q)
 {
     FinalPose.mRotation *= q;
 }
 //[Editor.MacrossMemberAttribute(Editor.MacrossMemberAttribute.enMacrossType.Callable | Editor.MacrossMemberAttribute.enMacrossType.Overrideable)]
 public virtual void DoParticleDead([Editor.DisplayParamName("粒子系统对象(CGfxParticleSystem)")] CGfxParticleSystem sys, [Editor.DisplayParamName("粒子对象(CGfxParticle)")] ref CGfxParticle p)
 {
     p.mExtData = IntPtr.Zero;
     p.mFlags   = 0;
 }
 //[Editor.MacrossMemberAttribute(Editor.MacrossMemberAttribute.enMacrossType.Callable | Editor.MacrossMemberAttribute.enMacrossType.Overrideable)]
 public virtual void DoParticleBorn([DisplayParamName("粒子系统对象(CGfxParticleSystem)")] CGfxParticleSystem sys, [DisplayParamName("粒子对象(CGfxParticle)")] ref CGfxParticle p)
 {
     //p.mLife = 100.0f;
 }