Пример #1
0
        public override void Update(GameTime gameTime, Vector3 Position, float ParentMass)
        {
            RotationTime += 0.05f * (float)gameTime.ElapsedGameTime.TotalSeconds;
            Transforms    = new ScalePositionRotation(
                Transforms.Scale
                , Transforms.Position
                , Matrix.CreateFromAxisAngle(RotationAxis, RotationTime));

            base.Update(gameTime, Position + Transforms.Position, ParentMass);
        }
Пример #2
0
        public override void Update(GameTime gameTime, Vector3 Position, float ParentMass)
        {
            //Orbit around the planet
            Velocity -= Vector3.Normalize(Transforms.Position)
                        * Body.GetGravitationalForce(Transforms.Position, ParentMass, Mass)
                        * (float)gameTime.ElapsedGameTime.TotalSeconds;

            //Rotate along a random axis
            RotationTime += 0.2f * (float)gameTime.ElapsedGameTime.TotalSeconds;
            Transforms    = new ScalePositionRotation(
                Transforms.Scale
                , Transforms.Position + Velocity * (float)gameTime.ElapsedGameTime.TotalSeconds
                , Matrix.CreateFromAxisAngle(RotationAxis, RotationTime));

            base.Update(gameTime, Position + Transforms.Position, Mass);
        }
Пример #3
0
        public override void Update(GameTime gameTime, Vector3 Position, float ParentMass)
        {
            //Orbit around the star
            Velocity -= Vector3.Normalize(Transforms.Position)
                * Body.GetGravitationalForce(Transforms.Position, ParentMass, Mass)
                * (float)gameTime.ElapsedGameTime.TotalMinutes;

            //Rotate along a random axis
            RotationTime += 0.1f * (float)gameTime.ElapsedGameTime.TotalSeconds;
            Transforms = new ScalePositionRotation(
                Transforms.Scale
                , Transforms.Position + Velocity * (float)gameTime.ElapsedGameTime.TotalMinutes
                , Matrix.CreateFromAxisAngle(RotationAxis, RotationTime));

            base.Update(gameTime, Position + Transforms.Position, ParentMass);
        }
Пример #4
0
        public override void Update(GameTime gameTime, Vector3 Position, float ParentMass)
        {
            RotationTime += 0.025f * (float)gameTime.ElapsedGameTime.TotalSeconds;
            Transforms = new ScalePositionRotation(
                Transforms.Scale
                , Transforms.Position
                , Matrix.CreateFromAxisAngle(RotationAxis, RotationTime));

            base.Update(gameTime, Position + Transforms.Position, ParentMass);
        }