kick.scene.Transform Class
Position, rotation and scale of a game object. This component should not be created manually. It is created when a GameObject is created.
KickJS uses a right handed coordinate system.
Item Index
Methods
Properties
Events
Methods
activated
()
Abstract method called when a component is added to scene. May be undefined.
This method method works in many cases like a constructor function, where references to other game objects can
be looked up (this cannot be done when the actual constructor function is called, since the scene may not be
loaded completely).
Note that activated are called just after update methods on all components has been called - this makes it easier
to get references to other components.
deactivated
()
Abstract method called when a component is removed from scene. May be undefined.
getGlobalTRSInverse
()
kick.math.Mat4
Return the inverse of global rotate translate transform
Returns:
inverse global transform
getLocalMatrix
()
kick.math.Mat4
Return the local transformation matrix
Returns:
local transformation
getLocalTRSInverse
()
kick.math.Mat4
Return the local inverse of translate rotate scale
Returns:
inverse of local transformation
lookAt
-
transform
-
up
Changes the rotation of the object to look at input (Transform) object.
Parameters:
-
transform
kick.scene.Transformtarget object to look at
-
up
kick.math.Vec3the up-vector used in the lookAt
markGlobalDirty
()
private
Mark the global transform updated. This will mark the transform updated (meaning the global transform must be recomputed based on translation, rotation, scale)
render
-
engineUniforms
-
[overwriteMaterial]
Abstract method called every at every rendering of the object. May be undefined.
Parameters:
-
engineUniforms
kick.scene.EngineUniforms -
[overwriteMaterial]
kick.material.Material optional
str
()
String
Returns:
stringify JSON
toJSON
()
Object
Returns:
JSON formatted object
update
()
Abstract method called every update. May be undefined.
Properties
aabb
kick.math.Aabb
Defines the axis aligned bounding box used for view frustum culling May be undefined or null.
children
Array_kick.scene.Transform
Array of children. The children should not be modified directly. Instead use the parent property
componentType
String
final
Name of the component type = "transform".
Example:
var transform = gameObject.transform;
gameObject
kick.scene.GameObject
The gameObject owning the component. Initially undefined. The value is set when the Component object is added to a GameObject
renderOrder
Number
Default value is 1000
< 1999 default geometry
1999 skybox
2001 - 2999 transparent geometry (sorted back-to-front when rendered)
> 3000 overlay geometry rendered on top
scriptPriority
Number
Components with largest priority are invoked first. (optional - default 0). Cannot be modified after creation.
Events
componentUpdated
Fire events when components are updated. May be undefined. Must be defined before adding to gameObject.
Event Payload:
-
component
kick.scene.Component