| Package | org.flintparticles.threeD.geom |
| Class | public class Quaternion |
| Inheritance | Quaternion Object |
| Property | Defined By | ||
|---|---|---|---|
| IDENTITY : Quaternion [static] [read-only]
An identity quaternion. | Quaternion | ||
| magnitude : Number [read-only]
The magnitude of this quaternion. | Quaternion | ||
| magnitudeSquared : Number [read-only]
The square of the magnitude of this quaternion. | Quaternion | ||
| w : Number
The w coordinate of the quaternion. | Quaternion | ||
| x : Number
The x coordinate of the quaternion. | Quaternion | ||
| y : Number
The y coordinate of the quaternion. | Quaternion | ||
| z : Number
The z coordinate of the quaternion. | Quaternion | ||
| ZERO : Quaternion [static] [read-only]
A zero quaternion. | Quaternion | ||
| Method | Defined By | ||
|---|---|---|---|
Quaternion(w:Number = 1, x:Number = 0, y:Number = 0, z:Number = 0)
Constructor
| Quaternion | ||
Adds another quaternion to this one, returning a new quaternion. | Quaternion | ||
Copies another quaternion into this one. | Quaternion | ||
Makes a copy of this Quaternion object. | Quaternion | ||
The conjugate of this quaternion. | Quaternion | ||
Subtract another quaternion from this one. | Quaternion | ||
dotProduct(q:Quaternion):Number
Calculate the dot product of this quaternion with another. | Quaternion | ||
equals(q:Quaternion):Boolean
Compare this quaternion to another. | Quaternion | ||
Add another quaternion to this one. | Quaternion | ||
The inverse of this quaternion. | Quaternion | ||
Set this quaternion to its inverse. | Quaternion | ||
nearEquals(q:Quaternion, e:Number):Boolean
Compare this quaternion to another. | Quaternion | ||
newFromAxisRotation(axis:Vector3D, angle:Number):Quaternion [static]
Create a new unit quaternion that represents a rotation about an axis in
3D space. | Quaternion | ||
Convert this quaternion to have magnitude 1. | Quaternion | ||
Post multiply this quaternion by another quaternion, returning a new quaternion. | Quaternion | ||
Post multiply this quaternion by another quaternion
| Quaternion | ||
Pre multiply this quaternion by another quaternion, returning a new quaternion. | Quaternion | ||
Pre multiply this quaternion by another quaternion
| Quaternion | ||
reset(w:Number = 0, x:Number = 0, y:Number = 0, z:Number = 0):Quaternion
Assigns new coordinates to this quaternion
| Quaternion | ||
Multiply this quaternion by a number. | Quaternion | ||
scaleBy(s:Number):Quaternion
Multiply this quaternion by a number. | Quaternion | ||
Set this quaternion equal to its conjugate. | Quaternion | ||
setFromAxisRotation(axis:Vector3D, angle:Number):Quaternion
Set this quaternion to a unit quaternion that represents a rotation
about an axis in 3D space. | Quaternion | ||
Subtract another quaternion from this one, returning a new quaternion. | Quaternion | ||
toAxisRotation():Vector3D
Convert this quaternion to an axis/angle rotation, returning the result in a Vector3D
where x, y, z represent the axis and w represents the angle, in radians. | Quaternion | ||
toMatrixTransformation():Matrix3D
Convert this quaternion to a matrix transformation. | Quaternion | ||
toString():String
Get a string representation of this quaternion
| Quaternion | ||
Create a unit quaternion in the same direction as this one. | Quaternion | ||
| IDENTITY | property |
IDENTITY:Quaternion [read-only] An identity quaternion.
public static function get IDENTITY():Quaternion| magnitude | property |
magnitude:Number [read-only] The magnitude of this quaternion.
public function get magnitude():Number| magnitudeSquared | property |
magnitudeSquared:Number [read-only] The square of the magnitude of this quaternion.
public function get magnitudeSquared():Number| w | property |
public var w:NumberThe w coordinate of the quaternion.
| x | property |
public var x:NumberThe x coordinate of the quaternion.
| y | property |
public var y:NumberThe y coordinate of the quaternion.
| z | property |
public var z:NumberThe z coordinate of the quaternion.
| ZERO | property |
ZERO:Quaternion [read-only] A zero quaternion.
public static function get ZERO():Quaternion| Quaternion | () | Constructor |
public function Quaternion(w:Number = 1, x:Number = 0, y:Number = 0, z:Number = 0)Constructor
Parametersw:Number (default = 1) — the x coordinate of the quaternion
| |
x:Number (default = 0) — the y coordinate of the quaternion
| |
y:Number (default = 0) — the z coordinate of the quaternion
| |
z:Number (default = 0) — the w coordinate of the quaternion
|
| add | () | method |
public function add(q:Quaternion, result:Quaternion = null):QuaternionAdds another quaternion to this one, returning a new quaternion.
Parameters
q:Quaternion — the quaternion to add
| |
result:Quaternion (default = null) — The quaternion to hold the result of the addition. If
no quaternion is passed, a new quaternion is created.
|
Quaternion — the result of the addition
|
| assign | () | method |
public function assign(q:Quaternion):QuaternionCopies another quaternion into this one.
Parameters
q:Quaternion — The quaternion to copy
|
Quaternion — a reference to this Quaternion object
|
| clone | () | method |
public function clone():QuaternionMakes a copy of this Quaternion object.
ReturnsQuaternion — A copy of this Quaternion
|
| conjugate | () | method |
public function conjugate(result:Quaternion = null):QuaternionThe conjugate of this quaternion.
Parameters
result:Quaternion (default = null) — The quaternion to hold the result of the conjugate. If
no quaternion is passed, a new quaternion is created.
|
Quaternion — The result of the conjugate
|
| decrementBy | () | method |
public function decrementBy(q:Quaternion):QuaternionSubtract another quaternion from this one.
Parameters
q:Quaternion — The quaternion to subtract
|
Quaternion — A reference to this Quaternion object.
|
| dotProduct | () | method |
public function dotProduct(q:Quaternion):NumberCalculate the dot product of this quaternion with another.
Parameters
q:Quaternion — The quaternion to calculate the dot product with
|
Number — The dot product of the two quaternions
|
| equals | () | method |
public function equals(q:Quaternion):BooleanCompare this quaternion to another.
Parameters
q:Quaternion — The quaternion to compare with.
|
Boolean — true if the quaternions have the same coordinates, false otherwise.
|
| incrementBy | () | method |
public function incrementBy(q:Quaternion):QuaternionAdd another quaternion to this one.
Parameters
q:Quaternion — The quaternion to add
|
Quaternion — A reference to this Quaternion object.
|
| inverse | () | method |
public function inverse(result:Quaternion = null):QuaternionThe inverse of this quaternion.
Parameters
result:Quaternion (default = null) — The quaternion to hold the result of the inverse. If
no quaternion is passed, a new quaternion is created.
|
Quaternion — The result of the inverse
|
| invert | () | method |
public function invert():QuaternionSet this quaternion to its inverse.
ReturnsQuaternion — A reference to this quaternion.
|
| nearEquals | () | method |
public function nearEquals(q:Quaternion, e:Number):BooleanCompare this quaternion to another.
Parameters
q:Quaternion — The quaternion to compare with.
| |
e:Number — The distance allowed between the coordinates of the two quaternions.
|
Boolean — true if the quaternions are within
distance e of each other, false otherwise
|
| newFromAxisRotation | () | method |
public static function newFromAxisRotation(axis:Vector3D, angle:Number):QuaternionCreate a new unit quaternion that represents a rotation about an axis in 3D space.
Parameters
axis:Vector3D — The axis of the rotation.
| |
angle:Number (default = NaN) — The angle, in radians, of the rotation. If no value is set,
the w coordinate of the axis Vector3D is used.
|
Quaternion — A Quaternion representing the rotation.
|
| normalize | () | method |
public function normalize():QuaternionConvert this quaternion to have magnitude 1.
ReturnsQuaternion — A reference to this quaternion.
|
| postMultiply | () | method |
public function postMultiply(q:Quaternion, result:Quaternion = null):QuaternionPost multiply this quaternion by another quaternion, returning a new quaternion.
Parameters
q:Quaternion — The quaternion to multiply by.
| |
result:Quaternion (default = null) — The quaternion to hold the result of the multiplication. If
no quaternion is passed, a new quaternion is created.
|
Quaternion — The result of the multiplication.
|
| postMultiplyBy | () | method |
public function postMultiplyBy(q:Quaternion):QuaternionPost multiply this quaternion by another quaternion
Parameters
q:Quaternion — The quaternion to multiply by
|
Quaternion — A reference to this Quaternion object.
|
| preMultiply | () | method |
public function preMultiply(q:Quaternion, result:Quaternion = null):QuaternionPre multiply this quaternion by another quaternion, returning a new quaternion.
Parameters
q:Quaternion — The quaternion to multiply by.
| |
result:Quaternion (default = null) — The quaternion to hold the result of the multiplication. If
no quaternion is passed, a new quaternion is created.
|
Quaternion — The result of the multiplication.
|
| preMultiplyBy | () | method |
public function preMultiplyBy(q:Quaternion):QuaternionPre multiply this quaternion by another quaternion
Parameters
q:Quaternion — The quaternion to multiply by
|
Quaternion — A reference to this Quaternion object.
|
| reset | () | method |
public function reset(w:Number = 0, x:Number = 0, y:Number = 0, z:Number = 0):QuaternionAssigns new coordinates to this quaternion
Parameters
w:Number (default = 0) — The new x coordinate
| |
x:Number (default = 0) — The new y coordinate
| |
y:Number (default = 0) — The new z coordinate
| |
z:Number (default = 0) — The new w coordinate
|
Quaternion — a reference to this Quaternion object
|
| scalarMultiply | () | method |
public function scalarMultiply(s:Number, result:Quaternion = null):QuaternionMultiply this quaternion by a number.
Parameters
s:Number — The number to multiply the quaternion by
| |
result:Quaternion (default = null) — The quaternion to hold the result of the multiplication. If
no quaternion is passed, a new quaternion is created.
|
Quaternion — The result of the multiplication
|
| scaleBy | () | method |
public function scaleBy(s:Number):QuaternionMultiply this quaternion by a number.
Parameters
s:Number — The number to multiply by
|
Quaternion — A reference to this Quaternion object.
|
| selfConjugate | () | method |
public function selfConjugate():QuaternionSet this quaternion equal to its conjugate.
ReturnsQuaternion — A reference to this quaternion.
|
| setFromAxisRotation | () | method |
public function setFromAxisRotation(axis:Vector3D, angle:Number):QuaternionSet this quaternion to a unit quaternion that represents a rotation about an axis in 3D space.
Parameters
axis:Vector3D — The axis of the rotation.
| |
angle:Number (default = NaN) — The angle, in radians, of the rotation. If no value is set,
the w coordinate of the axis Vector3D is used.
|
Quaternion — A reference to this Quaternion.
|
| subtract | () | method |
public function subtract(q:Quaternion, result:Quaternion = null):QuaternionSubtract another quaternion from this one, returning a new quaternion.
Parameters
q:Quaternion — The quaternion to subtract
| |
result:Quaternion (default = null) — The quaternion to hold the result of the subtraction. If
no quaternion is passed, a new quaternion is created.
|
Quaternion — The result of the subtraction
|
| toAxisRotation | () | method |
public function toAxisRotation():Vector3DConvert this quaternion to an axis/angle rotation, returning the result in a Vector3D where x, y, z represent the axis and w represents the angle, in radians.
ReturnsVector3D — The axis/angle rotation.
|
| toMatrixTransformation | () | method |
public function toMatrixTransformation():Matrix3DConvert this quaternion to a matrix transformation.
ReturnsMatrix3D — The matrix transformation.
|
| toString | () | method |
public function toString():StringGet a string representation of this quaternion
ReturnsString — a string representation of this quaternion
|
| unit | () | method |
public function unit(result:Quaternion = null):QuaternionCreate a unit quaternion in the same direction as this one.
Parameters
result:Quaternion (default = null) — The quaternion to hold the result. If
no quaternion is passed, a new quaternion is created.
|
Quaternion — The unit quaternion in the same direction as this one.
|