Photon Quantum 2.1.1

Public Member Functions | Public Attributes | Properties | List of all members
Quantum.Transform3D Struct Reference

The Transform3D is an entity component providing position and rotation for a 3D object. More...

Inherits Quantum.IComponent.

Public Member Functions

FPVector3 InverseTransformDirection (FPVector3 direction)
 Transforms a direction from world space to local space. Rotation is expected to be normalized. More...
 
FPVector3 InverseTransformPoint (FPVector3 position)
 Transforms a position from world space to local space. Rotation is expected to be normalized. More...
 
void LookAt (FPVector3 position, FPVector3? up=null)
 Rotates the transform so the forward vector points at position . If up is not set, will use FPVector3.Up instead. More...
 
void Rotate (FP xAngle, FP yAngle, FP zAngle, bool normalize=true)
 Applies a rotation of zAngle degrees around the z-axis, xAngle degrees around the x-axis, and yAngle degrees around the y-axis (in that order). More...
 
void Rotate (FPVector3 angles, bool normalize=true)
 Applies a rotation of angles .z degrees around the z-axis, angles .x degrees around the x-axis, and angles .y degrees around the y-axis (in that order). More...
 
void Rotate (FPVector3 axis, FP angle, bool normalize=true)
 Rotates the object around the given axis by the number of degrees defined by the given angle. More...
 
FPVector3 TransformDirection (FPVector3 direction)
 Transforms a direction from local space to world space. Rotation is expected to be normalized. More...
 
FPVector3 TransformPoint (FPVector3 position)
 Transforms a position from local space to world space. Rotation is expected to be normalized. More...
 

Public Attributes

FPVector3 Back => -Forward
 A vector pointing to local -Z axis. More...
 
FPVector3 Down => -Up
 A vector pointing to local -Y axis. More...
 
FPVector3 EulerAngles => Rotation.AsEuler
 Converts rotation to Euler angles triplet. More...
 
FPVector3 Left => -Right
 A vector pointing to local -X axis. More...
 
FPMatrix4x4 LocalToWorldMatrix => FPMatrix4x4.TRS(Position, Rotation, FPVector3.One)
 Creates local to world transformation. Rotation is expected to be normalized. More...
 
FPMatrix4x4 WorldToLocalMatrix => FPMatrix4x4.InverseTRS(Position, Rotation, FPVector3.One)
 Creates world to local transformation. Rotation is expected to be normalized. More...
 

Properties

FPVector3 Forward [get]
 A vector pointing to local +Z axis. More...
 
FPVector3 Right [get]
 A vector pointing to local +X axis. More...
 
FPVector3 Up [get]
 A vector pointing to local +Y axis. More...
 

Detailed Description

The Transform3D is an entity component providing position and rotation for a 3D object.

Member Function Documentation

◆ InverseTransformDirection()

FPVector3 Quantum.Transform3D.InverseTransformDirection ( FPVector3  direction)

Transforms a direction from world space to local space. Rotation is expected to be normalized.

◆ TransformDirection()

FPVector3 Quantum.Transform3D.TransformDirection ( FPVector3  direction)

Transforms a direction from local space to world space. Rotation is expected to be normalized.

◆ InverseTransformPoint()

FPVector3 Quantum.Transform3D.InverseTransformPoint ( FPVector3  position)

Transforms a position from world space to local space. Rotation is expected to be normalized.

◆ TransformPoint()

FPVector3 Quantum.Transform3D.TransformPoint ( FPVector3  position)

Transforms a position from local space to world space. Rotation is expected to be normalized.

◆ LookAt()

void Quantum.Transform3D.LookAt ( FPVector3  position,
FPVector3 up = null 
)
inline

Rotates the transform so the forward vector points at position . If up is not set, will use FPVector3.Up instead.

Parameters
position
up

◆ Rotate() [1/3]

void Quantum.Transform3D.Rotate ( FPVector3  angles,
bool  normalize = true 
)
inline

Applies a rotation of angles .z degrees around the z-axis, angles .x degrees around the x-axis, and angles .y degrees around the y-axis (in that order).

Parameters
anglesEuler angles, in degrees.
normalizeIf the resultant quaternion should be normalized before being set to the Rotation. This prevents rounding error from accumulating and potentially rounding the quaternion magnitude towards zero over time.

◆ Rotate() [2/3]

void Quantum.Transform3D.Rotate ( FP  xAngle,
FP  yAngle,
FP  zAngle,
bool  normalize = true 
)
inline

Applies a rotation of zAngle degrees around the z-axis, xAngle degrees around the x-axis, and yAngle degrees around the y-axis (in that order).

Parameters
xAngle
yAngle
zAngle
normalizeIf the resultant quaternion should be normalized before being set to the Rotation. This prevents rounding error from accumulating and potentially rounding the quaternion magnitude towards zero over time.

◆ Rotate() [3/3]

void Quantum.Transform3D.Rotate ( FPVector3  axis,
FP  angle,
bool  normalize = true 
)
inline

Rotates the object around the given axis by the number of degrees defined by the given angle.

Parameters
axis
angle
normalizeIf the resultant quaternion should be normalized before being set to the Rotation. This prevents rounding error from accumulating and potentially rounding the quaternion magnitude towards zero over time.

Member Data Documentation

◆ Left

FPVector3 Quantum.Transform3D.Left => -Right

A vector pointing to local -X axis.

◆ Down

FPVector3 Quantum.Transform3D.Down => -Up

A vector pointing to local -Y axis.

◆ Back

FPVector3 Quantum.Transform3D.Back => -Forward

A vector pointing to local -Z axis.

◆ EulerAngles

FPVector3 Quantum.Transform3D.EulerAngles => Rotation.AsEuler

Converts rotation to Euler angles triplet.

See also
FPQuaternion.AsEuler

.

◆ LocalToWorldMatrix

FPMatrix4x4 Quantum.Transform3D.LocalToWorldMatrix => FPMatrix4x4.TRS(Position, Rotation, FPVector3.One)

Creates local to world transformation. Rotation is expected to be normalized.

◆ WorldToLocalMatrix

FPMatrix4x4 Quantum.Transform3D.WorldToLocalMatrix => FPMatrix4x4.InverseTRS(Position, Rotation, FPVector3.One)

Creates world to local transformation. Rotation is expected to be normalized.

Property Documentation

◆ Right

FPVector3 Quantum.Transform3D.Right
get

A vector pointing to local +X axis.

◆ Up

FPVector3 Quantum.Transform3D.Up
get

A vector pointing to local +Y axis.

◆ Forward

FPVector3 Quantum.Transform3D.Forward
get

A vector pointing to local +Z axis.