Shape2D

Base class for all 2D shapes.

All 2D shape types inherit from this.

Members

Aliases

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

Functions

collide
bool collide(Transform2D local_xform, Shape2D with_shape, Transform2D shape_xform)

Returns true if this shape is colliding with another. This method needs the transformation matrix for this shape (local_xform), the shape to check collisions with (with_shape), and the transformation matrix of that shape (shape_xform).

collideAndGetContacts
Array collideAndGetContacts(Transform2D local_xform, Shape2D with_shape, Transform2D shape_xform)

Returns a list of the points where this shape touches another. If there are no collisions the list is empty. This method needs the transformation matrix for this shape (local_xform), the shape to check collisions with (with_shape), and the transformation matrix of that shape (shape_xform).

collideWithMotion
bool collideWithMotion(Transform2D local_xform, Vector2 local_motion, Shape2D with_shape, Transform2D shape_xform, Vector2 shape_motion)

Returns whether this shape would collide with another, if a given movement was applied. This method needs the transformation matrix for this shape (local_xform), the movement to test on this shape (local_motion), the shape to check collisions with (with_shape), the transformation matrix of that shape (shape_xform), and the movement to test onto the other object (shape_motion).

collideWithMotionAndGetContacts
Array collideWithMotionAndGetContacts(Transform2D local_xform, Vector2 local_motion, Shape2D with_shape, Transform2D shape_xform, Vector2 shape_motion)

Returns a list of the points where this shape would touch another, if a given movement was applied. If there are no collisions the list is empty. This method needs the transformation matrix for this shape (local_xform), the movement to test on this shape (local_motion), the shape to check collisions with (with_shape), the transformation matrix of that shape (shape_xform), and the movement to test onto the other object (shape_motion).

draw
void draw(RID canvas_item, Color color)

Draws a solid shape onto a CanvasItem with the VisualServer API filled with the specified color. The exact drawing method is specific for each shape and cannot be configured.

getCustomSolverBias
double getCustomSolverBias()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(Shape2D other)
opEquals
bool opEquals(typeof(null) n)
setCustomSolverBias
void setCustomSolverBias(double bias)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

customSolverBias
double customSolverBias [@property getter]
double customSolverBias [@property setter]

The shape's custom solver bias.

Static functions

_new
Shape2D _new()

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