Matrix GetMatrix( Sandbox.StringToken& name, Matrix& defaultValue )

book_4_sparkGenerated
code_blocksInput

Description

The GetMatrix method retrieves a Matrix value associated with a specified StringToken key from the RenderAttributes collection. If the key does not exist, it returns a default matrix value provided by the caller.

Usage

To use the GetMatrix method, you need to have a RenderAttributes instance. Call the method with a StringToken representing the key and a Matrix as the default value. The method will return the matrix associated with the key if it exists, or the default value if it does not.

Example

RenderAttributes renderAttributes = new RenderAttributes();
StringToken key = new StringToken("transform");
Matrix defaultMatrix = Matrix.Identity;

Matrix resultMatrix = renderAttributes.GetMatrix(ref key, ref defaultMatrix);

// Use resultMatrix for further operations