Skip to content

RigidBody2D

Eduard Gushchin edited this page Jul 1, 2026 · 5 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.RigidBody2D
Namespace Electron2D
Kind class
Category Physics

Overview

Provides an Electron2D rigid 2D physics body.

Syntax

public class Electron2D.RigidBody2D : Electron2D.PhysicsBody2D

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: RigidBody2D

RID lifecycle, stored rigid body properties, transform sync, fixed-step velocity movement and AABB sweep against static bodies.

Remarks

The 0.1.0 Preview baseline stores body properties and synchronizes the node transform to the physics server. Dynamic simulation is added by later physics tasks.

Thread Safety

This type is not synchronized. Create and mutate nodes on the main scene thread.

Since

This type is available since Electron2D 0.1.0 Preview.

Members

Member Kind Summary
AngularVelocity Property Gets or sets the current angular velocity.
CanSleep Property Gets or sets whether this body is allowed to sleep.
CenterOfMass Property Gets or sets the custom center of mass.
CenterOfMassMode Property Gets or sets how the center of mass should be selected.
Freeze Property Gets or sets whether this rigid body is frozen.
FreezeMode Property Gets or sets how this body behaves when frozen.
GravityScale Property Gets or sets the gravity multiplier for this body.
Inertia Property Gets or sets the body inertia.
LinearVelocity Property Gets or sets the current linear velocity.
LockRotation Property Gets or sets whether rotation is locked.
Mass Property Gets or sets the body mass.
Sleeping Property Gets or sets whether the body is sleeping.
Electron2D.RigidBody2D() Constructor Initializes a new instance of the RigidBody2D type.

Member Details

AngularVelocity

Kind: Property

public System.Single AngularVelocity { get; set; }

Summary

Gets or sets the current angular velocity.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current angular velocity value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

CanSleep

Kind: Property

public System.Boolean CanSleep { get; set; }

Summary

Gets or sets whether this body is allowed to sleep.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current can sleep value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

CenterOfMass

Kind: Property

public Electron2D.Vector2 CenterOfMass { get; set; }

Summary

Gets or sets the custom center of mass.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current center of mass value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

CenterOfMassMode

Kind: Property

public Electron2D.RigidBody2D.CenterOfMassModeEnum CenterOfMassMode { get; set; }

Summary

Gets or sets how the center of mass should be selected.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current center of mass mode value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

Freeze

Kind: Property

public System.Boolean Freeze { get; set; }

Summary

Gets or sets whether this rigid body is frozen.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current freeze value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

FreezeMode

Kind: Property

public Electron2D.RigidBody2D.FreezeModeEnum FreezeMode { get; set; }

Summary

Gets or sets how this body behaves when frozen.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current freeze mode value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

GravityScale

Kind: Property

public System.Single GravityScale { get; set; }

Summary

Gets or sets the gravity multiplier for this body.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current gravity scale value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

Inertia

Kind: Property

public System.Single Inertia { get; set; }

Summary

Gets or sets the body inertia.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current inertia value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

LinearVelocity

Kind: Property

public Electron2D.Vector2 LinearVelocity { get; set; }

Summary

Gets or sets the current linear velocity.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current linear velocity value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

LockRotation

Kind: Property

public System.Boolean LockRotation { get; set; }

Summary

Gets or sets whether rotation is locked.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current lock rotation value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

Mass

Kind: Property

public System.Single Mass { get; set; }

Summary

Gets or sets the body mass.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current mass value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

Sleeping

Kind: Property

public System.Boolean Sleeping { get; set; }

Summary

Gets or sets whether the body is sleeping.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current sleeping value.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

Electron2D.RigidBody2D()

Kind: Constructor

public Electron2D.RigidBody2D()

Summary

Initializes a new instance of the RigidBody2D type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RigidBody2D

Clone this wiki locally