API Docs for: 2.7.3
Show:

RoofComponent3D Class

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

RoofComponent3D.

Constructor

RoofComponent3D

(
  • core
)

Parameters:

  • core Core

    The main engine.

Methods

addRoof

(
  • wallMesh
  • roof
  • structure
  • sceneF
)
private

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

(
  • roof
  • point
  • structure
)
BABYLON.Vector3

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

() private

Inherited from BaseComponent3D:

Recompute of the component.

destroy

()

Inherited from BaseComponent3D:

Destructor.

disable

()

Inherited from BaseComponent3D:

Disables the component

enable

()

Inherited from BaseComponent3D:

Enables the component

extendRoof

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

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

(
  • [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.

getRoofPoints

(
  • roof
  • force
)
BABYLON.Vector3

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

(
  • point
  • roof
)
Number

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:

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
)

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

Parameters:

  • event Event

    The JS event.

startListening

()

Inherited from BaseComponent3D:

Calls all the event listeners.

stopListening

()

Inherited from BaseComponent3D:

Removes all the event listeners.

triangulatePoints

(
  • points
)
Number[] private

Triangulates polygon points.

Parameters:

  • points BABYLON.Vector3

    the points of the polygon to triangulate

Returns:

Number[]:

triangulation indices

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

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