Object3D provides a base object for any 3D object that has a (local) transformation. Standard Transform:

The standard order for transformation is [parent transform] (Translate+Pivot) (Rotate) (-Pivot) (Scale) [child transform]

This is the order of matrix multiplications, left-to-right.

The order of transformation is right-to-left, however! (Scale) happens before (-Pivot) happens before (Rotate) happens before (Translate+Pivot) with no pivot, the above transform works out to [parent transform] Translate Rotate Scale [child transform] (Scale) happens before (Rotate) happens before (Translate)

This is based on code in updateTransform and ObjectContainer3D.updateSceneTransform().

Matrix3D prepend = operator on rhs - e.g. transform' = transform rhs;

Matrix3D append = operator on lhr - e.g. transform' = lhs transform;

To affect Scale:

set scaleX/Y/Z directly, or call scale(delta)

To affect Pivot:

set pivotPoint directly, or call movePivot()

To affect Rotate:

set rotationX/Y/Z individually (using degrees), set eulers [all 3 angles] (using radians), or call rotateTo()

call pitch()/yaw()/roll()/rotate() to add an additional rotation eforethe current transform. rotationX/Y/Z will be reset based on these operations.

To affect Translate (post-rotate translate):

set x/y/z/position or call moveTo().

call translate(), which modifies x/y/z based on a delta vector.

call moveForward()/moveBackward()/moveLeft()/moveRight()/moveUp()/moveDown()/translateLocal() to add an additional translate eforethe current transform. x/y/z will be reset based on these operations.


Inherited from NamedAssetBase -> EventDispatcher


Can be created using method new:

Lib.Away3D.Core.Base.Object3D.new()

Creates an Object3D object.



Created Object3D object has properties:

backVector

[read-only] (Vector3D)

downVector

[read-only] (Vector3D)

eulers

[read-only] (Vector3D) Defines the rotation of the 3d object as a Vector3D object containing euler angles for rotation around x, y and z axis.

extra

An object that can contain any extra data.

forwardVector

[read-only] (Vector3D)

leftVector

[read-only] (Vector3D)

pivotPoint

(Vector3D) Defines the local point around which the object rotates.

position

(Vector3D) Defines the position of the 3d object, relative to the local coordinates of the parent ObjectContainer3D.

rightVector

[read-only] (Vector3D)

rotationX

Defines the euler angle of rotation of the 3d object around the x-axis, relative to the local coordinates of the parent ObjectContainer3D. (Float)

rotationY

Defines the euler angle of rotation of the 3d object around the y-axis, relative to the local coordinates of the parent ObjectContainer3D. (Float)

rotationZ

Defines the euler angle of rotation of the 3d object around the z-axis, relative to the local coordinates of the parent ObjectContainer3D. (Float)

scaleX

Defines the scale of the 3d object along the x-axis, relative to local coordinates. (Float)

scaleY

Defines the scale of the 3d object along the y-axis, relative to local coordinates. (Float)

scaleZ

Defines the scale of the 3d object along the z-axis, relative to local coordinates. (Float)

transform

The transformation of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. (Matrix3D)

upVector

[read-only] (Vector3D)

x

Defines the x coordinate of the 3d object relative to the local coordinates of the parent ObjectContainer3D. (Float)

y

Defines the y coordinate of the 3d object relative to the local coordinates of the parent ObjectContainer3D. (Float)

z

Defines the z coordinate of the 3d object relative to the local coordinates of the parent ObjectContainer3D. (Float)

zOffset

Int


methods:

addEventListener(type, listener, useCapture, priority, useWeakReference)

[override]

type - String

listener - Function

useCapture - Boolean (default = false)

priority - Int (default = 0)

useWeakReference - Boolean (default = false)

clone()



dispose()

Cleans up any resources used by the current object.


disposeAsset()



lookAt(target, upAxis)

Rotates the 3d object around to face a point defined relative to the local coordinates of the parent ObjectContainer3D.

target - The vector defining the point to be looked at (Vector3D)

upAxis - (default = nil) - An optional vector used to define the desired up orientation of the 3d object after rotation has occurred (Vector3D)

moveBackward(distance)

Moves the 3d object backwards along it's local z axis

distance - The length of the movement (Float)

moveDown(distance)

Moves the 3d object backwards along it's local y axis

distance - The length of the movement (Float)

moveForward(distance)

Moves the 3d object forwards along it's local z axis

distance - The length of the movement (Float)

moveLeft(distance)

Moves the 3d object backwards along it's local x axis

distance - The length of the movement (Float)

movePivot(dx, dy, dz)

Moves the local point around which the object rotates.

dx - The amount of movement along the local x axis.(Float)

dy - The amount of movement along the local y axis.(Float)

dz - The amount of movement along the local z axis.(Float)

moveRight(distance)

Moves the 3d object forwards along it's local x axis

distance - The length of the movement (Float)

moveTo(dx, dy, dz)

Moves the 3d object directly to a point in space

dx - The amount of movement along the local x axis.(Float)

dy - The amount of movement along the local y axis.(Float)

dz - The amount of movement along the local z axis.(Float)

moveUp(distance)

Moves the 3d object forwards along it's local y axis

distance - The length of the movement (Float)

pitch(angle)

Rotates the 3d object around it's local x-axis

angle - The amount of rotation in degrees.(Float)

removeEventListener(type, listener, useCapture)

[override]

type - String

listener - Function

useCapture - Boolean (default = false)

roll(angle)

Rotates the 3d object around it's local z-axis

angle - The amount of rotation in degrees.(Float)

rotate(axis, angle)

Rotates the 3d object around an axis by a defined angle

axis - The vector defining the axis of rotation. (Vector3D)

angle - The amount of rotation in degrees.(Float)

rotateTo(ax, ay, az)

Rotates the 3d object directly to a euler angle

ax - The angle in degrees of the rotation around the x axis.(Float)

ay - The angle in degrees of the rotation around the y axis.(Float)

az - The angle in degrees of the rotation around the z axis.(Float)

scale(value)

Appends a uniform scale to the current transformation.

value - The amount by which to scale.(Float)

translate(axis, distance)

Moves the 3d object along a vector by a defined length

axis - The vector defining the axis of movement. (Vector3D)

distance - The length of the movement(Float)

translateLocal(axis, distance)

Moves the 3d object along a vector by a defined length

axis - The vector defining the axis of movement. (Vector3D)

distance - The length of the movement(Float)

yaw(angle)

Rotates the 3d object around it's local y-axis

angle - The amount of rotation in degrees.(Float)


Events: Object3DEvent.

Created with the Personal Edition of HelpNDoc: Free help authoring tool