-
Notifications
You must be signed in to change notification settings - Fork 0
KinematicCollision2D
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.KinematicCollision2D |
| Namespace | Electron2D |
| Kind | class |
| Category | Physics |
Holds collision data returned by 2D body movement methods.
public class Electron2D.KinematicCollision2D : Electron2D.RefCountedProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: KinematicCollision2D
Collision result object returned by body movement methods, with collider, normal, travel, remainder and velocity data.
The 0.1.0 Preview baseline stores collision information produced by the managed AABB kinematic solver. It does not expose backend-specific handles.
This type is not synchronized. Read it on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.CharacterBody2D.MoveAndSlideElectron2D.PhysicsBody2D.MoveAndCollide(Electron2D.Vector2,System.Boolean,System.Single,System.Boolean)
| Member | Kind | Summary |
|---|---|---|
GetAngle(Electron2D.Vector2?) |
Method | Gets the collision angle relative to an up direction. |
GetCollider() |
Method | Gets the object collided with by the moving body. |
GetColliderId() |
Method | Gets the instance ID of the object collided with by the moving body. |
GetColliderRid() |
Method | Gets the physics server RID of the collider. |
GetColliderShape() |
Method | Gets the collider shape object involved in the collision. |
GetColliderShapeIndex() |
Method | Gets the collider shape index involved in the collision. |
GetColliderVelocity() |
Method | Gets the velocity reported for the collider. |
GetDepth() |
Method | Gets the overlap depth along the collision normal. |
GetLocalShape() |
Method | Gets the moving body's local shape object involved in the collision. |
GetNormal() |
Method | Gets the collision normal. |
GetPosition() |
Method | Gets the collision position in global coordinates. |
GetRemainder() |
Method | Gets the remaining motion after the collision. |
GetTravel() |
Method | Gets the motion completed before the collision. |
Kind: Method
public System.Single GetAngle(Electron2D.Vector2?)(Electron2D.Vector2? upDirection)Gets the collision angle relative to an up direction.
When upDirection is null,
Electron2D.Vector2.Up is used as the reference direction.
-
upDirection: The up direction used as the reference vector. When omitted,Electron2D.Vector2.Upis used.
The positive angle in radians between the collision normal and the up direction.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetNormal
Kind: Method
public Electron2D.Object GetCollider()()Gets the object collided with by the moving body.
The current movement baseline reports Electron2D.StaticBody2D
colliders.
The collider object, or null when the collision has no collider.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetColliderRidElectron2D.KinematicCollision2D.GetColliderShape
Kind: Method
public System.Int64 GetColliderId()()Gets the instance ID of the object collided with by the moving body.
The value matches Electron2D.Object.GetInstanceId for the object
returned by Electron2D.KinematicCollision2D.GetCollider.
The collider instance ID, or 0 when the collision has no collider.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetCollider
Kind: Method
public Electron2D.Rid GetColliderRid()()Gets the physics server RID of the collider.
The RID is an opaque identifier. It should be passed only to APIs that
explicitly accept Electron2D.Rid.
The collider RID, or the empty RID when the collision has no collider.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetCollider
Kind: Method
public Electron2D.Object GetColliderShape()()Gets the collider shape object involved in the collision.
The returned object is the Electron2D.CollisionShape2D that provided
the target bounds for the sweep.
The collider shape object, or null when unavailable.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetColliderShapeIndex
Kind: Method
public System.Int32 GetColliderShapeIndex()()Gets the collider shape index involved in the collision.
The 0.1.0 Preview baseline reports the index within the collider's active collision shapes collected for the movement query.
The collider shape index.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetColliderShape
Kind: Method
public Electron2D.Vector2 GetColliderVelocity()()Gets the velocity reported for the collider.
For Electron2D.StaticBody2D colliders this value is
Electron2D.StaticBody2D.ConstantLinearVelocity.
The collider velocity.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.CharacterBody2D.GetPlatformVelocity
Kind: Method
public System.Single GetDepth()()Gets the overlap depth along the collision normal.
The current movement baseline reports swept collisions rather than
persistent overlap recovery, so this value is 0.
The overlap depth. The AABB baseline returns 0 for swept collisions.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetNormal
Kind: Method
public Electron2D.Object GetLocalShape()()Gets the moving body's local shape object involved in the collision.
The returned object is the moving body's Electron2D.CollisionShape2D
used for the sweep.
The local shape object, or null when unavailable.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetColliderShape
Kind: Method
public Electron2D.Vector2 GetNormal()()Gets the collision normal.
The normal points away from the collider and is used by
Electron2D.CharacterBody2D.MoveAndSlide to remove the velocity
component that moves into the collision.
The collision normal.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetAngle(System.Nullable{Electron2D.Vector2})Electron2D.KinematicCollision2D.GetTravel
Kind: Method
public Electron2D.Vector2 GetPosition()()Gets the collision position in global coordinates.
In the managed AABB baseline this is the swept center point on the expanded bounds used to stop the moving body.
The collision position.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetTravel
Kind: Method
public Electron2D.Vector2 GetRemainder()()Gets the remaining motion after the collision.
Electron2D.CharacterBody2D.MoveAndSlide slides this value along the
collision normal to continue movement after a hit.
The motion that remained after travel was consumed.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetNormalElectron2D.KinematicCollision2D.GetTravel
Kind: Method
public Electron2D.Vector2 GetTravel()()Gets the motion completed before the collision.
For non-test movement, the moving body has already been advanced by this vector when the collision is returned.
The travel motion before the body stopped or slid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.KinematicCollision2D.GetRemainderElectron2D.PhysicsBody2D.MoveAndCollide(Electron2D.Vector2,System.Boolean,System.Single,System.Boolean)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.