GridComponent3D
Summary
This component manages the whole 3D environnement, specifically the 3D grid, the skybox, and the lights.
Constructor
GridComponent3D
Syntax
GridComponent3D
-
core
Summary
Parameters:
-
core
CoreWanaplan Core.
Item Index
Methods
Properties
Events
Methods
carveGroundWithFloor
Syntax
carveGroundWithFloor
-
extrooms
-
elevation
Summary
Carves the grid and earth with the shape of a floor.
Parameters:
-
extrooms
RoomStructure[]External rooms of the floor to carve into the ground.
-
elevation
NumberThe elevation of the floor
carveGroundWithHoppers
Syntax
carveGroundWithHoppers
-
hoppers
Summary
Carves the grid with hoppers.
Parameters:
-
hoppers
HopperStructure[]Hoppers to carve into the ground.
compute
Syntax
compute
()
private
Summary
Recompute of the component.createGround
Syntax
createGround
-
[params]
Summary
Creates the ground and applies the grid material. If the ground already exists, it is kept but the material is destroyed and recreated.
Parameters:
-
[params]
Object optionalAn object which can contain in params.url a ground texture URL.
createSky
Syntax
createSky
-
[params]
Summary
Creates the sky according to parameter URL. If no URL is specified then the default Skybox is created. For compatibility reason, a skysphere can be generated instead of a skybox.
Parameters:
-
[params]
Object optionalparams.url can be the URL of an asset to use for the sky creation.
destroy
Syntax
destroy
()
Summary
Destructor.disable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentgetFloor
Syntax
getFloor
-
[structure]
Summary
Gets the 3D mesh of the floor structure in parameter (by default current floor).Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.isDefaultSkybox
Syntax
Summary
Indicates if the default sky is set.
Returns:
Returns true
if the default sky is set, otherwise it returns false
.
onChangeGround
Syntax
onChangeGround
-
event
Summary
Changes the aspect of the ground.
Triggered on wnp.engine3D.changeGround
Parameters:
-
event
ObjectThe JS event.
onChangeSky
Syntax
onChangeSky
-
event
Summary
Changes the aspect of the sky.
Triggered on wnp.engine3D.changeSky
Parameters:
-
event
ObjectThe JS event.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context
onStructureLoaded
Syntax
onStructureLoaded
-
event
Summary
Creates the sky and the ground if a previous configuration exists.
Triggered on event wnp.core.structure.loaded
Parameters:
-
event
EventThe event object
setDefaultGround
Syntax
setDefaultGround
()
Summary
Sets the default ground.
setupFog
Syntax
setupFog
()
Summary
Setups the fog in the scene.
setupLights
Syntax
setupLights
()
Summary
Setups the lights in the scene.
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.update
Syntax
update
-
deltaTime
Summary
Updates the dynamic part of the component.Parameters:
-
deltaTime
NumberThe time interval.
Properties
keyboardManager
Syntax
keyboardManager
wnp.KeyboardManager
Summary
Instance of the Keyboard Manager (shortcut to wanaplan.keyboardManager).structure
Syntax
structure
wnp.Structure
Summary
Instance of the structure (shortcut to wanaplan.structure).Events
wnp.request.saveHistory
Syntax
wnp.request.saveHistory
Summary
Fired to request a save of the history.