Class TriggerBehavior3D
Abstract base class for defining trigger behaviors in 3D physics simulations.
Inherited Members
Namespace: Genesis.Physics
Assembly: Genesis.dll
Syntax
public abstract class TriggerBehavior3D : PhysicsBehavior
Constructors
TriggerBehavior3D(PhysicHandler)
Initializes a new instance of the TriggerBehavior3D class with the specified physics handler.
Declaration
public TriggerBehavior3D(PhysicHandler physicHandler)
Parameters
Type | Name | Description |
---|---|---|
PhysicHandler | physicHandler | The physics handler to associate with this 3D trigger behavior. |
Properties
Offset
Gets or sets the offset of the trigger from its parent's location.
Declaration
public Vec3 Offset { get; set; }
Property Value
Type | Description |
---|---|
Vec3 |
PhysicHandler
Gets or sets the physics handler associated with this 3D trigger behavior.
Declaration
public PhysicHandler PhysicHandler { get; set; }
Property Value
Type | Description |
---|---|
PhysicHandler | The PhysicHandler instance associated with this 3D trigger behavior. |
Trigger
Gets or sets the ghost object representing the trigger.
Declaration
public GhostObject Trigger { get; set; }
Property Value
Type | Description |
---|---|
GhostObject |
Methods
CreateTrigger()
Creates the trigger associated with this behavior.
Declaration
public abstract void CreateTrigger()
GetPhysicsObject()
Retrieves the physics object associated with this trigger.
Declaration
public override object GetPhysicsObject()
Returns
Type | Description |
---|---|
object | The physics object associated with this trigger. |
Overrides
GetPhysicsObject<T>()
Retrieves the physics object associated with this trigger, cast to the specified type.
Declaration
public override T GetPhysicsObject<T>()
Returns
Type | Description |
---|---|
T | The physics object associated with this trigger, cast to the specified type. |
Type Parameters
Name | Description |
---|---|
T | The type to cast the physics object to. |
Overrides
OnDestroy(Game, GameElement)
Called when destroying the trigger.
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)
Called when initializing the trigger.
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)
Called when rendering the trigger.
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)
Called when updating the game state.
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 trigger 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 trigger 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 trigger 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 trigger 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. |