new Context(frame3D, assetManager, inputManager, externalGameScriptClass, options)
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
frame3D | frame3d. | frame3D view of the game | ||||||||||||
assetManager | AssetManager | asset manager | ||||||||||||
inputManager | InputManager | input manager | ||||||||||||
externalGameScriptClass | Object.<string, ScriptBase> | custom external script | ||||||||||||
options | object | options of context Properties
|
- Source
Members
assetManager :AssetManager
asset manager
- Source
currentGameObject3D :Object3D
current root gameobject3D (child of this.object3D)
- Object3D
- Source
currentUUID :Object.<string, boolean>
register uuid of object3D in context to identify new one incoming
- Object.<string, boolean>
- Source
dt :number
delta time of context
- number
- Source
externalGameScriptClass :Object.<string, ScriptBase>
custom ScriptBase
that can be used by object3D
- Object.<string, ScriptBase>
- Source
frame3D :frame3d.Base|frame3d.Planar
frame3D view of game
- frame3d.
Base |frame3d. Planar
- Source
inputManager :InputManager
input manager
- Source
interpolator :object|null
interpolator
- object |
null
- Source
object3D :THREE.Object3D
root object3D
- THREE.
Object3D
- Source
socketIOWrapper :undefined|null
socket io wrapper
- undefined |
null
- Source
userData :object
user data context
- object
- Source
(static) EVENT
Event triggered by context to ScriptBase
- Source
Methods
createInstanceOf(id, object3D, modelVariables) → {ScriptBase}
Create a class instance of external game script class for an object3D given an id
Name | Type | Description |
---|---|---|
id | string | id of the class |
object3D | Object3D | object3D that is going to use this instance |
modelVariables | object | custom variables associated to this instance |
- Source
- instance of the class bind with object3D and modelVariables
- Type:
- ScriptBase
findExternalScriptWithID(id, object3Dopt) → {ScriptBase|null}
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id | string | id of script | ||
object3D | Object3D | <optional> | this.object3D | object3D to traverse to find the external script (default is the root game object3D) |
- Source
- first external script with id or null if none are found
- Type:
- ScriptBase |
null
initComponentControllers(go)
Name | Type | Description |
---|---|---|
go | Object3D | gameobject3D to init controllers |
- Source
initFrame3D(frame3D)
Name | Type | Description |
---|---|---|
frame3D | frame3d. | intialize frame3D of context |
- Source
reset(newFrame3D)
Reset context state and initialize the new frame3D
Name | Type | Description |
---|---|---|
newFrame3D | frame3d. | new frame3D to reset with |
- Source
sendCommandsToGameContext(cmds)
This method need to be implemented by user
Name | Type | Description |
---|---|---|
cmds | Array.<Command> | commands to send to game context |
- Source
step(dt, states)
Step context
Name | Type | Description |
---|---|---|
dt | number | new delta time context |
states | Array.<State> | new states to update context current gameobject3D |
- Source