Skip to content

factories overview


Table of contents


utils

DisplayObject3dOpts (type alias)

Signature

export type DisplayObject3dOpts<Tex> = {
  color?: number
  shading?: 'unlit' | 'standart' | 'phong' | 'wireframe'
  diffuse?: Tex
  castShadow?: boolean
  receiveShadow?: boolean
}

IDisplayObject3dComponentFactory (class)

Signature

export declare class IDisplayObject3dComponentFactory<TypeDoc>

createPrimitive (method)

Signature

abstract createPrimitive(
    descriptor: Shape3DMeshDescriptor,
    material?: DisplayObject3dOpts<TypeDoc['texture']>,
  ): TypeDoc['displayObject'];

createPerspectiveCamera (method)

Signature

abstract createPerspectiveCamera(settings: {
    fov?: number;
    aspectRatio?: number;
    frustrum?: { near: number; far: number };
  }): TypeDoc['camera'];

randomColor (method)

Signature

randomColor(): number

createPlane (method)

Signature

createPlane(material: DisplayObject3dOpts<TypeDoc['texture']> = {}): TypeDoc['displayObject']

createBox (method)

Signature

createBox(dimensions: Point3, material: DisplayObject3dOpts<TypeDoc['texture']> = {}): TypeDoc['displayObject']

createCapsule (method)

Signature

createCapsule(
    radius: number,
    centersDistance: number,
    material: DisplayObject3dOpts<TypeDoc['texture']> = {},
  ): TypeDoc['displayObject']

createCylinder (method)

Signature

createCylinder(
    radius: number,
    height: number,
    material: DisplayObject3dOpts<TypeDoc['texture']> = {},
  ): TypeDoc['displayObject']

createCone (method)

Signature

createCone(
    radius: number,
    height: number,
    material: DisplayObject3dOpts<TypeDoc['texture']> = {},
  ): TypeDoc['displayObject']

createSphere (method)

Signature

createSphere(radius: number, material: DisplayObject3dOpts<TypeDoc['texture']> = {}): TypeDoc['displayObject']

IPhysicsBody3dComponentFactory (interface)

Signature

export interface IPhysicsBody3dComponentFactory<TypeDoc extends PhysicsTypeDocRepo3D = PhysicsTypeDocRepo3D> {
  createRigidBody(
    descriptor: BodyShape3DDescriptor,
    transform?: {
      position?: Point3
      rotation?: Point4
    }
  ): TypeDoc['rigidBody']

  createTrigger(
    descriptor: Shape3DDescriptor,
    transform?: {
      position?: Point3
      rotation?: Point4
    }
  ): TypeDoc['trigger']

  createRaycastVehicle(chassis: TypeDoc['rigidBody']): TypeDoc['raycastVehicle']
}