Repository

Transform

Constructor Summary

Public Constructor
public

Transform class is meant to be aggregated to any object that needs to be transformed in space.

Member Summary

Public Members
public

children: *[]

public
public
public

Method Summary

Public Methods
public

addChild(child: Transform Mesh)

Adds a child to this transform (argument must be a transform too)

public

Adds a children array to this transform (argument must be a transform too)

public

Gets one of all the children objects of this transform

public

getChildren(recursive: *): Array

Gets an array containning all the children objects of this transform

public

Get the 3 direction vectors of this transform

public
public
public

Gets the local position of this transform

public

Gets the local x position of this transform

public

Gets the local x position of this transform

public

Gets the local z position of this transform

public

Get the object rotation as a quarternion.

public

Get the current local rotation of this transform

public

Get the current x local rotation of this transform

public

Get the current y local rotation of this transform

public

Get the current z local rotation of this transform

public
public
public
public
public
public

getParent(): *

public

getRecurseChildren(transform: *)

public

Return a Vector2 giving the screen coordinates of the object

public
public

get the world matrix of the object

public
public

get the world quaternion of the object

public

lookAt(vector: Vector)

Geneates a transform to point at a certain coordinates, makes the object "look at" this point.

public

pick(cam: Camera, x: number, y: number): Object

Perform a RayCast picking

public

Removes a child from the children chain

public

setLocalEulerAngles(arg1: *, arg2: *, arg3: *)

public
public

setLocalPosition(number|Vector3|Vector2: float | Vector3 | Vector2, Number: float, Number: float)

Set the local position of the transform (and to the object attach to it).

public

Sets this transform's x position

public

Sets this transform's y position

public

Sets this transform's z position

public

Set the object rotation with a quarternion {x,y,z,w}.

public

setLocalRotation(number|Vector3|Vector2: float | Vector3 | Vector2, Number: float, Number: float)

Set the euler angles rotation in degrees.

public

Defines the oreder of application for rotation axis.

public

Sets this transform's x rotation

public

Sets this transform's y rotation

public

Sets this transform's z rotation

public

setLocalScale(number|Vector3|Vector2: float | Vector3 | Vector2, Number: float, Number: float)

Set the scale of the transform.

public

Sets this transform's x scale

public

Sets this transform's y scale

public

Sets this transform's z scale

public

Sets the render order of this object.

public

setUpDirection(vector: *)

public

Set this object visibility

Public Constructors

public constructor() source

Transform class is meant to be aggregated to any object that needs to be transformed in space. Mesh, Light or Camera contains a transform instance.

Public Members

public children: *[] source

public mobObject: * source

public nativeObject: * source

public recursiveChildren: *[] source

Public Methods

public addChild(child: Transform Mesh) source

Adds a child to this transform (argument must be a transform too)

Params:

NameTypeAttributeDescription
childTransform Mesh

public addChildren(child: Array) source

Adds a children array to this transform (argument must be a transform too)

Params:

NameTypeAttributeDescription
childArray

public getChild(index: Number): Object source

Gets one of all the children objects of this transform

Params:

NameTypeAttributeDescription
indexNumber

Index of the child to get

Return:

Object

public getChildren(recursive: *): Array source

Gets an array containning all the children objects of this transform

Params:

NameTypeAttributeDescription
recursive*

Return:

Array

public getDirections(): Object source

Get the 3 direction vectors of this transform

Return:

Object

object with all 3 Vector3 as {upVector: upVector, forwardVector: forwardVector,leftVector: leftVector};

public getLocalEulerAngles(): * source

Return:

*

public getLocalMatrix(): Matrix4 source

Return:

Matrix4

local matrix of the object

public getLocalPosition(): Vector3 source

Gets the local position of this transform

Return:

Vector3

localPosition vector

public getLocalPositionX(): Number source

Gets the local x position of this transform

Return:

Number

localPosition x

public getLocalPositionY(): Number source

Gets the local x position of this transform

Return:

Number

localPosition y

public getLocalPositionZ(): Number source

Gets the local z position of this transform

Return:

Number

localPosition z

public getLocalQuaternion(): Quaternion source

Get the object rotation as a quarternion.

Return:

Quaternion

quarternion

public getLocalRotation(): Vector3 source

Get the current local rotation of this transform

Return:

Vector3

localRotation vector

public getLocalRotationX(): Number source

Get the current x local rotation of this transform

Return:

Number

localRotation x value

public getLocalRotationY(): Number source

Get the current y local rotation of this transform

Return:

Number

localRotation y value

public getLocalRotationZ(): Number source

Get the current z local rotation of this transform

Return:

Number

localRotation z value

public getLocalScale(): Vector3 source

Return:

Vector3

localScale vector

public getLocalScaleX(): Number source

Return:

Number

localScale x

public getLocalScaleY(): Number source

Return:

Number

localScale y

public getLocalScaleZ(): Number source

Return:

Number

localScale z

public getNativeObject(): * source

Return:

*

the Three.js native object used in this class

public getParent(): * source

Return:

*

public getRecurseChildren(transform: *) source

Params:

NameTypeAttributeDescription
transform*

public getScreenCoordinates(context: Context, camera: Camera): Vector2 source

Return a Vector2 giving the screen coordinates of the object

Params:

NameTypeAttributeDescription
contextContext

the current Mobilizing context

cameraCamera

