API Docs for: 2.7.3
Show:

SubSlopeComponent3D Class

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Creates and draws subslopes in 3D.

Constructor

SubSlopeComponent3D

(
  • core
)

Parameters:

  • core wnp.Core

    Wanaplan core.

Methods

addSubSlope

(
  • wallMesh
  • points
  • subslope
  • structure
  • sceneF
)
private

Adds the subslope mesh to the scene.

Parameters:

  • wallMesh BABYLON.Mesh

    Mesh of the walls.

  • points BABYLON.Vector3

    Points of the subslope plane mesh.

  • subslope SubSlopeStructure

    The current subslope.

  • structure FloorStructure

    The floor on which the subslope must be added.

  • sceneF BABYLON.Mesh

    Current floor mesh.

buildCSG

(
  • points
  • structure
  • sceneF
)
BABYLON.CSG private

Builds the CSG mesh which carves a part of the wall mesh.

Parameters:

  • points BABYLON.Vector3

    Points of the subslope plane mesh.

  • structure SubSlopeStructure

    Structure of the SubSlope

  • sceneF BABYLON.Mesh

    Current floor.

Returns:

BABYLON.CSG:

Final CSG mesh.

buildFromCSG

(
  • wallMesh
  • wallCSG
  • roomCSG
  • subslopeCSG
  • sceneF
)
private

Carves the wall with the big union of CSG.

Parameters:

  • wallMesh BABYLON.Mesh

    Mesh of the wall.

  • wallCSG BABYLON.CSG

    Mesh of the wall but in CSG.

  • roomCSG BABYLON.CSG

    CSG of the room.

  • subslopeCSG BABYLON.CSG

    CSG of all the subslopes.

  • sceneF BABYLON.Mesh

    Current floor mesh.

compute

() private

Inherited from BaseComponent3D:

Recompute of the component.

destroy

()

Inherited from BaseComponent3D:

Destructor.

disable

()

Inherited from BaseComponent3D:

Disables the component

drawSSForStructure

(
  • structure
  • sceneF
)

Carves and creates all the subslopes without a roof for a floor.

Parameters:

  • structure FloorStructure

    Related floor structure.

  • sceneF BABYLON.Mesh

    Floor mesh.

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

onWallsReady

(
  • event
)

Triggered on event wnp.engine3D.wallsReady. Adds subslopes meshes (planes for subslopes without a roof) to the scene.

Parameters:

  • event Event

    The JS event.

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

currentID

Number private

Id of the current subslope.

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

Fired when the subslopes are ready and added to the scene.

Event Payload:

  • floor BABYLON.Mesh

    3D Floor mesh.

  • structure FloorStructure

    Related floor structure.

  • walls BABYLON.Mesh

    The resultant wall mesh for this floor (The subslopes carve the wall mesh when built).