Package | away3d.core.math |
Class | public final class Quaternion |
Property | Defined by | ||
---|---|---|---|
magnitude : Number [read-only]
Returns the magnitude of the quaternion object.
| Quaternion | ||
w : Number = 1
The w value of the quaternion.
| Quaternion | ||
x : Number = 0
The x value of the quaternion.
| Quaternion | ||
y : Number = 0
The y value of the quaternion.
| Quaternion | ||
z : Number = 0
The z value of the quaternion.
| Quaternion |
Method | Defined by | ||
---|---|---|---|
Quaternion
(x:Number = 0, y:Number = 0, z:Number = 0, w:Number = 1)
Creates a new Quaternion object.
| Quaternion | ||
Clones the quaternion.
| Quaternion | ||
Copies the data from a quaternion into this instance.
| Quaternion | ||
fromAxisAngle(axis:Vector3D, angle:Number):void
Fills the quaternion object with values representing the given rotation around a vector.
| Quaternion | ||
fromEulerAngles(ax:Number, ay:Number, az:Number):void
Fills the quaternion object with values representing the given euler rotation.
| Quaternion | ||
fromMatrix(matrix:Matrix3D):void
Extracts a quaternion rotation matrix out of a given Matrix3D object.
| Quaternion | ||
Linearly interpolates between two quaternions.
| Quaternion | ||
Fills the quaternion object with the result from a multipication of two quaternion objects.
| Quaternion | ||
Quaternion | |||
normalize(val:Number = 1):void
Normalises the quaternion object.
| Quaternion | ||
rotatePoint(vector:Vector3D, target:Vector3D = null):Vector3D
Rotates a point.
| Quaternion | ||
Spherically interpolates between two quaternions, providing an interpolation between rotations with constant angle change rate.
| Quaternion | ||
toEulerAngles(target:Vector3D = null):Vector3D
Fills a target Vector3D object with the Euler angles that form the rotation represented by this quaternion.
| Quaternion | ||
toMatrix3D(target:Matrix3D = null):Matrix3D
Converts the quaternion to a Matrix3D object representing an equivalent rotation.
| Quaternion | ||
toRawData(target:Vector, exclude4thRow:Boolean = false):void
Converts the quaternion to a Vector.
| Quaternion | ||
toString():String
Used to trace the values of a quaternion.
| Quaternion |
magnitude | property |
magnitude:Number
[read-only]Returns the magnitude of the quaternion object.
Implementation public function get magnitude():Number
w | property |
public var w:Number = 1
The w value of the quaternion.
x | property |
public var x:Number = 0
The x value of the quaternion.
y | property |
public var y:Number = 0
The y value of the quaternion.
z | property |
public var z:Number = 0
The z value of the quaternion.
Quaternion | () | constructor |
public function Quaternion(x:Number = 0, y:Number = 0, z:Number = 0, w:Number = 1)
Parameters
x:Number (default = 0 ) — The x value of the quaternion.
|
|
y:Number (default = 0 ) — The y value of the quaternion.
|
|
z:Number (default = 0 ) — The z value of the quaternion.
|
|
w:Number (default = 1 ) — The w value of the quaternion.
|
clone | () | method |
public function clone():Quaternion
Clones the quaternion.
ReturnsQuaternion —
An exact duplicate of the current Quaternion.
|
copyFrom | () | method |
public function copyFrom(q:Quaternion):void
Copies the data from a quaternion into this instance.
Parametersq:Quaternion — The quaternion to copy from.
|
fromAxisAngle | () | method |
public function fromAxisAngle(axis:Vector3D, angle:Number):void
Fills the quaternion object with values representing the given rotation around a vector.
Parametersaxis:Vector3D — The x value of the rotation vector.
|
|
angle:Number — The y value of the rotation vector.
|
fromEulerAngles | () | method |
public function fromEulerAngles(ax:Number, ay:Number, az:Number):void
Fills the quaternion object with values representing the given euler rotation.
Parametersax: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.
|
fromMatrix | () | method |
public function fromMatrix(matrix:Matrix3D):void
Extracts a quaternion rotation matrix out of a given Matrix3D object.
Parametersmatrix:Matrix3D — The Matrix3D out of which the rotation will be extracted.
|
lerp | () | method |
public function lerp(qa:Quaternion, qb:Quaternion, t:Number):void
Linearly interpolates between two quaternions.
Parametersqa:Quaternion — The first quaternion to interpolate.
|
|
qb:Quaternion — The second quaternion to interpolate.
|
|
t:Number — The interpolation weight, a value between 0 and 1.
|
multiply | () | method |
public function multiply(qa:Quaternion, qb:Quaternion):void
Fills the quaternion object with the result from a multipication of two quaternion objects.
Parametersqa:Quaternion — The first quaternion in the multipication.
|
|
qb:Quaternion — The second quaternion in the multipication.
|
multiplyVector | () | method |
public function multiplyVector(vector:Vector3D, target:Quaternion = null):Quaternion
Parameters
vector:Vector3D |
|
target:Quaternion (default = null )
|
Quaternion |
normalize | () | method |
public function normalize(val:Number = 1):void
Normalises the quaternion object.
Parametersval:Number (default = 1 )
|
rotatePoint | () | method |
public function rotatePoint(vector:Vector3D, target:Vector3D = null):Vector3D
Rotates a point.
Parametersvector:Vector3D — The Vector3D object to be rotated.
|
|
target:Vector3D (default = null ) — An optional Vector3D object that will contain the rotated coordinates. If not provided, a new object will be created.
|
Vector3D — A Vector3D object containing the rotated point.
|
slerp | () | method |
public function slerp(qa:Quaternion, qb:Quaternion, t:Number):void
Spherically interpolates between two quaternions, providing an interpolation between rotations with constant angle change rate.
Parametersqa:Quaternion — The first quaternion to interpolate.
|
|
qb:Quaternion — The second quaternion to interpolate.
|
|
t:Number — The interpolation weight, a value between 0 and 1.
|
toEulerAngles | () | method |
public function toEulerAngles(target:Vector3D = null):Vector3D
Fills a target Vector3D object with the Euler angles that form the rotation represented by this quaternion.
Parameterstarget:Vector3D (default = null ) — An optional Vector3D object to contain the Euler angles. If not provided, a new object is created.
|
Vector3D — The Vector3D containing the Euler angles.
|
toMatrix3D | () | method |
public function toMatrix3D(target:Matrix3D = null):Matrix3D
Converts the quaternion to a Matrix3D object representing an equivalent rotation.
Parameterstarget:Matrix3D (default = null ) — An optional Matrix3D container to store the transformation in. If not provided, a new object is created.
|
Matrix3D — A Matrix3D object representing an equivalent rotation.
|
toRawData | () | method |
public function toRawData(target:Vector, exclude4thRow:Boolean = false):void
Converts the quaternion to a Vector.
target:Vector — The Vector. |
|
exclude4thRow:Boolean (default = false ) — If true, the last row will be omitted, and a 4x3 matrix will be generated instead of a 4x4.
|
toString | () | method |
public function toString():String
Used to trace the values of a quaternion.
ReturnsString — A string representation of the quaternion object.
|