Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TerrainCollider

地形碰撞器。

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 _terrain

_terrain: ITerrainAsset | null = null

Static Readonly Axis

Axis: EnumAlias<typeof EAxisDirection> = EAxisDirection

坐标轴方向的枚举。

Static Readonly Type

Type: EnumAlias<typeof EColliderType> = EColliderType

碰撞体类型的枚举。

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(): ITerrainShape

sharedMaterial

terrain

  • get terrain(): null | ITerrainAsset
  • set terrain(value: null | ITerrainAsset): void

worldBounds

  • get worldBounds(): Readonly<aabb>

Methods

addGroup

  • addGroup(v: number): void

addMask

  • addMask(v: number): void

getGroup

  • getGroup(): number

getMask

  • getMask(): number

off

on

  • 注册触发或碰撞事件相关的回调。

    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

  • 注册触发或碰撞事件相关的回调,执行一次后会自动取消注册。

    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