Skip to main content

TSceneComponent

Component for an actor. Only contains updater and cannot be rendered.

Hierarchy

Index

Constructors

constructor

  • new TSceneComponent(actor: default, bodyOptions?: TPhysicsBodyOptions): default
  • Parameters

    • actor: default
    • optionalbodyOptions: TPhysicsBodyOptions

    Returns default

Properties

publicactor

actor: default

publiccanRender

canRender: boolean = false

Indicates whether a component has the ability to be rendered.

publicoptionalcollider

collider?: ICollider

Collider for this component.

publicdead

dead: boolean = false

publicoptionalparentComponent

parentComponent?: default

Parent of this component. If undefined, it is a root component.

publicshouldRender

shouldRender: boolean = false

Indicates whether a component should be rendered

publictransform

transform: default = ...

Transform relative to the parent or actor (if has no parent).

publicuuid

uuid: string = ...

Accessors

publicangularVelocity

  • get angularVelocity(): undefined | vec3
  • Returns undefined | vec3

publicbodyOptions

  • get bodyOptions(): TPhysicsBodyOptions
  • Get physics body config for scene component


    Returns TPhysicsBodyOptions

publiclinearVelocity

  • get linearVelocity(): undefined | vec3
  • Returns undefined | vec3

Methods

publicapplyCentralForce

  • applyCentralForce(force: vec3): void
  • Parameters

    • force: vec3

    Returns void

publicapplyCentralImpulse

  • applyCentralImpulse(impulse: vec3): void
  • Parameters

    • impulse: vec3

    Returns void

publicapplyTransform

  • applyTransform(): void
  • Apply transforms ensure transform updates get propagated to the physics world


    Returns void

publicattachTo

  • attachTo(parentComponent: default): void
  • Attaches the component as a child to the given component.


    Parameters

    Returns void

publicdestroy

  • destroy(): void
  • Returns void

publicgetRenderTask

  • getRenderTask(): undefined | TSerializedRenderTask
  • Returns undefined | TSerializedRenderTask

publicgetWorldTransform

  • Gets the component to world transform


    Returns default

publicsetAngularDamping

  • setAngularDamping(damping: number): void
  • Parameters

    • damping: number

    Returns void

publicsetAngularVelocity

  • setAngularVelocity(velocity: vec3): void
  • Parameters

    • velocity: vec3

    Returns void

publicsetBodyType

  • setBodyType(type: TPhysicsBodyType): void
  • Parameters

    • type: TPhysicsBodyType

    Returns void

publicsetFixedRotation

  • setFixedRotation(fixedRotation: boolean): void
  • Parameters

    • fixedRotation: boolean

    Returns void

publicsetFriction

  • setFriction(friction: number): void
  • Parameters

    • friction: number

    Returns void

publicsetIsTrigger

  • setIsTrigger(isTrigger: boolean): void
  • Triggers don't collide with other objects, but they still trigger collision events


    Parameters

    • isTrigger: boolean

    Returns void

publicsetLinearDamping

  • setLinearDamping(damping: number): void
  • Parameters

    • damping: number

    Returns void

publicsetLinearVelocity

  • setLinearVelocity(velocity: vec3): void
  • Parameters

    • velocity: vec3

    Returns void

publicupdatePhysicsBody

  • updatePhysicsBody(body: undefined | TPhysicsBody): void
  • Set physics body for this component, this is automatically called by the physics world. Changing this will not update the physics world, use the various set methods instead.


    Parameters

    • body: undefined | TPhysicsBody

    Returns void