public override void Update(GameTime gameTime) { base.Update(gameTime); //UpdateMatrixes(); // Calculate the base transformation by combining // translation, rotation, and scaling baseWorld = Matrix.CreateScale(Scale) * Matrix.CreateFromYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z) * Matrix.CreateTranslation(Position); UpdateProximitySphere(); }
public override void Update(GameTime gameTime) { base.Update(gameTime); BaseWorld = Matrix.Identity; BaseWorld = Matrix.CreateScale(Scale) * Matrix.CreateFromYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z + -MathHelper.PiOver2) * Matrix.CreateTranslation(ParentPosition) * Matrix.CreateFromYawPitchRoll(ParentRotation.Y, ParentRotation.X, ParentRotation.Z) * Matrix.CreateTranslation(Position); // Set object and camera info PlaneBasicEffect.World = BaseWorld; PlaneBasicEffect.View = S.Camera.View; PlaneBasicEffect.Projection = S.Camera.Projection; S.GraphicsDM.GraphicsDevice.SetVertexBuffer(PlaneVertexBuffer); }