Atlas Engine
API Referenceatlas

CoreObject

Renderable mesh with vertices, indices, textures, material, and optional instances.

Module: atlas

Renderable mesh with vertices, indices, textures, material, and optional instances.

Declaration

export class CoreObject extends GameObject { ... }

Extends: GameObject

Constructors

constructor();

Properties

vertices

vertices: CoreVertex[];

indices

indices: number[];

textures

textures: Texture[];

material

material: Material;

instances

instances: Instance[];

position

position: Position3d;

rotation

rotation: Rotation3d;

scale

scale: Scale3d;

castsShadows

castsShadows: boolean;

name

name: string;

Methods

makeEmissive

makeEmissive(color: Color, intensity: number): void;

attachVertices

attachVertices(vertices: CoreVertex[]): void;

attachIndices

attachIndices(indices: number[]): void;

attachTexture

Attaches a texture to this object.

attachTexture(texture: Texture): void;

setPosition

Sets the position to an absolute value.

setPosition(position: Position3d): void;

move

Translates by the supplied offset.

move(position: Position3d): void;

setRotation

Replaces the rotation.

setRotation(rotation: Rotation3d): void;

setRotationQuaternion

setRotationQuaternion(rotation: Quaternion): void;

rotate

Applies an incremental rotation.

rotate(rotation: Rotation3d): void;

lookAt

Orients toward the target position.

lookAt(target: Position3d, up?: Normal3d): void;

setScale

Replaces the scale factors.

setScale(scale: Scale3d): void;

scaleBy

Multiplies the current scale component-wise by the supplied factors.

scaleBy(scale: Scale3d): void;

clone

Creates a copy of this mesh object.

clone(): CoreObject;

show

Makes the object visible.

show(): void;

hide

Makes the object invisible.

hide(): void;

addComponent

Attaches a component to this object.

addComponent<T extends Component>(component: T): void;

enableDeferredRendering

enableDeferredRendering(): void;

disableDeferredRendering

disableDeferredRendering(): void;

createInstance

Creates an additional instance of this mesh and returns its transform handle.

createInstance(): Instance;

getComponent

Returns the component matching the supplied constructor, or null if none is attached.

getComponent<T extends Component>(
            type: new (...args: any[]) => T,
        ): T | null;

box

static box(size: Size3d): CoreObject;

plane

static plane(size: Size2d): CoreObject;

pyramid

static pyramid(size: Size3d): CoreObject;

sphere

static sphere(
            radius: number,
            sectorCount: number,
            stackCount: number,
        ): CoreObject;

On this page