Packageaway3d.core.math
Classpublic final class Quaternion
InheritanceQuaternion Inheritance Object

A Quaternion object.



Public Properties
 PropertyDefined By
  magnitude : Number
[read-only] Returns the magnitude of the quaternion object.
Quaternion
  w : Number
The w value of the quatertion.
Quaternion
  x : Number
The x value of the quatertion.
Quaternion
  y : Number
The y value of the quatertion.
Quaternion
  z : Number
The z value of the quatertion.
Quaternion
Public Methods
 MethodDefined By
  
axis2quaternion(x:Number, y:Number, z:Number, angle:Number):void
Fills the quaternion object with values representing the given rotation around a vector.
Quaternion
  
euler2quaternion(ax:Number, ay:Number, az:Number):void
Fills the quaternion object with values representing the given euler rotation.
Quaternion
  
Fills the quaternion object with the result from a multipication of two quaternion objects.
Quaternion
  
normalize(val:Number = 1):void
Normalises the quaternion object.
Quaternion
  
toString():String
Used to trace the values of a quaternion.
Quaternion
Property Detail
magnitudeproperty
magnitude:Number  [read-only]

Returns the magnitude of the quaternion object.


Implementation
    public function get magnitude():Number
wproperty 
public var w:Number

The w value of the quatertion.

xproperty 
public var x:Number

The x value of the quatertion.

yproperty 
public var y:Number

The y value of the quatertion.

zproperty 
public var z:Number

The z value of the quatertion.

Method Detail
axis2quaternion()method
public function axis2quaternion(x:Number, y:Number, z:Number, angle:Number):void

Fills the quaternion object with values representing the given rotation around a vector.

Parameters

x:Number — The x value of the rotation vector.
 
y:Number — The y value of the rotation vector.
 
z:Number — The z value of the rotation vector.
 
angle:Number — The angle in radians of the rotation.

euler2quaternion()method 
public function euler2quaternion(ax:Number, ay:Number, az:Number):void

Fills the quaternion object with values representing the given euler rotation.

Parameters

ax:Number — The angle in radians of the rotation around the x axis.
 
ay:Number — The angle in radians of the rotation around the y axis.
 
az:Number — The angle in radians of the rotation around the z axis.

multiply()method 
public function multiply(qa:Quaternion, qb:Quaternion):void

Fills the quaternion object with the result from a multipication of two quaternion objects.

Parameters

qa:Quaternion — The first quaternion in the multipication.
 
qb:Quaternion — The second quaternion in the multipication.

normalize()method 
public function normalize(val:Number = 1):void

Normalises the quaternion object.

Parameters

val:Number (default = 1)

toString()method 
public function toString():String

Used to trace the values of a quaternion.

Returns
String — A string representation of the quaternion object.