-
Notifications
You must be signed in to change notification settings - Fork 0
PhysicsBody2D
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.PhysicsBody2D |
| Namespace | Electron2D |
| Kind | class |
| Category | Physics |
Provides the base node for physical 2D bodies that participate in collision queries.
public abstract class Electron2D.PhysicsBody2D : Electron2D.CollisionObject2DProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: PhysicsBody2D
Base class for body nodes with shared PhysicsMaterialOverride and MoveAndCollide() kinematic movement helper.
Electron2D.PhysicsBody2D is the shared base for Electron2D.StaticBody2D,
Electron2D.RigidBody2D and Electron2D.CharacterBody2D. It exposes
body-level movement helpers without exposing backend-specific handles.
This type is not synchronized. Create and mutate nodes on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.CharacterBody2DElectron2D.CollisionObject2D
| Member | Kind | Summary |
|---|---|---|
PhysicsMaterialOverride |
Property | Gets or sets the physics material overriding this body's default collision material. |
Electron2D.PhysicsBody2D() |
Constructor | Initializes a new instance of the PhysicsBody2D type. |
MoveAndCollide(Electron2D.Vector2, System.Boolean, System.Single, System.Boolean) |
Method | Moves this body along a motion vector and stops when it hits another body. |
Kind: Property
public Electron2D.PhysicsMaterial PhysicsMaterialOverride { get; set; }Gets or sets the physics material overriding this body's default collision material.
The 0.1.0 Preview baseline stores this value in the internal body-state snapshot so future physics backends can combine material properties.
The override material, or null to use the default body material.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.PhysicsMaterial
Kind: Constructor
public Electron2D.PhysicsBody2D()Initializes a new instance of the PhysicsBody2D type.
The new instance follows the lifetime and validation rules of its declaring type.
This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.
This API is available since Electron2D 0.1.0 Preview.
Electron2D.PhysicsBody2D
Kind: Method
public Electron2D.KinematicCollision2D MoveAndCollide(Electron2D.Vector2, System.Boolean, System.Single, System.Boolean)(Electron2D.Vector2 motion, System.Boolean testOnly, System.Single safeMargin, System.Boolean recoveryAsCollision)Moves this body along a motion vector and stops when it hits another body.
The 0.1.0 Preview baseline performs a managed AABB sweep against
Electron2D.StaticBody2D targets whose collision layers match this
body's Electron2D.CollisionObject2D.CollisionMask.
When testOnly is false, the body position is
advanced by either the full motion or the collision
travel reported by Electron2D.KinematicCollision2D.GetTravel.
-
motion: The relative motion to test and, unlesstestOnlyistrue, apply to this body. -
testOnly: Whentrue, the collision is reported without changing the body position. -
safeMargin: Extra separation margin used by the managed AABB baseline when sweeping the body. -
recoveryAsCollision: Whether recovery movement should be reported as a collision. The 0.1.0 Preview AABB baseline stores the value for API compatibility but does not run a separate recovery phase yet.
A Electron2D.KinematicCollision2D when the movement hit another body;
otherwise, null.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.CharacterBody2D.MoveAndSlideElectron2D.KinematicCollision2D
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.