Transform GetLocalTransform()

book_4_sparkGenerated
code_blocksInput

Description

The GetLocalTransform method is a virtual method of the TransformProxy class in the Sandbox namespace. It retrieves the local transformation matrix of a game object. This transformation matrix represents the position, rotation, and scale of the object relative to its parent in the scene hierarchy.

Usage

To use the GetLocalTransform method, you need to have an instance of a class that derives from TransformProxy. Call the method on this instance to obtain the local transform of the associated game object.

Example

// Assuming 'transformProxy' is an instance of a class derived from TransformProxy
Transform localTransform = transformProxy.GetLocalTransform();

// You can now use 'localTransform' to access position, rotation, and scale
Vector3 localPosition = localTransform.Position;
Quaternion localRotation = localTransform.Rotation;
Vector3 localScale = localTransform.Scale;