Class ColliderBehavior3D
Inheritance
Inherited Members
Namespace: Genesis.Physics
Assembly: Genesis.dll
Syntax
public abstract class ColliderBehavior3D : PhysicsBehavior
Constructors
ColliderBehavior3D(PhysicHandler)
Declaration
protected ColliderBehavior3D(PhysicHandler physicHandler)
Parameters
Type | Name | Description |
---|---|---|
PhysicHandler | physicHandler |
Properties
Collider
Declaration
public CollisionObject Collider { get; set; }
Property Value
Type | Description |
---|---|
CollisionObject |
Offset
Declaration
public Vec3 Offset { get; set; }
Property Value
Type | Description |
---|---|
Vec3 |
PhysicHandler
Declaration
public PhysicHandler PhysicHandler { get; set; }
Property Value
Type | Description |
---|---|
PhysicHandler |
Methods
CreateCollider(int, int)
Abstract method to create the collider. Implement this method in derived classes to define the specific behavior for creating a collider.
Declaration
public abstract void CreateCollider(int collisionGroup = -1, int collisionMask = -1)
Parameters
Type | Name | Description |
---|---|---|
int | collisionGroup | |
int | collisionMask |
GetPhysicsObject()
Retrieves the physics object associated with this behavior.
Declaration
public override object GetPhysicsObject()
Returns
Type | Description |
---|---|
object | The rigid body associated with this behavior. |
Overrides
GetPhysicsObject<T>()
Retrieves the physics object associated with this behavior, cast to the specified type.
Declaration
public override T GetPhysicsObject<T>()
Returns
Type | Description |
---|---|
T | The rigid body associated with this behavior, cast to the specified type. |
Type Parameters
Name | Description |
---|---|
T | The type to cast the physics object to. |
Overrides
OnDestroy(Game, GameElement)
Rendering method called during the render phase. Override this method to provide custom rendering logic.
Declaration
public override void OnDestroy(Game game, GameElement parent)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
GameElement | parent | The parent game element. |
Overrides
OnInit(Game, GameElement)
Initialization method called when the behavior is initialized. Override this method to provide custom initialization logic.
Declaration
public override void OnInit(Game game, GameElement parent)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
GameElement | parent | The parent game element. |
Overrides
OnRender(Game, GameElement)
Cleanup method called when the behavior is destroyed. Override this method to provide custom cleanup logic.
Declaration
public override void OnRender(Game game, GameElement parent)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
GameElement | parent | The parent game element. |
Overrides
OnUpdate(Game, GameElement)
Updates the collider's position and rotation based on its current state in the physics simulation.
Declaration
public override void OnUpdate(Game game, GameElement parent)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
GameElement | parent | The parent game element. |
Overrides
Rotate(Vec3)
Rotates the collider by the specified vector of Euler angles.
Declaration
public virtual void Rotate(Vec3 value)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | value | A vector containing rotation angles for X, Y, and Z axes. |
Rotate(float, float, float)
Rotates the collider by the specified Euler angles.
Declaration
public virtual void Rotate(float x, float y, float z)
Parameters
Type | Name | Description |
---|---|---|
float | x | The rotation angle around the X-axis. |
float | y | The rotation angle around the Y-axis. |
float | z | The rotation angle around the Z-axis. |
Translate(Vec3)
Translates the collider by the specified vector.
Declaration
public virtual void Translate(Vec3 value)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | value | The translation vector. |
Translate(float, float, float)
Translates the collider by the specified distances.
Declaration
public virtual void Translate(float x, float y, float z)
Parameters
Type | Name | Description |
---|---|---|
float | x | The distance to translate along the X-axis. |
float | y | The distance to translate along the Y-axis. |
float | z | The distance to translate along the Z-axis. |