Class TriggerBehavior
- Namespace
- LibGFX.Physics.Behaviors3D
- Assembly
- LibGFX.dll
public class TriggerBehavior : PhysicsBehavior, IGameBehavior
- Inheritance
-
TriggerBehavior
- Implements
- Derived
- Inherited Members
Constructors
TriggerBehavior(PhysicsHandler)
Creates a new 3D collider
public TriggerBehavior(PhysicsHandler physicsHandler)
Parameters
physicsHandlerPhysicsHandler
Properties
Offset
The offset of the collider
public Vector3 Offset { get; set; }
Property Value
Parent
The parent game element
public GameElement Parent { get; set; }
Property Value
Trigger
The collider object
public GhostObject Trigger { get; set; }
Property Value
- GhostObject
Methods
GetElement()
Gets the GameElement associated with this collider
public override GameElement GetElement()
Returns
GetLocation()
Gets the location of the collider
public Vector3 GetLocation()
Returns
GetPhysicsObject()
Gets the physics object associated with this collider
public override object GetPhysicsObject()
Returns
GetRotation()
Gets the rotation of the collider
public Quaternion GetRotation()
Returns
OnCollide(Collision)
Handles the collision event (unused)
public override void OnCollide(Collision collision)
Parameters
collisionCollision
OnDispose(BaseScene, IRenderDevice)
Disposes the collider
public override void OnDispose(BaseScene scene, IRenderDevice renderer)
Parameters
sceneBaseScenerendererIRenderDevice
OnInit(BaseScene, Viewport, IRenderDevice)
Initializes the collider (unused)
public override void OnInit(BaseScene scene, Viewport viewport, IRenderDevice renderer)
Parameters
sceneBaseSceneviewportViewportrendererIRenderDevice
OnRender(BaseScene, Viewport, IRenderDevice, Camera)
Renders the collider (unused)
public override void OnRender(BaseScene scene, Viewport viewport, IRenderDevice renderer, Camera camera)
Parameters
sceneBaseSceneviewportViewportrendererIRenderDevicecameraCamera
OnUpdate(BaseScene, float)
Updates the collider
public override void OnUpdate(BaseScene scene, float dt)
Parameters
RemoveCollider()
Removes the collider from the physics handler
public virtual void RemoveCollider()
Rotate(Quaternion)
Rotates the collider by the given quaternion
public void Rotate(Quaternion rotation)
Parameters
rotationQuaternion
Rotate(Vector3)
Rotates the collider by the given value
public void Rotate(Vector3 rotation)
Parameters
rotationVector3
SetElement(GameElement)
Sets the game element associated with this collider
public override void SetElement(GameElement gameElement)
Parameters
gameElementGameElement
Sync()
Syncs the trigger with the parent game element
public void Sync()
Translate(Vector3)
Translates the collider by the given value
public void Translate(Vector3 value)
Parameters
valueVector3