CollisionShape2D

Node that represents collision shape data in 2D space.

Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an Area2D to give it a detection shape, or add it to a PhysicsBody2D to create a solid object. IMPORTANT: this is an Editor-only helper to create shapes, use CollisionObject2D.shapeOwnerGetShape to get the actual shape.

Members

Aliases

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

Functions

_shapeChanged
void _shapeChanged()
getOneWayCollisionMargin
double getOneWayCollisionMargin()
getShape
Ref!Shape2D getShape()
isDisabled
bool isDisabled()
isOneWayCollisionEnabled
bool isOneWayCollisionEnabled()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(CollisionShape2D other)
opEquals
bool opEquals(typeof(null) n)
setDisabled
void setDisabled(bool disabled)
setOneWayCollision
void setOneWayCollision(bool enabled)
setOneWayCollisionMargin
void setOneWayCollisionMargin(double margin)
setShape
void setShape(Shape2D shape)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

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

A disabled collision shape has no effect in the world. This property should be changed with GodotObject.setDeferred.

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

Sets whether this collision shape should only detect collision on one side (top or bottom).

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 shape at a high velocity.

shape
Shape2D shape [@property getter]
Shape2D shape [@property setter]

The actual shape owned by this collision shape.

Static functions

_new
CollisionShape2D _new()

Construct a new instance of CollisionShape2D. Note: use memnew!CollisionShape2D 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