Matrix.CreateConstrainedBillboard Method (Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>, Matrix)
Creates a cylindrical billboard that rotates around a specified axis.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
public static void CreateConstrainedBillboard (
ref Vector3 objectPosition,
ref Vector3 cameraPosition,
ref Vector3 rotateAxis,
Nullable<Vector3> cameraForwardVector,
Nullable<Vector3> objectForwardVector,
out Matrix result
)
Parameters
- objectPosition
Position of the object the billboard will rotate around. - cameraPosition
Position of the camera. - rotateAxis
Axis to rotate the billboard around. - cameraForwardVector
Optional forward vector of the camera. - objectForwardVector
Optional forward vector of the object. - result
[OutAttribute] The created billboard matrix.
Remarks
This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera forward vector if the positions are too close.
See Also
Reference
Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista