Пример #1
0
        public override void Update(TimeSpan time)
        {
            var tr  = parent.GetTransform();
            var pos = Vector3.Transform(Vector3.Zero, tr);
            var vel = Vector3.Zero;

            if (parent.PhysicsComponent != null)
            {
                vel = parent.PhysicsComponent.Body.LinearVelocity;
            }
            if (rumble != null)
            {
                if (Speed > 0.91f)
                {
                    rumble.Active    = false;
                    character.Active = false;
                }
                else
                {
                    rumble.Active      = true;
                    character.Active   = true;
                    rumble.Position    = pos;
                    rumble.Pitch       = PitchFromRange(Engine.Def.RumblePitchRange);
                    rumble.Attenuation = AttenFromRange(Engine.Def.RumbleAttenRange);
                    character.Position = pos;
                    character.Pitch    = PitchFromRange(Engine.Def.CharacterPitchRange);
                    rumble.Velocity    = vel;
                    character.Velocity = vel;
                }
                rumble.Update();
                character.Update();
            }

            if (cruiseLoop != null)
            {
                if (Speed < 0.98f)
                {
                    cruiseLoop.Active = false;
                }
                else
                {
                    cruiseLoop.Active   = true;
                    cruiseLoop.Position = pos;
                    cruiseLoop.Velocity = vel;
                }
                cruiseLoop.Update();
            }
            for (int i = 0; i < fireFx.Count; i++)
            {
                fireFx[i].Update(parent, time, Speed);
            }
        }
Пример #2
0
        public override void Update(TimeSpan time)
        {
            var tr  = parent.GetTransform();
            var pos = Vector3.Transform(Vector3.Zero, tr);

            if (rumble != null)
            {
                rumble.Position = pos;
                rumble.Pitch    = PitchFromRange(Engine.Def.RumblePitchRange);
                rumble.Update();
                character.Position = pos;
                character.Pitch    = PitchFromRange(Engine.Def.CharacterPitchRange);
                character.Update();
            }
            for (int i = 0; i < fireFx.Count; i++)
            {
                fireFx[i].Update(parent, time, Speed);
            }
        }