Camera

Overview

Camera is a class in Aspose.3d for Typescript. Inherits from: Camera, Entity.

Camera objects let developers set projection parameters such as near/far planes, aspect ratio, orthographic height and up direction.

Properties

NameTypeAccessDescription
namestringReadStores the camera’s identifier string
parentNodesany[]ReadHolds an array of parent nodes containing this camera
excludedbooleanReadIndicates whether the camera is excluded from rendering
parentNodeanyReadReferences the immediate parent node of the camera
rotationModeanyReadDefines how the camera rotation is applied
nearPlanenumberReadSpecifies the distance to the near clipping plane
farPlanenumberReadSpecifies the distance to the far clipping plane
aspectnumberReadDefines the aspect ratio used for perspective projection
orthoHeightnumberReadSets the height of the orthographic view volume
upanyReadDefines the up direction vector for the camera
lookAtanyReadDefines the point the camera is looking at
directionanyReadDefines the forward direction vector of the camera
targetanyReadDefines the target point for the camera’s focus
apertureModeanyReadSpecifies the aperture behavior mode
fieldOfViewnumberReadDefines the vertical field of view angle in degrees
fieldOfViewXnumberReadDefines the horizontal field of view angle
fieldOfViewYnumberReadDefines the vertical field of view angle
widthnumberReadDefines the viewport width in pixels
heightnumberRead
aspectRationumberReadDefines the ratio of width to height for the viewport
magnificationanyReadDefines the camera’s magnification factor
projectionTypestringReadIndicates the type of projection (e.g., perspective or orthographic)

Methods

SignatureDescription
constructor(name: string | null, projectionType: any)Creates a new Camera with optional name and specified projection type
moveForward(_distance: number)Moves the camera forward by the given distance
getBoundingBox()anyReturns the camera’s bounding box
getEntityRendererKey()anyReturns a key used for rendering the camera entity
removeProperty(_prop: Property | string)booleanRemoves a property (by object or name) from the camera and returns success
getProperty(_property: string)anyRetrieves the value of a named property from the camera
setProperty(_property: string, _value: any)Assigns a value to a named property on the camera
findProperty(_property: string)Property | nullSearches for a property by name and returns the Property object or null