Welcome to the Godot Reference Fork and the Godot Proposals Fork alternatives. Why?

Shape2D

0 0 vote
Article Rating

Inherits: Resource < Reference < Object

Inherited By: CapsuleShape2D, CircleShape2D, ConcavePolygonShape2D, ConvexPolygonShape2D, LineShape2D, RayShape2D, RectangleShape2D, SegmentShape2D

Base class for all 2D shapes.

Description

Base class for all 2D shapes. All 2D shape types inherit from this.

Methods

boolcollide ( Transform2D local_xform, Shape2D with_shape, Transform2D shape_xform )
Arraycollide_and_get_contacts ( Transform2D local_xform, Shape2D with_shape, Transform2D shape_xform )
boolcollide_with_motion ( Transform2D local_xform, Vector2 local_motion, Shape2D with_shape, Transform2D shape_xform, Vector2 shape_motion )
Arraycollide_with_motion_and_get_contacts ( Transform2D local_xform, Vector2 local_motion, Shape2D with_shape, Transform2D shape_xform, Vector2 shape_motion )

Property Descriptions

Default0.0
Setterset_custom_solver_bias(value)
Getterget_custom_solver_bias()

The shape’s custom solver bias.

Method Descriptions

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).


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).


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).


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).

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x