API Docs for: 2.7.3
Show:

TransformObjectComponent3D Class

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

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.Core

    Wanaplan.

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.

Parameters:

  • object BABYLON.Mesh

    The object, can be a group.

  • [options] Object optional

    Options.

    • [silent=false] Boolean optional

      If set to true, no event wnp.engine3D.object.start-transform will be fired.

compute

() private

Inherited from BaseComponent3D:

Recompute of the component.

destroy

()

Inherited from BaseComponent3D:

Destructor.

disable

()

Inherited from BaseComponent3D:

Disables the component

enable

()

Inherited from BaseComponent3D:

Enables the component

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.

Parameters:

  • object BABYLON.Mesh

    The object, can be a group.

  • [options] Object optional

    Options.

    • [silent] Boolean optional

      If set to true, no event wnp.engine3D.object.end-transform will be fired.

getFloor

(
  • [structure]
)
BABYLON.Mesh

Inherited from BaseComponent3D:

Gets the 3D mesh of the floor structure in parameter (by default current floor).

Parameters:

Returns:

BABYLON.Mesh:

The floor mesh in 3D.

initialize

()

Inherited from BaseComponent3D:

Method called when Wanaplan is initialized. You don't need to call this method manually.

moveObject

(
  • object
  • newPosition
  • [options]
)

Moves the object on the scene.

Parameters:

  • object BABYLON.Mesh

    The object, can be a group.

  • newPosition BABYLON.Vector3

    The new position.

  • [options] Object optional

    Options.

    • [history=false] Boolean optional

      If set to true, the transformation will be saved into the history.

    • [silent=false] Boolean optional

      If set to true, no event wnp.engine3D.object.translate will be fired.

    • [old] BABYLON.Vector3 optional

      The former position for the transform. By default, it is the current position.

onContextChanged

(
  • context
)

Inherited from BaseComponent3D:

Method called when the context is switched (2D -> 3D or 3D -> 2D)

Parameters:

  • context String

    The new context

rotateObject

(
  • object
  • newRotation
  • [options]
)

Rotates the object on the scene.

Parameters:

  • object BABYLON.Mesh

    The object, can be a group.

  • newRotation BABYLON.Vector3

    The new rotation

  • [options] Object optional

    Options.

    • [history=false] Boolean optional

      If set to true, the transformation will be saved into the history.

    • [silent=false] Boolean optional

      If set to true, no event wnp.engine3D.object.rotated will be fired.

    • [old] BABYLON.Vector3 optional

      The former rotation for the transform. By default, it is the current rotation.

startListening

()

Inherited from BaseComponent3D:

Calls all the event listeners.

stopListening

()

Inherited from BaseComponent3D:

Removes all the event listeners.

update

(
  • deltaTime
)

Inherited from BaseComponent3D:

Updates the dynamic part of the component.

Parameters:

  • deltaTime Number
    The time interval.

Properties

keyboardManager

wnp.KeyboardManager

Inherited from BaseComponent3D:

Instance of the Keyboard Manager (shortcut to wanaplan.keyboardManager).

name

String

Inherited from BaseComponent3D:

Name of the component.

structure

wnp.Structure

Inherited from BaseComponent3D:

Instance of the structure (shortcut to wanaplan.structure).

Events

wnp.engine3D.object.end-transform

Fired when the TransformComponent ends to transform the position/rotation of an object.

Event Payload:

  • object BABYLON.Mesh

    The involved object.

wnp.engine3D.object.rotated

Fired when the TransformComponent just rotated an object on the scene.

Event Payload:

  • object BABYLON.Mesh

    The involved object.

  • pending Boolean

    True if the TransformComponent is currently waiting for the end of the transformation to notify and set up the history.

  • newValue BABLYON.Vector3

    The 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.Mesh

    The involved object.

wnp.engine3D.object.translate

Fired when the TransformComponent just translated an object on the scene.

Event Payload:

  • object BABYLON.Mesh

    The involved object.

  • pending Boolean

    True if the TransformComponent is currently waiting for the end of the transformation to notify and set up the history.

  • newValue BABLYON.Vector3

    The new position of the object.