reckfellENGINE

RectangleShape2D

Rectangular 2D collision geometry specified by full dimensions.

On this page
class RectangleShape2DReckfellSharpInherits Shape2D

Size is the full rectangle width and height, initially (20,20). For example, Size=(40,12) produces GetRect()=(-20,-6,40,12): the center is the local origin, extending 20 units left and right. Do not pass half extents. GetRect() excludes the resource user’s position and rotation.

Assign the resource to Shape on a CollisionShape2D inside CollisionObject2D. A shape does not create a body by itself. Use distinct resource instances when two colliders need independent dimensions.

Size and SetSize update the same geometry. Negative components are rejected; use positive finite values for a working shape. Changed is emitted for a change, but not for an identical Size assignment.

Values, local bounds, notifications and direct overlap queries with a circle were checked. This does not establish body movement, friction behavior or rendered appearance.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

RectangleShape2DConstructor
# RectangleShape2D
C#
public RectangleShape2D();

Creates a rectangle with full Size=(20,20), centered at the local origin. A geometry resource, not an independent physics body.

Properties1

SizeProperty
# Size
C#
public Vector2 Size { get; set; }

Full width and height, initially (20,20), not half extents. The center is at the local origin. Negative components are rejected; use positive finite components. A change updates the physics shape and emits Changed; repeating a value does not.

Methods2

GetSizeVector2
# GetSize
C#
public Vector2 GetSize();

Current full width and height, not half extents.

Returns Vector2

Current full width and height, not half extents.

SetSizevoid
# SetSize
C#
public void SetSize(Vector2 size);

Full width and height, initially (20,20), not half extents. The center is at the local origin. Negative components are rejected; use positive finite components. A change updates the physics shape and emits Changed; repeating a value does not.

Parameters
NameTypeDefault
sizeVector2—
size

Full width and height in local units; positive finite components.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.