Validate basic structures.
- Source:
Example
//Returns true
VJS.Core.Validators.matrix4(new THREE.Matrix4());
//Returns false
VJS.Core.Validators.matrix4(new THREE.Vector3());
Methods
(static) box(objectToTest) → {boolean}
Validates a box.
Parameters:
Name | Type | Description |
---|---|---|
objectToTest |
Object | The object to be tested. |
- Source:
Returns:
True if valid box, false if NOT.
- Type
- boolean
Example
// a box is defined as
let box = {
center: THREE.Vector3,
halfDimensions: THREE.Vector3
}
(static) matrix4(objectToTest) → {boolean}
Validates a matrix as a THREEJS.Matrix4
link
Parameters:
Name | Type | Description |
---|---|---|
objectToTest |
Object | The object to be tested. |
- Source:
Returns:
True if valid Matrix4, false if NOT.
- Type
- boolean
(static) ray(objectToTest) → {boolean}
Validates a ray.
Parameters:
Name | Type | Description |
---|---|---|
objectToTest |
Object | The object to be tested. |
- Source:
Returns:
True if valid ray, false if NOT.
- Type
- boolean
Example
// a ray is defined as
let ray = {
postion: THREE.Vector3,
direction: THREE.Vector3
}
(static) vector3(objectToTest) → {boolean}
Validates a vector as a THREEJS.Vector3
Parameters:
Name | Type | Description |
---|---|---|
objectToTest |
Object | The object to be tested. |
- Source:
Returns:
True if valid Vector3, false if NOT.
- Type
- boolean