Skip to main content

Class: CameraManager

Defined in: render/camera.ts:5

Constructors

Constructor

new CameraManager(): CameraManager;

Returns

CameraManager

Methods

Create()

static Create(entity): boolean;

Defined in: render/camera.ts:11

Create a Camera component and attach it to the specified entity

Parameters

ParameterTypeDescription
entitynumberThe entity to attach the camera to

Returns

boolean

boolean indicating success


Destroy()

static Destroy(entity): boolean;

Defined in: render/camera.ts:20

Destroy the Camera component from the specified entity

Parameters

ParameterTypeDescription
entitynumberThe entity to remove the camera from

Returns

boolean

boolean indicating success


HasComponent()

static HasComponent(entity): boolean;

Defined in: render/camera.ts:29

Check if the entity has a Camera component

Parameters

ParameterTypeDescription
entitynumberThe entity to check

Returns

boolean

boolean indicating if camera component exists


LookAt()

static LookAt(
entity,
targetX,
targetY,
targetZ,
upX,
upY,
upZ,
worldUpX,
worldUpY,
worldUpZ): boolean;

Defined in: render/camera.ts:112

Make the camera look at a target point

Parameters

ParameterTypeDescription
entitynumberThe entity with the camera component
targetXnumberTarget X coordinate
targetYnumberTarget Y coordinate
targetZnumberTarget Z coordinate
upXnumberUp vector X
upYnumberUp vector Y
upZnumberUp vector Z
worldUpXnumberWorld up X
worldUpYnumberWorld up Y
worldUpZnumberWorld up Z

Returns

boolean

boolean indicating success


SetCullingMask()

static SetCullingMask(entity, mask): boolean;

Defined in: render/camera.ts:146

Set the culling mask for the camera

Parameters

ParameterTypeDescription
entitynumberThe entity with the camera component
masknumberThe culling mask

Returns

boolean

boolean indicating success


SetOrthographic()

static SetOrthographic(
entity,
left,
right,
bottom,
top,
near,
far): boolean;

Defined in: render/camera.ts:76

Set orthographic projection parameters

Parameters

ParameterTypeDescription
entitynumberThe entity with the camera component
leftnumberLeft plane
rightnumberRight plane
bottomnumberBottom plane
topnumberTop plane
nearnumberNear plane
farnumberFar plane

Returns

boolean

boolean indicating success


SetProjection()

static SetProjection(
entity,
projectionType,
fov,
aspect,
near,
far): boolean;

Defined in: render/camera.ts:45

Set the projection parameters for the camera

Parameters

ParameterTypeDescription
entitynumberThe entity with the camera component
projectionTypenumberType of projection
fovnumberField of view
aspectnumberAspect ratio
nearnumberNear plane
farnumberFar plane

Returns

boolean

boolean indicating success


SetRenderTexture()

static SetRenderTexture(entity, textureHandle): boolean;

Defined in: render/camera.ts:161

Set the render texture for the camera

Parameters

ParameterTypeDescription
entitynumberThe entity with the camera component
textureHandlenumberThe render texture handle

Returns

boolean

boolean indicating success