new Object3D(json)
Base class extended THREE.Object3D
to compose 3D scene of ud-viz game
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
json | object | json to configure the object3D Properties
|
- Source
Members
components :Object.<string, object>
- Object.<string, object>
- Source
forceToJSONComponent :Array.<string>
force certain component to be export in json
- Array.<string>
- Source
gameContextUpdate :boolean
true if object3D should consider game context update
- boolean
- Source
isGameObject3D :boolean
tag to make difference between this and THREE.Object3D
- boolean
- Source
matrixAutoUpdate :boolean
- boolean
- Source
name :string
name of object3D
- string
- Source
outdated :boolean
true if object3D model has changed
- boolean
- Source
parentUUID :string|null
uuid of the parent object3D
- string |
null
- Source
static :boolean
true if the object3D is not going to move in space
- boolean
- Source
userData :object
user data
- object
- Source
uuid :string
uuid of object3D
- string
- Source
visible :boolean
- boolean
- Source
Methods
clone() → {Object3D}
- Source
- clone of object3D
- Type:
- Object3D
filter(condition) → {Object3D}
Name | Type | Description |
---|---|---|
condition | Object3DCondition | condition to test |
- Source
- return an array of objects3D in hierarchy matching condition
- Type:
- Object3D
getComponent(type) → {object}
Name | Type | Description |
---|---|---|
type | string | type of the component |
- Source
- component of type
- Type:
- object
getComponents() → {Object.<string, object>}
- Source
- components of object3D @see Component
- Type:
- Object.<string, object>
getFirst(condition) → {Object3D}
Name | Type | Description |
---|---|---|
condition | Object3DCondition | condition to test |
- Source
- return first object3D in hierarchy matching condition
- Type:
- Object3D
hasGameContextUpdate() → {boolean}
- Source
- true if this has game context update
- Type:
- boolean
isOutdated() → {boolean}
- Source
- true if object3D is outdated (model has changed)
- Type:
- boolean
isStatic() → {boolean}
- Source
- true if object3D is static
- Type:
- boolean
setOutdated(value)
Name | Type | Description |
---|---|---|
value | boolean | true if object3D is outdated (model has changed) |
- Source
toJSON(fullopt, withMetadataopt, withChildrenopt) → {object}
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
full | boolean | <optional> | true | component with controllers should be added to the result |
withMetadata | boolean | <optional> | false | add metadata to the result |
withChildren | boolean | <optional> | true | add children to the result |
- Source
- object of the object3D if withMetatdata = false, otherwise the object is store in result.object and metadata in result.metadata
- Type:
- object
traverse(cb) → {boolean}
Apply a callback to object3D and its children recursively like THREE.Object3D
This is not exactly the same one since there is the possibility to stop the traverse and the possibility to remove an object3D while parent is traversed TODO: object should not be remove though since its cause of bug !!! (maybe test with a descendant for loop (i--))
Name | Type | Description |
---|---|---|
cb | TraverseCallback | callback to apply to object3D and its children recursively |
- Source
- true when traverse should be stop
- Type:
- boolean
updateComponentFromJSON(componentsJSON)
Name | Type | Description |
---|---|---|
componentsJSON | Object.<string, object> | json components to update from |
- Source
updateMatrixFromJSON(jsonMatrix) → {void}
Name | Type | Description |
---|---|---|
jsonMatrix | Array | array of the matrix |
- Source
- Type:
- void
updatefromJSON(json)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
json | object | json to update from Properties
|
- Source
(static) DefaultForward() → {THREE.Vector3}
- Source
- Default forward of Object3D
- Type:
- THREE.
Vector3
(static) DefaultUp() → {THREE.Vector3}
- Source
- Default up vector of Object3D
- Type:
- THREE.
Vector3
(static) computeBackward(object3D) → {THREE.Vector3}
Name | Type | Description |
---|---|---|
object3D | Object3D | object3D to compute backward vector |
- Source
- backward vector of object3D
- Type:
- THREE.
Vector3
(static) computeDown(object3D) → {THREE.Vector3}
Name | Type | Description |
---|---|---|
object3D | Object3D | object3D to compute down vector |
- Source
- down vector of object3D
- Type:
- THREE.
Vector3
(static) computeForward(object3D) → {THREE.Vector3}
Name | Type | Description |
---|---|---|
object3D | Object3D | object3D to compute forward vector |
- Source
- forward vector of object3D
- Type:
- THREE.
Vector3
(static) computeUp(object3D) → {THREE.Vector3}
Name | Type | Description |
---|---|---|
object3D | Object3D | object3D to compute up vector |
- Source
- up vector of object3D
- Type:
- THREE.
Vector3
(static) deepCopy(object3D) → {Object3D}
Return a deep copy of object3D (uuids and name are regenerated)
Name | Type | Description |
---|---|---|
object3D | Object3D | object3D to deep copy |
- Source
- deep copy of object3D
- Type:
- Object3D
(static) fetchFirstGameObject3D(object) → {Object3D}
Parse parent object till finding a gameobject
Name | Type | Description |
---|---|---|
object | THREE. | object to fetch into |
- Source
- first gameobject found in hierarchy
- Type:
- Object3D
(static) parseJSON(json) → {object}
If json has metadata update object of object3D if not nothing is done
Name | Type | Description |
---|---|---|
json | object | json of object3D |
- Source
- json object of object3D
- Type:
- object