CollisionPolygon2D

Defines a 2D collision polygon.

Provides a 2D collision polygon to a CollisionObject2D parent. Polygons can be drawn in the editor or specified by a list of vertices.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

BuildMode
enum BuildMode
Constants
enum Constants

Functions

getBuildMode
CollisionPolygon2D.BuildMode getBuildMode()
getOneWayCollisionMargin
double getOneWayCollisionMargin()
getPolygon
PoolVector2Array getPolygon()
isDisabled
bool isDisabled()
isOneWayCollisionEnabled
bool isOneWayCollisionEnabled()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(CollisionPolygon2D other)
opEquals
bool opEquals(typeof(null) n)
setBuildMode
void setBuildMode(long build_mode)
setDisabled
void setDisabled(bool disabled)
setOneWayCollision
void setOneWayCollision(bool enabled)
setOneWayCollisionMargin
void setOneWayCollisionMargin(double margin)
setPolygon
void setPolygon(PoolVector2Array polygon)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

buildMode
CollisionPolygon2D.BuildMode buildMode [@property getter]
long buildMode [@property setter]

Collision build mode. Use one of the buildmode constants.

disabled
bool disabled [@property getter]
bool disabled [@property setter]

If true, no collisions will be detected.

oneWayCollision
bool oneWayCollision [@property getter]
bool oneWayCollision [@property setter]

If true, only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.

oneWayCollisionMargin
double oneWayCollisionMargin [@property getter]
double oneWayCollisionMargin [@property setter]

The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity.

polygon
PoolVector2Array polygon [@property getter]
PoolVector2Array polygon [@property setter]

The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the PoolVector2Array, not a reference.

Static functions

_new
CollisionPolygon2D _new()

Construct a new instance of CollisionPolygon2D. Note: use memnew!CollisionPolygon2D instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta