WanaPlan

API Docs for: 2.7.0
Show:

OvertureComponent3D

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Summary

Overture Component 3D.

Constructor

OvertureComponent3D

Syntax

OvertureComponent3D

(
  • core
)

Summary

Parameters:

  • core Core

    The main engine.

Methods

carveSubslopeOverture

Syntax

carveSubslopeOverture

(
  • subslope
  • ov
  • structure
  • floor
)
BABYLON.Mesh

Summary

Carves a subslope overture in the subslopes.

Parameters:

Returns:

BABYLON.Mesh:

New mesh of the walls after carving.

carveWithOvertureMeshes

Syntax

carveWithOvertureMeshes

(
  • ov
  • wallCSG
  • wall3D
  • floor
)
BABYLON.Mesh private

Summary

Carves an overture in the walls.

Parameters:

  • ov BABYLON.CSG

    The CSG mesh of the cube to carve with.

  • wallCSG BABYLON.CSG

    The wall in CSG mesh.

  • wall3D BABYLON.Mesh

    3D mesh of the walls.

  • floor BABYLON.Mesh

    The 3D mesh of the floor.

Returns:

BABYLON.Mesh:

New wall create after dig the wall.

compute

Inherited from BaseComponent3D:

Syntax

compute

() private

Summary

Recompute of the component.

createOverture

Syntax

createOverture

(
  • overture
  • structure
  • floor
)

Summary

Creates a 3D overture mesh.

Parameters:

  • overture OvertureStructure

    The structure of the overture.

  • structure FloorStructure

    The structure of the current floor.

  • floor BABYLON.Mesh

    The 3D mesh of the floor.

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

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.

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

onSubslopesReady

Syntax

onSubslopesReady

(
  • event
)
private

Summary

Carves the subslopes and creates the 3D meshes of the subslope overtures. Triggered on event wnp.engine3D.roofsReady

Parameters:

  • event Event

    The event received, it contains the walls mesh, the floor mesh and the structure of the floor.

onWallsReady

Syntax

onWallsReady

(
  • event
)
private

Summary

Carves the walls and creates the 3D meshes of the overtures. Triggered on event wnp.engine3D.wallsReady

Parameters:

  • event Event

    The event received, it contains the walls mesh, the floor mesh and the structure of the floor.

overtureBox

Syntax

overtureBox

(
  • ov
  • The
  • floor
)
BABYLON.CSG private

Summary

Creates a CSG box to carve the walls.

Parameters:

Returns:

BABYLON.CSG:

The cube that will be used to carve walls, in CSG format.

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

Syntax

wnp.engine3D.overturesReady

Summary

Fired once the wall overtures are created.

Event Payload:

  • floor BABYLON.Mesh

    The mesh of the floor.

  • structure FloorStructure

    The current floor structure.

  • walls BABYLON.Mesh

    The mesh of the walls.

wnp.engine3D.subslopeOverturesReady

Syntax

wnp.engine3D.subslopeOverturesReady

private

Summary

Fired once the subslope overtures are created.

Event Payload:

  • floor BABYLON.Mesh

    The mesh of the floor.

  • structure wnp.floorStructure

    The current structure.

  • walls BABYLON.Mesh

    The mesh of the wall.