WanaPlan

API Docs for: 2.7.0
Show:

SubSlopeComponent3D

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Summary

Creates and draws subslopes in 3D.

Constructor

SubSlopeComponent3D

Syntax

SubSlopeComponent3D

(
  • core
)

Summary

Parameters:

  • core wnp.Core

    Wanaplan core.

Methods

addSubSlope

Syntax

addSubSlope

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

Summary

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

Syntax

buildCSG

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

Summary

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

Syntax

buildFromCSG

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

Summary

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

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

drawSSForStructure

Syntax

drawSSForStructure

(
  • structure
  • sceneF
)

Summary

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:

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

onWallsReady

Syntax

onWallsReady

(
  • event
)

Summary

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:

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

currentID

Syntax

currentID

Number private

Summary

Id of the current subslope.

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

Syntax

wnp.engine3D.subslopesReady

Summary

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