# panda3d.core.CollisionPolygon¶

class CollisionPolygon

Bases: CollisionPlane

Inheritance diagram

__init__(begin: LPoint3, end: LPoint3) → None
__init__(a: LVecBase3, b: LVecBase3, c: LVecBase3) → None
__init__(a: LVecBase3, b: LVecBase3, c: LVecBase3, d: LVecBase3) → None
getNumPoints() → size_t

Returns the number of vertices of the CollisionPolygon.

Return type

size_t

getPoint(n: size_t) → LPoint3

Returns the nth vertex of the CollisionPolygon, expressed in 3-D space.

Return type

LPoint3

static verifyPoints(begin: LPoint3, end: LPoint3) → bool

Verifies that the indicated set of points will define a valid CollisionPolygon: that is, at least three non-collinear points, with no points repeated.

This does not check that the polygon defined is convex; that check is made later, once we have projected the points to 2-d space where the decision is easier.

static verifyPoints(a: LPoint3, b: LPoint3, c: LPoint3) → bool

Verifies that the indicated set of points will define a valid CollisionPolygon: that is, at least three non-collinear points, with no points repeated.

static verifyPoints(a: LPoint3, b: LPoint3, c: LPoint3, d: LPoint3) → bool

Verifies that the indicated set of points will define a valid CollisionPolygon: that is, at least three non-collinear points, with no points repeated.

isValid() → bool

Returns true if the CollisionPolygon is valid (that is, it has at least three vertices), or false otherwise.

isConcave() → bool

Returns true if the CollisionPolygon appears to be concave, or false if it is safely convex.

static getClassType() → TypeHandle
Return type

TypeHandle

getPoints() → list
property points

Returns the nth vertex of the CollisionPolygon, expressed in 3-D space.

Return type

Sequence[LPoint3]

property valid

Returns true if the CollisionPolygon is valid (that is, it has at least three vertices), or false otherwise.

Return type

bool

property concave

Returns true if the CollisionPolygon appears to be concave, or false if it is safely convex.

Return type

bool