API Docs for: 2.7.3
Show:

OvertureComponent3D Class

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Overture Component 3D.

Constructor

OvertureComponent3D

(
  • core
)

Parameters:

  • core Core

    The main engine.

Methods

carveSubslopeOverture

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

Carves a subslope overture in the subslopes.

Parameters:

Returns:

BABYLON.Mesh:

New mesh of the walls after carving.

carveWithOvertureMeshes

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

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

() private

Inherited from BaseComponent3D:

Recompute of the component.

createOverture

(
  • overture
  • structure
  • floor
)

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:

Destructor.

disable

()

Inherited from BaseComponent3D:

Disables the component

enable

()

Inherited from BaseComponent3D:

Enables the component

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.

onContextChanged

(
  • context
)

Inherited from BaseComponent3D:

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

Parameters:

  • context String

    The new context

onSubslopesReady

(
  • event
)
private

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

(
  • event
)
private

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

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

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:

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

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

private

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.