Constructor
new Camera()
Create a camera.
Extends
Members
castShadow :Boolean
Whether the object gets rendered into shadow map.
Type:
- Boolean
- Overrides
- Default Value
- false
children :Array.<t3d.Object3D>
Object's parent in the scene graph. An object can have at most one parent.
Type:
- Array.<t3d.Object3D>
- Overrides
euler :t3d.Euler
Object's local rotation as an t3d.Euler, in radians.
Type:
- Overrides
- Default Value
- Euler(0, 0, 0)
frustum :t3d.Frustum
The frustum of the camera.
Type:
frustumCulled :Boolean
When this is set, it checks every frame if objects are in the frustum of the camera before rendering objects. Otherwise objects gets rendered every frame even if it isn't visible.
Type:
- Boolean
- Overrides
- Default Value
- true
gammaFactor :Number
The factor of gamma.
Type:
- Number
- Default Value
- 2.0
(readonly) id :Number
Unique number for this object instance.
Type:
- Number
- Overrides
(readonly) isCamera :Boolean
Type:
- Boolean
- Default Value
- true
matrix :t3d.Matrix4
The local transform matrix.
Type:
- Overrides
matrixAutoUpdate :Boolean
When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the worldMatrix property.
Type:
- Boolean
- Overrides
- Default Value
- true
matrixNeedsUpdate :Boolean
When this is set, it calculates the matrix in that frame and resets this property to false.
Type:
- Boolean
- Overrides
- Default Value
- true
name :String
Optional name of the object (doesn't need to be unique).
Type:
- String
- Overrides
- Default Value
- ""
outputEncoding :t3d.TEXEL_ENCODING_TYPE
Output pixel encoding.
- Default Value
- t3d.TEXEL_ENCODING_TYPE.LINEAR
parent :t3d.Object3D
Object's parent in the scene graph. An object can have at most one parent.
Type:
- Overrides
position :t3d.Vector3
A Vector3 representing the object's local position.
Type:
- Overrides
- Default Value
- Vector3(0, 0, 0)
projectionMatrix :t3d.Matrix4
This is the matrix which contains the projection.
Type:
projectionMatrixInverse :t3d.Matrix4
This is the matrix which contains the projection.
Type:
projectionViewMatrix :t3d.Matrix4
This is the matrix which contains the projection and view matrix. The matrix may be different from the value passed in the shader, scene.anchorMatrix is not considered here.
Type:
quaternion :t3d.Quaternion
Object's local rotation as a t3d.Quaternion.
Type:
- Overrides
- Default Value
- Quaternion(0, 0, 0, 1)
receiveShadow :Boolean
Whether the material receives shadows.
Type:
- Boolean
- Overrides
- Default Value
- false
rect :t3d.Vector4
Where on the screen is the camera rendered in normalized coordinates. The values in rect range from zero (left/bottom) to one (right/top).
Type:
- Default Value
- t3d.Vector4(0, 0, 1, 1)
renderLayer :Number
Render layer of this object. RenderQueue will dispatch all renderable objects to the corresponding RenderQueueLayer according to object.renderLayer.
Type:
- Number
- Overrides
- Default Value
- 0
renderOrder :Number
This value allows the default rendering order of scene graph objects to be overridden although opaque and transparent objects remain sorted independently. Sorting is from lowest to highest renderOrder.
Type:
- Number
- Overrides
- Default Value
- 0
renderable :Boolean
Whether it can be collected into the Render Queue.
Type:
- Boolean
- Overrides
- Default Value
- true
scale :t3d.Vector3
The object's local scale.
Type:
- Overrides
- Default Value
- Vector3(1, 1, 1)
shadowType :t3d.SHADOW_TYPE
Defines shadow map type. Note: In webgl1 or t3d.Scene#disableShadowSampler is true, soft shadow types will fallback to POISSON_SOFT without warning. Note: Point light only support POISSON_SOFT for now.
Type:
- Overrides
- Default Value
- SHADOW_TYPE.PCF3_SOFT
userData :Object
An object that can be used to store custom data about the t3d.Object3D. It should not hold references to functions as these will not be cloned.
Type:
- Object
- Overrides
- Default Value
- {}
uuid :String
UUID of this object instance. This gets automatically assigned, so this shouldn't be edited.
Type:
- String
- Overrides
viewMatrix :t3d.Matrix4
This is the inverse of worldMatrix. The matrix may be different from the value passed in the shader, scene.anchorMatrix is not considered here.
Type:
visible :Boolean
Object gets rendered if true.
Type:
- Boolean
- Overrides
- Default Value
- true
worldMatrix :t3d.Matrix4
The global transform of the object. If the Object3D has no parent, then it's identical to the local transform t3d.Object3D#matrix.
Type:
- Overrides
worldMatrixNeedsUpdate :Boolean
When this is set, it calculates the world matrix in that frame and resets this property to false.
Type:
- Boolean
- Overrides
- Default Value
- true
Methods
add(object)
Add object as child of this object.
Parameters:
Name | Type | Description |
---|---|---|
object | t3d. |
- Overrides
clone(recursiveopt) → {t3d.Object3D}
Returns a clone of this object and optionally all descendants.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
recursive | function | <optional> | true | if true, descendants of the object are also cloned. |
- Overrides
Returns:
- Type:
- t3d.
Object3D
copy(source, recursiveopt) → {t3d.Object3D}
Copy the given object into this object.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
source | t3d. | The object to be copied. | ||
recursive | Boolean | <optional> | true | if true, descendants of the object are also copied. |
- Overrides
Returns:
- Type:
- t3d.
Object3D
getObjectByName(name) → {t3d.Object3D}
Searches through the object's children and returns the first with a matching name. Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
Parameters:
Name | Type | Description |
---|---|---|
name | String | String to match to the children's t3d.Object3D#name property. |
- Overrides
Returns:
- Type:
- t3d.
Object3D
getObjectByProperty(name, value) → {t3d.Object3D}
Searches through the object's children and returns the first with a property that matches the value given.
Parameters:
Name | Type | Description |
---|---|---|
name | String | the property name to search for. |
value | Number | value of the given property. |
- Overrides
Returns:
- Type:
- t3d.
Object3D
getWorldDirection(optionalTarget=opt) → {Vector3}
Returns a vector representing the direction of object's positive z-axis in world space. This call must be after t3d.Object3D#updateMatrix.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
optionalTarget= | Vector3 | <optional> | — the result will be copied into this Vector3. |
- Overrides
Returns:
- the result.
- Type:
- Vector3
lookAt(target, up)
Set view by look at, this func will set quaternion of this camera.
Parameters:
Name | Type | Description |
---|---|---|
target | t3d. | The target that the camera look at. |
up | t3d. | The up direction of the camera. |
- Overrides
onAfterRender()
An optional callback that is executed immediately after the Object3D is rendered.
- Overrides
onBeforeRender()
An optional callback that is executed immediately before the Object3D is rendered.
- Overrides
(abstract) raycast(ray, intersects)
Method to get intersections between a casted ray and this object.
Parameters:
Name | Type | Description |
---|---|---|
ray | Ray | The t3d.Ray instance. |
intersects | Array | output intersects array. |
- Overrides
remove(object)
Remove object as child of this object.
Parameters:
Name | Type | Description |
---|---|---|
object | t3d. |
- Overrides
setOrtho(left, right, bottom, top, near, far)
Set orthographic projection matrix.
Parameters:
Name | Type | Description |
---|---|---|
left | Number | — Camera frustum left plane. |
right | Number | — Camera frustum right plane. |
bottom | Number | — Camera frustum bottom plane. |
top | Number | — Camera frustum top plane. |
near | Number | — Camera frustum near plane. |
far | Number | — Camera frustum far plane. |
setPerspective(fov, aspect, near, far)
Set perspective projection matrix.
Parameters:
Name | Type | Description |
---|---|---|
fov | Number | — Camera frustum vertical field of view. |
aspect | Number | — Camera frustum aspect ratio. |
near | Number | — Camera frustum near plane. |
far | Number | — Camera frustum far plane. |
traverse(callback)
Executes the callback on this object and all descendants.
Parameters:
Name | Type | Description |
---|---|---|
callback | function | A function with as first argument an object3D object. |
- Overrides
updateMatrix()
Update the local transform.
- Overrides