WanaPlan

API Docs for: 2.7.0
Show:

TransformObjectComponent3D

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Summary

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

Syntax

TransformObjectComponent3D

(
  • core
)

Summary

Parameters:

  • core wnp.Core

    Wanaplan.

Methods

beginTransformObject

Syntax

beginTransformObject

(
  • object
  • [options]
)

Summary

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

Inherited from BaseComponent3D:

Syntax

compute

() private

Summary

Recompute of the component.

destroy

Inherited from BaseComponent3D:

Syntax

destroy

()

Summary

Destructor.

disable

Inherited from BaseComponent3D:

Syntax

disable

()

Summary

Disables the component

enable

Inherited from BaseComponent3D:

Syntax

enable

()

Summary

Enables the component

endTransformObject

Syntax

endTransformObject

(
  • object
  • [options]
)

Summary

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

Inherited from BaseComponent3D:

Syntax

getFloor

(
  • [structure]
)
BABYLON.Mesh

Summary

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:

Syntax

initialize

()

Summary

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

moveObject

Syntax

moveObject

(
  • object
  • newPosition
  • [options]
)

Summary

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

Inherited from BaseComponent3D:

Syntax

onContextChanged

(
  • context
)

Summary

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

Parameters:

  • context String

    The new context

rotateObject

Syntax

rotateObject

(
  • object
  • newRotation
  • [options]
)

Summary

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:

Syntax

startListening

()

Summary

Calls all the event listeners.

stopListening

Inherited from BaseComponent3D:

Syntax

stopListening

()

Summary

Removes all the event listeners.

update

Inherited from BaseComponent3D:

Syntax

update

(
  • deltaTime
)

Summary

Updates the dynamic part of the component.

Parameters:

  • deltaTime Number
    The time interval.

Properties

keyboardManager

Inherited from BaseComponent3D:

Syntax

keyboardManager

wnp.KeyboardManager

Summary

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

name

Inherited from BaseComponent3D:

Syntax

name

String

Summary

Name of the component.

structure

Inherited from BaseComponent3D:

Syntax

structure

wnp.Structure

Summary

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

Events

wnp.engine3D.object.end-transform

Syntax

wnp.engine3D.object.end-transform

Summary

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

Syntax

wnp.engine3D.object.rotated

Summary

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

Syntax

wnp.engine3D.object.start-transform

Summary

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

Syntax

wnp.engine3D.object.translate

Summary

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.