Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PolygonCollider2D

Hierarchy

Index

Properties

Readonly TYPE

TYPE: POLYGON = ECollider2DType.POLYGON

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

Private _points

_points: Vec2[] = [new Vec2(-1, -1), new Vec2(1, -1), new Vec2(1, 1), new Vec2(-1, 1)]

Protected _restitution

_restitution: number = 0

Protected _sensor

_sensor: boolean = false

Protected _shape

_shape: IBaseShape | null = null

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.

threshold

threshold: number = 1

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

points

  • get points(): Vec2[]
  • set points(v: Vec2[]): void

restitution

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

sensor

  • get sensor(): boolean
  • set sensor(v: boolean): 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