GridComponent3D Class
This component manages the whole 3D environnement, specifically the 3D grid, the skybox, and the lights.
Constructor
GridComponent3D
-
core
Parameters:
-
core
CoreWanaplan Core.
Item Index
Methods
Properties
Events
Methods
carveGroundWithFloor
-
extrooms
-
elevation
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
-
hoppers
Carves the grid with hoppers.
Parameters:
-
hoppers
HopperStructure[]Hoppers to carve into the ground.
compute
()
private
createGround
-
[params]
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
-
[params]
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
()
disable
()
enable
()
getFloor
-
[structure]
Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
initialize
()
isDefaultSkybox
()
Boolean
Indicates if the default sky is set.
Returns:
Returns true
if the default sky is set, otherwise it returns false
.
onChangeGround
-
event
Changes the aspect of the ground.
Triggered on wnp.engine3D.changeGround
Parameters:
-
event
ObjectThe JS event.
onChangeSky
-
event
Changes the aspect of the sky.
Triggered on wnp.engine3D.changeSky
Parameters:
-
event
ObjectThe JS event.
onContextChanged
-
context
Parameters:
-
context
StringThe new context
onStructureLoaded
-
event
Creates the sky and the ground if a previous configuration exists.
Triggered on event wnp.core.structure.loaded
Parameters:
-
event
EventThe event object
setDefaultGround
()
Sets the default ground.
setupFog
()
Setups the fog in the scene.
setupLights
()
Setups the lights in the scene.
startListening
()
stopListening
()
update
-
deltaTime
Parameters:
-
deltaTime
NumberThe time interval.
Properties
keyboardManager
wnp.KeyboardManager
structure
wnp.Structure
Events
wnp.request.saveHistory
Fired to request a save of the history.