Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Quaternion

The class to maniplate quaternion. Basically,you don't need to operate raw element. You consider to use some of useful methods without editing raw element forcelly. Each element will be represented as (w;x,y,z) (1,i,j,k) is base axis for quaternion. (i,j,k is pure imaginary number) (w;x,y,z) means w1+xi+yj+zk

Hierarchy

  • Quaternion

Index

Constructors

constructor

Properties

rawElements

rawElements: IArray

Accessors

Conjugate

ImaginaryPart

Length

  • get Length(): number

W

  • get W(): number

X

  • get X(): number

Y

  • get Y(): number

Z

  • get Z(): number

eularAngles

Static Identity

Methods

equalWith

factoringQuaternionXYZ

  • factoringQuaternionXYZ(): object

factoringQuaternionZXY

  • factoringQuaternionZXY(): object

inverse

normalize

toAngleAxisString

  • toAngleAxisString(): string

toString

  • toString(): string

Static add

Static angle

  • Returns the angle in degrees between two rotations q1 and q2.

    Parameters

    • q1: Quaternion

      the quaternion represents begin angle.

    • q2: Quaternion

      the quaternion represents end angle.

    Returns number

    angle represented in radians.

Static angleAxis

Static equals

Static euler

  • euler(x: number, y: number, z: number): Quaternion

Static eulerXYZ

  • eulerXYZ(x: number, y: number, z: number): Quaternion

Static fromToRotation

  • Returns a quaternion that transform provided 'from' vector into 'to' vector. If 'from' cross 'to' is closer to 0 vector, axisHint is used as axis. This may only used for the situation when from vector and to vector is in relations these are negating the other.

    Parameters

    • from: Vector3
    • to: Vector3
    • Default value axisHint: Vector3 = null

      if no vector specified to this argument, [0,1,0] will be used for default

    Returns Quaternion

Static lookRotation

Static multiply

Static parse

  • Parse angle string in 3D. "p" means Pi. Ex) 3/4 p "d" means degree. if this unit was specified, the argument will be parsed as degree. Ex) 90d "eular(x,y,z)" means rotation in eular. This means Z-X-Y rotation like Unity. "axis(angle,x,y,z)" means rotation around specified axis. This means angle radians will be rotated around the axis (x,y,z). This angle can be specified with the character "p" or "d". "x(angle)","y(angle)" or "z(angle)" means rotation around unit axis. This angle can be specified with the character "p" or "d".

    Parameters

    • input: string

      the string to be parsed as angle in 3D.

    Returns Quaternion

    parsed rotation in Quaternion.

Static slerp

Generated using TypeDoc