SQuaternion

Index

Functions Index

Function

string ToString ()

float Angle (SQuaternion b)

SQuaternion Lerp (SQuaternion b, float t)

SQuaternion Slerp (SQuaternion b, float t)

SQuaternion RotateTowards (SQuaternion b, float delta)

float Dot (SQuaternion b)

bool Equals (SQuaternion other)

Static Functions

static SQuaternion New (float x, float y, float z, float w)

static SQuaternion Euler (float x, float y, float z)

static SQuaternion AngleAxis (SVector axis, float angle)

static SQuaternion LookRotation (SVector forward) static SQuaternion LookRotation (SVector forward, SVector up)

static SVector operator (SQuaternion a, SVector b) static SQuaternion operator (SQuaternion a, SQuaternion b)

static SQuaternion FromToRotation (SVector a, SVector b)

Properties Index

Property

float X get set

float Y get set

float Z get set

float W get set

SVector EulerAngles get

SQuaternion Inverse get

Static Properties

static SQuaternion Identity get

Functions

ToString

string ToString ()

Converts a quaternion to a human readable string

Angle

float Angle (SQuaternion b)

Returns the angle between two quaternions

Parameter
Type
Description

Lerp

SQuaternion Lerp (SQuaternion b, float t)

Linearly interpolates between this and other quaternion, by factor t and returns the result

Parameter
Type
Description

Slerp

SQuaternion Slerp (SQuaternion b, float t)

Spherically interpolates between this and other quaternion, by factor t and returns the result

Parameter
Type
Description

RotateTowards

SQuaternion RotateTowards (SQuaternion b, float delta)

Rotates this towards other, by no more than t degrees

Parameter
Type
Description

Dot

float Dot (SQuaternion b)

Returns the dot product of this and another quaternion

Parameter
Type
Description

Equals

bool Equals (SQuaternion other)

Function Description

Parameter
Type
Description

other

SQuaternion

The other Quaternion that we are comparing with.

New

static SQuaternion New (float x, float y, float z, float w)

Creates a new Quaternion

Parameter
Type
Description

Euler

static SQuaternion Euler (float x, float y, float z)

Creates a quaternion using Euler angles.

Parameter
Type
Description

AngleAxis

static SQuaternion AngleAxis (SVector axis, float angle)

Creates a quaternion from an Angle/Axis pair

Parameter
Type
Description

LookRotation

static SQuaternion LookRotation (SVector forward) static SQuaternion LookRotation (SVector forward, SVector up)

Creates a quaternion a forward vector; presuming up is (0,1,0)

Parameter
Type
Description

operator*

static SVector operator* (SQuaternion a, SVector b) static SQuaternion operator* (SQuaternion a, SQuaternion b)

The result of using the * operator.

Parameter
Type
Description

FromToRotation

static SQuaternion FromToRotation (SVector a, SVector b)

Creates a rotation which rotates from a to b.

Usually you use this to rotate a transform so that one of its axes eg. the y-axis - follows a target direction b in world space.

Parameter
Type
Description

Properties

X

float X get set

X axis

Y

float Y get set

Y axis

Z

float Z get set

Z axis

W

float W get set

W axis

EulerAngles

SVector EulerAngles get

Returns the Euler rotation for this Quaternion

Inverse

SQuaternion Inverse get

Returns the inverse of this quaternion

Identity

static SQuaternion Identity get

Equivalent of new SQuaternion(0,0,0,1)

Last updated

Was this helpful?