Scripting API

Scripting API

PolygonCollider2D

Struct in Abyss.Physics2D, from Abyss.Physics2D.

A shape of up to 64 corners an entity meets things with, in order round it, concave or convex: cut into the convex pieces of eight corners at most Box2D's polygons are, its hollows left out. One whose sides cross is its corners' hull; fewer than three, or three in a line, meet nothing.

public struct PolygonCollider2D

Fields

Points

public FixedList64<Vector2> Points

Its corners, in order round it, in the entity's own units.

Offset

public Vector2 Offset

Where its points are from, from the entity's middle.

EdgeRadius

public float EdgeRadius

How round its corners are: the shape grows by it all round.

IsTrigger

public bool IsTrigger

Whether it meets nothing and is told of what enters it.

Material

public AssetRef<PhysicsMaterial2D> Material

What it is made of; none for Physics 2D's settings' default.

Density

public float Density

How heavy it is for its size, in kilograms a square meter: what its body's mass is worked out from where its Rigidbody 2D says Use Auto Mass.