the Camera to use for the projection

Return:

Vector2

the screen coordinates of the object

public getVisible(): * source

Return:

*

the visibility of this object

public getWorldMatrix(): * source

get the world matrix of the object

Return:

*

world matrix of the object

public getWorldPosition(): Vector3 source

Return:

Vector3

world Position vector of the object

public getWorldQuaternion(): * source

get the world quaternion of the object

Return:

*

world quaternion of the object

public lookAt(vector: Vector) source

Geneates a transform to point at a certain coordinates, makes the object "look at" this point.

Params:

NameTypeAttributeDescription
vectorVector

public pick(cam: Camera, x: number, y: number): Object source

Perform a RayCast picking

Params:

NameTypeAttributeDescription
camCamera

The camera to use as a ray caster.

xnumber

The x coordinate in screen space for the ray casting

ynumber

The y coordinate in screen space for the ray casting

Return:

Object

if picking success, gives an object as {point:{x,y,z} in world coordinates, uv:{u,v}, distance:dist}, null otherwise.

public removeChild(child: Transform) source

Removes a child from the children chain

Params:

NameTypeAttributeDescription
childTransform

public setLocalEulerAngles(arg1: *, arg2: *, arg3: *) source

Params:

NameTypeAttributeDescription
arg1*
arg2*
arg3*

public setLocalMatrix(m: *) source

Params:

NameTypeAttributeDescription
m*

public setLocalPosition(number|Vector3|Vector2: float | Vector3 | Vector2, Number: float, Number: float) source

Set the local position of the transform (and to the object attach to it). Polymorphic : can take various agruments of various types. Possible arguments number is 1, 2 or 3.

Params:

NameTypeAttributeDescription
number|Vector3|Vector2float | Vector3 | Vector2

Value for the new position of the transform. If a Vector3 is given, its x, y, z will be used for the position x, y, z. If a Vector2 is given, its x, y will be used for the position x and y, but z will be unchanged. If a number is given, it will be the position x.

Numberfloat

Value for the new y position of the transform.

Numberfloat

Value for the new z position of the transform.

public setLocalPositionX(arg: Number) source

Sets this transform's x position

Params:

NameTypeAttributeDescription
argNumber

public setLocalPositionY(arg: Number) source

Sets this transform's y position

Params:

NameTypeAttributeDescription
argNumber

public setLocalPositionZ(arg: Number) source

Sets this transform's z position

Params:

NameTypeAttributeDescription
argNumber

public setLocalQuaternion(quarternion: Quaternion) source

Set the object rotation with a quarternion {x,y,z,w}.

Params:

NameTypeAttributeDescription
quarternionQuaternion

The quaternion to apply

public setLocalRotation(number|Vector3|Vector2: float | Vector3 | Vector2, Number: float, Number: float) source

Set the euler angles rotation in degrees. Polymorphic : can take various agruments of various types. Possible arguments number is 1, 2 or 3.

Params:

NameTypeAttributeDescription
number|Vector3|Vector2float | Vector3 | Vector2

Value for the new rotation of the transform. If a Vector3 is given, its x, y, z will be used for the rotation x, y, z. If a Vector2 is given, its x, y will be used for the rotation x and y, but z will be unchanged. If a number is given, it will be the position x.

Numberfloat

Value for the new y rotation of the transform.

Numberfloat

Value for the new z rotation of the transform.

public setLocalRotationOrder(order: string) source

Defines the oreder of application for rotation axis. Default is 'XYZ', others are'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'

Params:

NameTypeAttributeDescription
orderstring

one of 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'

public setLocalRotationX(arg: Number) source

Sets this transform's x rotation

Params:

NameTypeAttributeDescription
argNumber

public setLocalRotationY(arg: Number) source

Sets this transform's y rotation

Params:

NameTypeAttributeDescription
argNumber

public setLocalRotationZ(arg: Number) source

Sets this transform's z rotation

Params:

NameTypeAttributeDescription
argNumber

public setLocalScale(number|Vector3|Vector2: float | Vector3 | Vector2, Number: float, Number: float) source

Set the scale of the transform. Polymorphic : can take various agruments of various types. Possible arguments number is 1, 2 or 3.

Params:

NameTypeAttributeDescription
number|Vector3|Vector2float | Vector3 | Vector2

Value for the new scale. If a Vector3 is given, its x, y, z will be used for the scale x, y, z. If a Vector2 is given, its x, y will be used for the scale x and y, but z will be 1. If a number is given, it will be the scale x.

Numberfloat

Value for the new y scale.

Numberfloat

Value for the new z scale.

public setLocalScaleX(arg: Number) source

Sets this transform's x scale

Params:

NameTypeAttributeDescription
argNumber

public setLocalScaleY(arg: Number) source

Sets this transform's y scale

Params:

NameTypeAttributeDescription
argNumber

public setLocalScaleZ(arg: Number) source

Sets this transform's z scale

Params:

NameTypeAttributeDescription
argNumber

public setRenderOrder(the: Number) source

Sets the render order of this object. The sortObjects of the renderer should be true for this property to have any effect.

Params:

NameTypeAttributeDescription
theNumber

render order index

public setUpDirection(vector: *) source

Params:

NameTypeAttributeDescription
vector*

public setVisible(val: Boolean) source

Set this object visibility

Params:

NameTypeAttributeDescription
valBoolean