示例#1
0
        // Emit particles if close to a surface point and returns true if positive
        public bool EmitSurfaceParticles()
        {
            Vector3 nearestSurfPoint = AtomicMain.GetSurfacePointClosestToPoint(_rigidBody.Node);
            float   contactDistance  = Vector3.Distance(_rigidBody.Node.Position, nearestSurfPoint);

            if (contactDistance > _particlesDistance)
            {
                _particleEmitter.Effect.StartColor = new Color(0, 0, 0, 0);
                return(false);
            }
            _particleEmitter.Effect.StartColor = Color.White;
            _particleEmitter.Node.Position     = nearestSurfPoint;
            return(true);
        }