WanaPlan

API Docs for: 2.7.0
Show:

RoofComponent3D

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Summary

RoofComponent3D.

Constructor

RoofComponent3D

Syntax

RoofComponent3D

(
  • core
)

Summary

Parameters:

  • core Core

    The main engine.

Methods

addRoof

Syntax

addRoof

(
  • wallMesh
  • roof
  • structure
  • sceneF
)
private

Summary

Adds the roof mesh to the scene.

Parameters:

  • wallMesh BABYLON.Mesh

    Mesh of the walls.

  • roof RoofStructure

    The current roof.

  • structure FloorStructure

    The floor on which the roof must be added.

  • sceneF BABYLON.Mesh

    Current floor mesh.

checkThicknessVector

Syntax

checkThicknessVector

(
  • roof
  • point
  • structure
)
BABYLON.Vector3

Summary

Returns vector to add to the point on the roof bottom plane so it becomes part of the top plane

Parameters:

  • roof RoofStructure

    The current roof

  • point BABYLON.Vector3

    the point of the bottom plane to elevate

  • structure FloorStructure

    The floor on which the roof must be added.

Returns:

BABYLON.Vector3:

3D thickness vector

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

extendRoof

Syntax

extendRoof

(
  • plane
  • roof
  • withGable
  • withOverhang
)
BABYLON.Vector3

Summary

Extends subslope plane to include roof overhangs and meet with opposite roof

Parameters:

  • plane BABYLON.Vector3

    bottom plane of the roof (same as subslope extended plane).

  • roof RoofStructure

    The current roof.

  • withGable Boolean

    If true then extend at gable overhang too.

  • withOverhang Boolean

    If true then extend at overhang too.

Returns:

BABYLON.Vector3:

the extended bottom plane of the roof

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.

getRoofPoints

Syntax

getRoofPoints

(
  • roof
  • force
)
BABYLON.Vector3

Summary

Returns 3D points of bottom roof plane

Parameters:

  • roof RoofStructure

    The current roof

  • force Boolean

    if true then recompute the points, else return stored roofPoints3D

Returns:

BABYLON.Vector3:

points of roof in 3D

getYForPoint

Syntax

getYForPoint

(
  • point
  • roof
)
Number

Summary

Returns 3D Y-coordinate of a 2D point when elevated to the intersection with the roof plane

Parameters:

  • point BABYLON.Vector2

    2D point for which we want the Y coordinate in 3D

  • roof RoofStructure

    The current roof

Returns:

Number:

Y coordinate of point 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
)

Summary

Triggered on event wnp.engine3D.subslopesReady. Adds roofs to the walls mesh.

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.

triangulatePoints

Syntax

triangulatePoints

(
  • points
)
Number[] private

Summary

Triangulates polygon points.

Parameters:

  • points BABYLON.Vector3

    the points of the polygon to triangulate

Returns:

Number[]:

triangulation indices

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

Syntax

wnp.engine3D.roofsReady

Summary

Fired when the roofs have been 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 roofs carve the wall mesh when built).