Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BoxCollider2D

Hierarchy

Index

Properties

Readonly TYPE

TYPE: BOX = ECollider2DType.BOX

Protected _body

_body: RigidBody2D | null = null

Protected _density

_density: number = 1

Protected _friction

_friction: number = 0.2

Protected _group

_group: DEFAULT = PhysicsGroup.DEFAULT

Protected _offset

_offset: Vec2 = new Vec2()

Protected _restitution

_restitution: number = 0

Protected _sensor

_sensor: boolean = false

Protected _shape

_shape: IBaseShape | null = null

Private _size

_size: Size = new Size(1, 1)

editing

editing: boolean = false

tag

tag: number = 0

Tag. If a node has several collider components, you can judge which type of collider is collided according to the tag.

Accessors

body

density

  • get density(): number
  • set density(v: number): void

friction

  • get friction(): number
  • set friction(v: number): void

group

  • get group(): number
  • set group(v: number): void

impl

  • get impl(): null | IBaseShape

offset

  • get offset(): Vec2
  • set offset(v: Vec2): void

restitution

  • get restitution(): number
  • set restitution(v: number): void

sensor

  • get sensor(): boolean
  • set sensor(v: boolean): void

size

  • get size(): Size
  • set size(v: Size): void

worldAABB

  • get worldAABB(): Readonly<Rect>

worldPoints

  • get worldPoints(): keyof Readonly<Vec2>[]

Methods

apply

  • apply(): void

Protected onDestroy

  • onDestroy(): void

Protected onDisable

  • onDisable(): void

Protected onEnable

  • onEnable(): void

Protected onLoad

  • onLoad(): void

Generated using TypeDoc