OrthographicCamera
The orthographic camera class, which has no "bigger when it's closer, small when it's far" effect. Size will not be affected by the distance.
Hierarchy
- Camera3D
- OrthographicCamera
Constructors
constructor
- new OrthographicCamera(
left?: number,
right?: number,
top?: number,
bottom?: number,
near?: number,
far?: number,
): OrthographicCameraParameters
- left: number
- right: number
- top: number
- bottom: number
- near: number
- far: number
Returns OrthographicCamera
Overrides Camera3D.constructor
Properties
StaticDefault UpVector3(0, 1, 0)
Every objects in 3D space must have a default up direction.
id
Unique number for each object3D instance.
category Id
Reserved attribute
Inherited from Camera3D.categoryId
source Type
Record the object rendered as instance or other type.
Inherited from Camera3D.sourceType
scene
The scene which this object belong to.
update Dirty Id-1
The number is the frame id which this object is changed or participates change of scene graph. If this value equals to frame id - 1,
Inherited from Camera3D.updateDirtyId
name
The name of this object, it is empty if useless.
is Object3 D
Used to check type of this or extended instance. This value should not be changed by user.
Inherited from Camera3D.isObject3D
parent
Object's parent node in the scene graph. An object can have at most one parent.
children
Array with object's children.
up
This is used by the lookAt method, for example, to determine the orientation of the result. Default is DefaultUp .
world Matrix Update Timestamp
Record when this object's world matrix last updated.
Inherited from Camera3D.worldMatrixUpdateTimestamp
transform Changed
Record whether the object's any attribute| attribute is updated.
Inherited from Camera3D.transformChanged
visible Changed
Inherited from Camera3D.visibleChanged
matrix World
The global transform of the object. If the Object3D has no parent, then it's identical to the local transform matrix.
Inherited from Camera3D.matrixWorld
matrix World Needs Updatefalse
When this is set, it calculates the matrixWorld in that frame and resets this property to false.
Inherited from Camera3D.matrixWorldNeedsUpdate
net Visibility
Record if the object is really visible in rendering process. If the Object3D has no parent, it would be set by visible ;
Inherited from Camera3D.netVisibility
local Matrix Need Updatefalse
When this is set, it calculates the model matrix in that frame and resets this property to false.
Inherited from Camera3D.localMatrixNeedUpdate
enable Frustum Culling
Inherited from Camera3D.enableFrustumCulling
enable Detail Culling
Inherited from Camera3D.enableDetailCulling
is Camera3 D
Check the type whether it belongs to Camera3D. This value should not be changed by user.
Inherited from Camera3D.isCamera3D
type
The type of this Object3D.
matrix World Inverse
This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera3D.
Inherited from Camera3D.matrixWorldInverse
world Rotation
Inherited from Camera3D.worldRotation
world Position
Inherited from Camera3D.worldPosition
projection Matrix
This matrix decides the method of projection such as perspective and orthographic.
Inherited from Camera3D.projectionMatrix
projection Matrix Inverse
The inverse matrix of projectionMatrix .
Inherited from Camera3D.projectionMatrixInverse
bounds
This is used to adapt the bounds of camera to canvas.
is Orthographic Camera
Check the type whether it belongs to OrthographicCamera. This value should not be changed by user.
view
Frustum window specification or null. This is set using the setViewOffset method and cleared using clearViewOffset .
Readonlyuser Data
_ uuid
uuid
_ listeners
Inherited from Camera3D._listeners
Accessors
layers
Returns Layers
Inherited from Camera3D.layers
interaction Layers
Returns Layers | undefined
Inherited from Camera3D.interactionLayers
group Layer
Returns Layers | undefined
Inherited from Camera3D.groupLayer
position
Returns Vector3
Inherited from Camera3D.position
rotation
quaternion
Returns Quaternion
Inherited from Camera3D.quaternion
Object's local rotation as a Quaternion.
Parameters
- _quaternion: Quaternion
Returns void
Remarks
See Quaternion for more details.
Inherited from Camera3D.quaternion
scaleVector3( 1, 1, 1 )
Returns Vector3
Inherited from Camera3D.scale
matrix
visibletrue
- get visible(): boolean
Object gets rendered if true.
Returns boolean
Inherited from Camera3D.visible
- set visible(value: boolean): void
Parameters
- value: boolean
Returns void
Inherited from Camera3D.visible
zoom
- get zoom(): number
Scale width and height of view frustum.
Returns number
- set zoom(v: number): void
Parameters
- v: number
Returns void
left
- get left(): number
Distance from projective plane center to left side.
Returns number
- set left(v: number): void
Parameters
- v: number
Returns void
right
- get right(): number
Distance from projective plane center to right side.
Returns number
- set right(v: number): void
Parameters
- v: number
Returns void
top
- get top(): number
Returns number
- set top(v: number): void
Parameters
- v: number
Returns void
bottom
- get bottom(): number
Returns number
- set bottom(v: number): void
Parameters
- v: number
Returns void
near
- get near(): number
Returns number
- set near(v: number): void
Parameters
- v: number
Returns void
far
- get far(): number
Returns number
- set far(v: number): void
Parameters
- v: number
Returns void
business Tag
- get businessTag(): string
Returns string
Inherited from Camera3D.businessTag
- set businessTag(v: string): void
Parameters
- v: string
Returns void
Inherited from Camera3D.businessTag
Methods
destroy
free GPU
sync Data
update Visibility
Scene will check the object's visibility in each render and make change netVisibility based on its and parent's visible .
Returns boolean
Inherited from Camera3D.updateVisibility
clear Change Mark
Returns void
Inherited from Camera3D.clearChangeMark
set Matrix Updated
If the local matrix is changed, use this method to manually refresh data in scene graph.
Returns void
Tips
It's better to use notifySceneChange() as an alternative.
Inherited from Camera3D.setMatrixUpdated
notify Scene Change
Use this method to manually refresh data in scene graph and draw again. The engine may not notify every change of the scene. If any effect is not changed with the parameters, use this may solve.
Returns void
Inherited from Camera3D.notifySceneChange
set Matrix Dirty
If the local matrix or world matrix is changed, use this method to make engine refresh data in scene graph automatically. This method will set matrixWorldNeedsUpdate and localMatrixNeedUpdate to true.
Returns void
Inherited from Camera3D.setMatrixDirty
update World Render Data
Change matrixWorldNeedsUpdate and worldMatrixUpdateTimestamp state. This method will refresh data of world matrix by updateMatrixWorld
Parameters
- updateID: number
This number is used to identify the render.
Returns boolean
Inherited from Camera3D.updateWorldRenderData
- updateID: number
is Flipped
local To World
Converts the vector from local space to world space.
Parameters
- vector: Vector3
A vector represents a position in local (object) coordinate.
Returns Vector3
Inherited from Camera3D.localToWorld
- vector: Vector3
world To Local
Updates the vector from world space to local space.
Parameters
- vector: Vector3
A vector in world coordinate.
Returns Vector3
Inherited from Camera3D.worldToLocal
- vector: Vector3
apply Matrix
Applies the matrix transform to the object and updates the object's position, rotation and scale.
Parameters
- matrix: Matrix4
A matrix represents the information of transform.
Returns void
Inherited from Camera3D.applyMatrix
- matrix: Matrix4
apply Quaternion
Applies the rotation represented by the quaternion to the object.
Parameters
- q: Quaternion
A Quaternion represents the information of rotation.
Returns this
Inherited from Camera3D.applyQuaternion
- q: Quaternion
set Rotation From Axis Angle
Calls setFromAxisAngle ( axis, angle ) on the Quaternion.
Parameters
- axis: Vector3
A normalized vector in object space.
- angle: number
Angle in radians.
Returns void
Inherited from Camera3D.setRotationFromAxisAngle
- axis: Vector3
set Rotation From Euler
Calls Quaternion.setRotationFromEuler| setRotationFromEuler(euler, true) on the Quaternion.
Parameters
- euler: Euler
Euler angle specifying rotation amount.
Returns void
Inherited from Camera3D.setRotationFromEuler
- euler: Euler
set Rotation From Matrix
Calls setFromRotationMatrix (m) on the Quaternion.
Parameters
- m: Matrix4
Euler angle specifying rotation amount.
Returns void
Inherited from Camera3D.setRotationFromMatrix
- m: Matrix4
set Rotation From Quaternion
Copy the given quaternion to object's quaternion .
Parameters
- q: Quaternion
Euler angle specifying rotation amount.
Returns void
Inherited from Camera3D.setRotationFromQuaternion
- q: Quaternion
rotate On Axis
Rotate an object along an axis in object space. The axis is assumed to be normalized.
Parameters
- axis: Vector3
A normalized vector in object space.
- angle: number
Angle in radians.
Returns this
Inherited from Camera3D.rotateOnAxis
- axis: Vector3
rotate On World Axis
Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.
Parameters
- axis: Vector3
A normalized vector in object space.
- angle: number
Angle in radians.
Returns this
Inherited from Camera3D.rotateOnWorldAxis
- axis: Vector3
rotate X
rotate Y
rotate Z
translate On Axis
Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
Parameters
- axis: Vector3
A normalized vector in object space.
- distance: number
The distance to translate.
Returns this
Inherited from Camera3D.translateOnAxis
- axis: Vector3
translate X
Translates object along x axis in object space by distance units.
Parameters
- distance: number
The distance to translate.
Returns this
Inherited from Camera3D.translateX
- distance: number
translate Y
Translates object along y axis in object space by distance units.
Parameters
- distance: number
The distance to translate.
Returns this
Inherited from Camera3D.translateY
- distance: number
translate Z
Translates object along z axis in object space by distance units.
Parameters
- distance: number
The distance to translate.
Returns this
Inherited from Camera3D.translateZ
- distance: number
look At
look At Local Point
Rotates the object to face a point in local space.
Parameters
- _x: Vector3
A vector representing position of target in local space.
Returns void
Inherited from Camera3D.lookAtLocalPoint
- _x: Vector3
add
Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent. The scene graph change will be immediately notify by engine after adding nodes.
Parameters
Returns this
remove
remove From Parent
Returns void
Inherited from Camera3D.removeFromParent
remove All Children
remove Objects
Remove all children in specified objects from this objects. Migrate from tools common
Parameters
- objects: Object3D[]
An array of objects which need to be removed.
Returns this
Inherited from Camera3D.removeObjects
- objects: Object3D[]
get Object By Id
Searches through an object and its children, starting with the object itself, and returns the first with a matching id. Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
Parameters
- id: number
Unique number of the object instance.
Returns Object3D
Inherited from Camera3D.getObjectById
- id: number
get Object By Name
Searches through an object and its children, starting with the object itself, 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: string
String to match to the children's Object3D.name property.
Returns Object3D
Inherited from Camera3D.getObjectByName
- name: string
get Object By Property
Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
Parameters
- name: string
The property name to search for.
- value: any
Value of the given property.
Returns Object3D
Inherited from Camera3D.getObjectByProperty
- name: string
get World Position
Return a vector representing the position of the object in world space.
Parameters
- target: Vector3
the result will be copied into this Vector3.
Returns Vector3
Inherited from Camera3D.getWorldPosition
- target: Vector3
get World Quaternion
Return a quaternion representing the rotation of the object in world space.
Parameters
- target: Quaternion
the result will be copied into this Quaternion.
Returns Quaternion
Inherited from Camera3D.getWorldQuaternion
- target: Quaternion
get World Scale
Return a vector of the scaling factors applied to the object for each axis in world space.
Parameters
- target: Vector3
the result will be copied into this Vector3.
Returns Vector3
Inherited from Camera3D.getWorldScale
- target: Vector3
traverse
traverse With Children Skip
Execute the callback when return is false, stop traverse the object's descendants.
Parameters
- callback: (object: Object3D) => boolean
A function with as first argument an object3D object, return boolean.
Returns void
Inherited from Camera3D.traverseWithChildrenSkip
- callback: (object: Object3D) => boolean
traverse Visible
Execute the callback on this object and all descendants which is visible.
Parameters
- callback: (object: Object3D) => any
A function with as first argument an object3D object.
Returns void
Inherited from Camera3D.traverseVisible
- callback: (object: Object3D) => any
traverse Ancestors
Execute the callback on this object and all ancestors.
Parameters
- callback: (object: Object3D) => any
A function with as first argument an object3D object.
Returns void
Inherited from Camera3D.traverseAncestors
- callback: (object: Object3D) => any
update Matrix
update Matrix World
Update the object's and its descendants' matrix of global transform with. If the parameter or matrixWorldNeedsUpdate is true, matrix will not skip updates.
Parameters
- force: boolean
Whether or not force to updates the matrix.
Returns void
Inherited from Camera3D.updateMatrixWorld
- force: boolean
get Local Bounds
Get the whole bounding box of current object cover all children's.
Parameters
- localBox: Box3
If this is not undefined, result will be stored to it.
Returns Box3
Inherited from Camera3D.getLocalBounds
- localBox: Box3
get UUID
notify Camera Changed
get World Direction
Set the value of camera's faced direction to given vector.
Parameters
- target: Vector3
this vector representing the world space direction in which the camera is looking.
Returns Vector3
Inherited from Camera3D.getWorldDirection
- target: Vector3
update World Matrix
Update the camera's matrixWorld and matrixWorldInverse .
Parameters
- updateParents: boolean
if true, it also updates all the parents.
- updateChildren: boolean
if true, it also updates all the children.
- force: boolean
Whether or not force to updates the matrix.
Returns void
Inherited from Camera3D.updateWorldMatrix
- updateParents: boolean
update Jitter
get Jitter
- getJitter(): Readonly<
Pick<
ReadonlyMarked,
| "_readonly_mark"
| "cloneReadonly"
| "clone"
| "equals"
| "getSerializeData"
| "x"
| "y"
| "getNumberCount"
| "toArray"
| "width"
| "height"
| "isVector2"
| "dot"
| "cross"
| "lengthSq"
| "length"
| "angle"
| "manhattanLength"
| "distanceTo"
| "distanceToSquared"
| "manhattanDistanceTo"
| "intoSize",
>,
>Returns Readonly<
Pick<
ReadonlyMarked,
| "_readonly_mark"
| "cloneReadonly"
| "clone"
| "equals"
| "getSerializeData"
| "x"
| "y"
| "getNumberCount"
| "toArray"
| "width"
| "height"
| "isVector2"
| "dot"
| "cross"
| "lengthSq"
| "length"
| "angle"
| "manhattanLength"
| "distanceTo"
| "distanceToSquared"
| "manhattanDistanceTo"
| "intoSize",
>,
>
update Prev
Returns void
Inherited from Camera3D.updatePrev
pixels Per Unit Creator
return a function that compute pixelsPerUnit
Parameters
- viewHeight: number
Returns (distance: number) => number
Inherited from Camera3D.pixelsPerUnitCreator
get View Independent Scale Ratio
Calculate a scale value that keep one object's screen unit size match it's world unit size
Parameters
- distance: number
the distance from camera to object.
- viewHeight: number
the hight of view window.
Returns number
Inherited from Camera3D.getViewIndependentScaleRatio
- distance: number
class Name
copy
Copy the data to this camera instance from source. This method need override in derived classes to copy extended data.
Parameters
- source: OrthographicCamera
the data source.
- recursive: boolean
if true, descendants of the object are also cloned. Default is true.
Returns this
- source: OrthographicCamera
set View Offset
- setViewOffset(
fullWidth: number,
fullHeight: number,
x: number,
y: number,
width: number,
height: number,
): voidParameters
- fullWidth: number
- fullHeight: number
- x: number
- y: number
- width: number
- height: number
Returns void
Remarks
See PerspectiveCamera for more details.
clear View Offset
Removes any offset set by the setViewOffset method.
Returns void
update Projection Matrix
Updates the camera's projectionMatrix and projectionMatrixInverse . When user change the attribute such as far, top ..., this method will have to be called for the changes to take effect.
Parameters
Returns void
Overrides Camera3D.updateProjectionMatrix
get Pixels Of Dist One
The tangent value of camera frustum's vertical angle.
Returns number
Overrides Camera3D.getPixelsOfDistOne
pixels Per Unit
Calculate how many screen pixel match one world unit at given distance.
Parameters
- _: number
- viewHeight: number
the hight of view window.
Returns number
Overrides Camera3D.pixelsPerUnit
cast Ray
serialize
deserialize
Parse the data for this class from string according to serializing format.
Parameters
- ctx: Deserializer
an instance give the method to take the data for attribute.
Returns void
Overrides Camera3D.deserialize
- ctx: Deserializer
clone
mark Business Tag
is Destroyed
Returns boolean
Inherited from Camera3D.isDestroyed
validate
destroy All Resources Owned
Returns void
Inherited from Camera3D.destroyAllResourcesOwned
free All Gpu Resource Owned
Returns void
Inherited from Camera3D.freeAllGpuResourceOwned
The orthographic camera class, which has no "bigger when it's closer, small when it's far" effect. Size will not be affected by the distance.