WanaPlan

API Docs for: 2.7.0
Show:

SwimmingPoolComponent3D

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Summary

SwimmingPool Component 3D.

Constructor

SwimmingPoolComponent3D

Syntax

SwimmingPoolComponent3D

(
  • core
)

Summary

Parameters:

  • core Core

    The main engine.

Methods

addCarveFloorCallback

Syntax

addCarveFloorCallback

(
  • callback
)

Summary

Adds a callback function called when the floor is carved. The callback is called when the base process is done.

Parameters:

  • callback Function

    The callback to add.

applyCarveFloorCallback

Syntax

applyCarveFloorCallback

(
  • swimmingPoolCSG
  • floor
)

Summary

Runs all registered callbacks. It must be started only when the carving process is done.

Parameters:

  • swimmingPoolCSG BABYLON.CSG

    the swimming pool mesh.

  • floor BABYLON.Mesh

    The floor mesh.

carveWithSwimmingPoolMeshes

Syntax

carveWithSwimmingPoolMeshes

(
  • sp
  • meshCSG
  • ground
  • floor
)
BABYLON.Mesh

Summary

Carves a swimmingPool in room and ground.

Parameters:

  • sp BABYLON.CSG

    The CSG mesh of the cube to carve with.

  • meshCSG BABYLON.CSG

    The ground in CSG mesh.

  • ground BABYLON.Mesh

    3D mesh of the ground.

  • floor BABYLON.Mesh

    The 3D mesh of the floor.

Returns:

BABYLON.Mesh:

New room create after dig the wall.

compute

Inherited from BaseComponent3D:

Syntax

compute

() private

Summary

Recompute of the component.

createSwimmingPool

Syntax

createSwimmingPool

(
  • swimmingPool
  • structure
  • floor
)

Summary

Creates a 3D swimmingPool mesh.

Parameters:

  • swimmingPool SwimmingPoolStructure

    The structure of the swimmingPool.

  • structure FloorStructure

    The structure of the current floor.

  • floor BABYLON.Mesh

    The 3D mesh of the floor.

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

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

removeCarveFloorCallback

Syntax

removeCarveFloorCallback

(
  • callback
)

Summary

Removes a callback function from the collection of callbacks called when the floor is carved.

Parameters:

  • callback Function

    The callback to remove.

startListening

Inherited from BaseComponent3D:

Syntax

startListening

()

Summary

Calls all the event listeners.

stopListening

Inherited from BaseComponent3D:

Syntax

stopListening

()

Summary

Removes all the event listeners.

swimmingPoolBassinBox

Syntax

swimmingPoolBassinBox

(
  • sp
  • structure
  • floor
  • elevation
)
BABYLON.CSG

Summary

Creates a CSG box to carve the ground and the room.

Parameters:

  • sp SwimmingPoolStructure

    The structure of the swimmingPool.

  • structure FloorStructure

    The structure of the current floor.

  • floor BABYLON.Mesh

    The 3D mesh of the floor.

  • elevation BABYLON.Mesh

    the elevation of the floor.

Returns:

BABYLON.CSG:

The Cylinder that will be used to carve ground and room, in CSG format.

swimmingPoolBox

Syntax

swimmingPoolBox

(
  • sp
  • structure
  • floor
  • elevation
)
BABYLON.CSG

Summary

Creates a CSG box to carve the ground and the room.

Parameters:

  • sp SwimmingPoolStructure

    The structure of the swimmingPool.

  • structure FloorStructure

    The structure of the current floor.

  • floor BABYLON.Mesh

    The 3D mesh of the floor.

  • elevation BABYLON.Mesh

    the elevation of the floor.

Returns:

BABYLON.CSG:

The cube that will be used to carve ground and room, in CSG format.

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