Class PhysicsBehavior
Represents an abstract class for defining physics behavior in the game.
Inheritance
PhysicsBehavior
Inherited Members
Namespace: Genesis.Physics
Assembly: Genesis.dll
Syntax
public abstract class PhysicsBehavior : IGameBehavior
Constructors
PhysicsBehavior()
Declaration
protected PhysicsBehavior()
Fields
OnCollide
Event triggered when a collision occurs.
Declaration
public PhysicsBehaviorEvent OnCollide
Field Value
Type | Description |
---|---|
PhysicsBehaviorEvent |
Methods
Collide(Scene, Game, RigidBody)
Handles the collision event, invoking the OnCollide event if subscribed.
Declaration
public virtual void Collide(Scene scene, Game game, RigidBody collisionObject)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | The scene where the collision occurred |
Game | game | The game associated with the collision |
RigidBody | collisionObject | The collision object involved in the event |
GetPhysicsObject()
Gets the physics object associated with this behavior.
Declaration
public abstract object GetPhysicsObject()
Returns
Type | Description |
---|---|
object | The physics object |
GetPhysicsObject<T>()
Gets the physics object associated with this behavior, cast to type T.
Declaration
public abstract T GetPhysicsObject<T>()
Returns
Type | Description |
---|---|
T | The physics object cast to type T |
Type Parameters
Name | Description |
---|---|
T | Type to cast the physics object to |