docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct LocalTransform

    Position, rotation and scale of this entity, relative to the parent, or in world space, if no parent exists.

    Implements
    IComponentData
    IQueryTypeParameter
    Namespace: Unity.Transforms
    Assembly: Unity.Transforms.dll
    Syntax
    [BurstCompile]
    public struct LocalTransform : IComponentData, IQueryTypeParameter
    Remarks

    If the entity has a Parent component, LocalTransform is relative to that parent. Otherwise, it is in world space.

    Fields

    Name Description
    Identity

    The identity transform.

    Position

    The position of this transform.

    Rotation

    The rotation of this transform.

    Scale

    The uniform scale of this transform.

    Methods

    Name Description
    ApplyScale(float)

    Scales this transform by the specified factor.

    Equals(in LocalTransform)

    Checks if a transform has equal position, rotation, and scale to another.

    Forward()

    Gets the forward vector of unit length.

    FromMatrix(float4x4)

    Returns the Transform equivalent of a float4x4 matrix.

    FromMatrixSafe(float4x4)

    Returns the Transform equivalent of a float4x4 matrix. Throws and exception if the matrix contains nonuniform scale or shear.

    FromPosition(float, float, float)

    Returns a Transform initialized with the given position. Rotation will be identity, and scale will be 1.

    FromPosition(float3)

    Returns a Transform initialized with the given position. Rotation will be identity, and scale will be 1.

    FromPositionRotation(float3, quaternion)

    Returns a Transform initialized with the given position and rotation. Scale will be 1.

    FromPositionRotationScale(float3, quaternion, float)

    Returns a Transform initialized with the given position, rotation and scale.

    FromRotation(quaternion)

    Returns a Transform initialized with the given rotation. Position will be 0,0,0, and scale will be 1.

    FromScale(float)

    Returns a Transform initialized with the given scale. Position will be 0,0,0, and rotation will be identity.

    Inverse()

    Gets the inverse of this transform.

    InverseTransformDirection(float3)

    Transforms a direction by the inverse of this transform.

    InverseTransformPoint(float3)

    Transforms a point by the inverse of this transform.

    InverseTransformRotation(quaternion)

    Transforms a rotation by the inverse of this transform.

    InverseTransformScale(float)

    Transforms a scale by the inverse of this transform.

    InverseTransformTransform(in LocalTransform)

    Transforms a LocalTransform by the inverse of this transform.

    Right()

    Gets the right vector of unit length.

    Rotate(quaternion)

    Rotates this Transform by the specified quaternion.

    RotateX(float)

    Rotates this Transform around the X axis.

    RotateY(float)

    Rotates this Transform around the Y axis.

    RotateZ(float)

    Rotates this Transform around the Z axis.

    ToInverseMatrix()

    Gets the float4x4 equivalent of the inverse of this transform.

    ToMatrix()

    Gets the float4x4 equivalent of this transform.

    ToString()

    Convert transformation data to a human-readable string

    TransformDirection(float3)

    Transforms a direction by this transform.

    TransformPoint(float3)

    Transforms a point by this transform.

    TransformRotation(quaternion)

    Transforms a rotation by this transform.

    TransformScale(float)

    Transforms a scale by this transform.

    TransformTransform(in LocalTransform)

    Transforms a Transform by this transform.

    Translate(float3)

    Translates this transform by the specified vector.

    Up()

    Gets the up vector of unit length.

    WithPosition(float, float, float)

    Creates a transform that is identical but with a new position value.

    WithPosition(float3)

    Gets an identical transform with a new position value.

    WithRotation(quaternion)

    Gets an identical transform with a new rotation value.

    WithScale(float)

    Gets an identical transform with a new scale value.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)