Editor.Components.Camera
ClassRenders the scene from a viewpoint with configurable projection and output.
Index
Properties
Methods
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;
// Access the main camera and configure it
const cam = scene.mainCamera;
if (Editor.isNull(cam)) {
console.log('No main camera');
return;
}
// Configure as perspective camera
cam.cameraType = Editor.Components.CameraType.Perspective;
cam.fov = 60;
cam.near = 0.1;
cam.far = 1000;
cam.renderOrder = 0;
console.log(`Camera: type=Perspective, fov=${cam.fov}, near=${cam.near}, far=${cam.far}`);
console.log(` renderOrder=${cam.renderOrder}, aspect=${cam.aspect}`);
Extends
Properties
aspect
aspect:
number
Width-to-height ratio of the camera view.
aspectPreset
aspectPreset:
CameraAspectPreset
Preset aspect ratio option.
cameraType
cameraType:
CameraType
Projection type (perspective or orthographic).
clearColor
clearColor:
CameraClearColor
Background color rendered before scene content.
clearDepth
clearDepth:
CameraClearDepth
Depth buffer clearing behavior.
depthMode
depthMode:
CameraDepthBufferMode
Depth buffer format and configuration.
deviceProperty
deviceProperty:
CameraDeviceProperty
Device camera properties (aspect, FOV, or both) to inherit from the physical camera.
enabled
enabled:
boolean
Whether the component is active.
Inherited from
far
far:
number
Far clipping plane distance.
fov
fov:
number
Vertical field of view in degrees.
hasPrefabChanges
readonlyhasPrefabChanges:boolean
Whether this entity differs from its counterpart in the prefab or was added to the prefab instance. Always false outside prefab instances.
Inherited from
RenderLayerOwner.hasPrefabChanges
id
readonlyid:Uuid
The unique id of the entity.
Inherited from
inputTexture
inputTexture:
Texture
Texture used as the camera's input (background) image.
isPrefabInstanceRoot
readonlyisPrefabInstanceRoot:boolean
Whether this entity is the root of a prefab instance.
Inherited from
RenderLayerOwner.isPrefabInstanceRoot
maskTexture
maskTexture:
Texture
Texture used to mask camera output.
meta
readonlymeta:Meta
Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.
Inherited from
mipmapLevel
mipmapLevel:
number
Mip level at which to render the camera.
name
name:
string
Name of the component.
Inherited from
near
near:
number
Near clipping plane distance.
oitLayers
oitLayers:
CameraOitLayers
Order-independent transparency layer configuration.
orthographicSize
readonlyorthographicSize:vec2
Height of the orthographic view in world units.
renderLayer
renderLayer:
LayerSet
The set of render layers this component belongs to.
Inherited from
renderOrder
renderOrder:
number
Rendering priority relative to other cameras.
renderTarget
renderTarget:
RenderTarget
Output texture or framebuffer for rendering.
sceneObject
readonlysceneObject:SceneObject
Scene object this component is attached to.
Inherited from
size
size:
number
Size of the camera's render region.
type
readonlytype:string
The entity's type.
Inherited from
Methods
getDirectlyReferencedEntities()
getDirectlyReferencedEntities():
Entity[]
A list of entities which this entity has a reference to.
Returns
Entity[]
Inherited from
RenderLayerOwner.getDirectlyReferencedEntities
getMeta()
staticgetMeta():Meta
Returns metadata about this type.
Returns
Overrides
getOwnedEntities()
getOwnedEntities():
Entity[]
A list of entities which has a reference to this entity.
Returns
Entity[]
Inherited from
RenderLayerOwner.getOwnedEntities
getPrefabInstanceRoot()
getPrefabInstanceRoot():
Prefabable
Returns the nearest prefab instance root that contains this entity, starting with the entity itself, or null if it is not part of a prefab instance.
Returns
Inherited from
RenderLayerOwner.getPrefabInstanceRoot
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean