githubEdit

RotationMatrix

Introduction

The RotationMatrix property is a property that represents the full rotation of an IRotatable. The information contained in RotationMatrix combines the information of FlatRedBall.Math.IRotatable.RotationXarrow-up-right, FlatRedBall.Math.IRotatable.RotationYarrow-up-right, and FlatRedBall.Math.IRotatable.RotationZarrow-up-right.

Vector Components

The Matrix object contains numerous Vector3 properties which can be used to extract direction values. For example, the following code can be used to move a car forward in 2D space, assuming that the un-rotated car faces up:

CarInstance.Velocity = CarInstance.RotationMatrix.Up * CarInstance.Speed;

For a more-complete example, check the Rock Blaster tutorial, specifically this page.

Last updated

Was this helpful?