Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BoxCollider

Box collider component.

Hierarchy

Index

Constructors

constructor

Properties

Readonly TYPE

Protected _aabb

_aabb: aabb | null = null

Protected _boundingSphere

_boundingSphere: sphere | null = null

Protected Readonly _center

_center: Vec3 = new Vec3()

Protected _isSharedMaterial

_isSharedMaterial: boolean = true

Protected _isTrigger

_isTrigger: boolean = false

Protected _material

_material: PhysicsMaterial | null = null

Protected _needCollisionEvent

_needCollisionEvent: boolean = false

Protected _needTriggerEvent

_needTriggerEvent: boolean = false

Protected _shape

_shape: IBaseShape | null = null

Private _size

_size: Vec3 = new Vec3(1, 1, 1)

Static Readonly Axis

Axis: EnumAlias<typeof EAxisDirection> = EAxisDirection

Enumeration of axes.

Static Readonly Type

Type: EnumAlias<typeof EColliderType> = EColliderType

Enumeration of collider types.

Accessors

Protected assertOnLoadCalled

  • get assertOnLoadCalled(): boolean

attachedRigidBody

boundingSphere

  • get boundingSphere(): Readonly<sphere>

center

  • get center(): Vec3
  • set center(value: Vec3): void

isTrigger

  • get isTrigger(): boolean
  • set isTrigger(value: boolean): void

material

needCollisionEvent

  • get needCollisionEvent(): boolean

needTriggerEvent

  • get needTriggerEvent(): boolean

shape

  • get shape(): IBoxShape

sharedMaterial

size

  • get size(): Vec3
  • set size(value: Vec3): void

worldBounds

  • get worldBounds(): Readonly<aabb>

Methods

addGroup

  • addGroup(v: number): void

addMask

  • addMask(v: number): void

getGroup

  • getGroup(): number

getMask

  • getMask(): number

off

  • Unregisters callbacks associated with trigger or collision events that have been registered.

    Parameters

    • type: TriggerEventType | CollisionEventType

      The event type, onTriggerEnter|onTriggerStay|onTriggerExit|onCollisionEnter|onCollisionStay|onCollisionExit;

    • Optional callback: undefined | ((...any: any[]) => void)

      The event callback, signature:(event?:ICollisionEvent|ITriggerEvent)=>void.

    • Optional target: any

      The event callback target.

    Returns void

on

  • Registers callbacks associated with triggered or collision events.

    Type parameters

    • TFunction: (...any: any[]) => void

    Parameters

    • type: TriggerEventType | CollisionEventType

      The event type, onTriggerEnter|onTriggerStay|onTriggerExit|onCollisionEnter|onCollisionStay|onCollisionExit;

    • callback: TFunction

      The event callback, signature:(event?:ICollisionEvent|ITriggerEvent)=>void.

    • Optional target: any

      The event callback target.

    • Optional once: undefined | false | true

    Returns any

Protected onDestroy

  • onDestroy(): void

Protected onDisable

  • onDisable(): void

Protected onEnable

  • onEnable(): void

Protected onLoad

  • onLoad(): void

once

  • Registers a callback associated with a trigger or collision event, which is automatically unregistered once executed.

    Type parameters

    • TFunction: (...any: any[]) => void

    Parameters

    • type: TriggerEventType | CollisionEventType

      The event type, onTriggerEnter|onTriggerStay|onTriggerExit|onCollisionEnter|onCollisionStay|onCollisionExit;

    • callback: TFunction

      The event callback, signature:(event?:ICollisionEvent|ITriggerEvent)=>void.

    • Optional target: any

      The event callback target.

    Returns any

removeAll

removeGroup

  • removeGroup(v: number): void

removeMask

  • removeMask(v: number): void

setGroup

  • setGroup(v: number): void

setMask

  • setMask(v: number): void

Generated using TypeDoc