TransformObjectComponent3D Class
This component handles the transformation (rotation/translation) of every mesh on the scene. This conveniently provides an history of tranformations, especially when the user moves an object from point A to point B, travelling around the whole scene - (It merges translations and rotation into a resultant one).
Constructor
TransformObjectComponent3D
-
core
Parameters:
-
core
wnp.CoreWanaplan.
Item Index
Methods
Properties
Methods
beginTransformObject
-
object
-
[options]
Notifies that the object is getting transformed a lot with small deltas. The transformation applied after will be summarized and notified when calling endTransformObject.
compute
()
private
destroy
()
disable
()
enable
()
endTransformObject
-
object
-
[options]
Notifies that the object will not longer be transformed.
The transformation which occured since the last beginTransformObject will be merged, notified and historized.
getFloor
-
[structure]
Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
initialize
()
moveObject
-
object
-
newPosition
-
[options]
Moves the object on the scene.
Parameters:
-
object
BABYLON.MeshThe object, can be a group.
-
newPosition
BABYLON.Vector3The new position.
-
[options]
Object optionalOptions.
-
[history=false]
Boolean optionalIf set to true, the transformation will be saved into the history.
-
[silent=false]
Boolean optionalIf set to true, no event
wnp.engine3D.object.translate
will be fired. -
[old]
BABYLON.Vector3 optionalThe former position for the transform. By default, it is the current position.
-
onContextChanged
-
context
Parameters:
-
context
StringThe new context
rotateObject
-
object
-
newRotation
-
[options]
Rotates the object on the scene.
Parameters:
-
object
BABYLON.MeshThe object, can be a group.
-
newRotation
BABYLON.Vector3The new rotation
-
[options]
Object optionalOptions.
-
[history=false]
Boolean optionalIf set to true, the transformation will be saved into the history.
-
[silent=false]
Boolean optionalIf set to true, no event
wnp.engine3D.object.rotated
will be fired. -
[old]
BABYLON.Vector3 optionalThe former rotation for the transform. By default, it is the current rotation.
-
startListening
()
stopListening
()
update
-
deltaTime
Parameters:
-
deltaTime
NumberThe time interval.
Properties
keyboardManager
wnp.KeyboardManager
structure
wnp.Structure
Events
wnp.engine3D.object.end-transform
Fired when the TransformComponent ends to transform the position/rotation of an object.
Event Payload:
-
object
BABYLON.MeshThe involved object.
wnp.engine3D.object.rotated
Fired when the TransformComponent just rotated an object on the scene.
Event Payload:
-
object
BABYLON.MeshThe involved object.
-
pending
BooleanTrue if the TransformComponent is currently waiting for the end of the transformation to notify and set up the history.
-
newValue
BABLYON.Vector3The new rotation of the object.
wnp.engine3D.object.start-transform
Fired when the TransformComponent begins to transform the position/rotation of an object.
This will be followed by a wnp.engine3D.object.end-transform
event.
Event Payload:
-
object
BABYLON.MeshThe involved object.
wnp.engine3D.object.translate
Fired when the TransformComponent just translated an object on the scene.
Event Payload:
-
object
BABYLON.MeshThe involved object.
-
pending
BooleanTrue if the TransformComponent is currently waiting for the end of the transformation to notify and set up the history.
-
newValue
BABLYON.Vector3The new position of the object.