Green Rock Engine 0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Events | List of all members
GREngine.Core.Physics2D.Collider Class Referenceabstract
Inheritance diagram for GREngine.Core.Physics2D.Collider:
Inheritance graph
[legend]
Collaboration diagram for GREngine.Core.Physics2D.Collider:
Collaboration graph
[legend]

Public Member Functions

delegate void TriggerEvent (Collider collidedWith)
 
delegate void CollisionEvent (Collider collidedWith)
 
 Collider (Vector2 offset, string layer, bool debug)
 
 Collider (string layer, bool debug)
 
 Collider (bool debug)
 
 Collider (Vector2 offset, bool debug)
 
void updatePosition (float dt)
 
void SetVelocity (Vector2 externalVelocity)
 
void accelerate (Vector2 acc)
 
Vector2 GetOldPosition ()
 
Vector2 GetLocalNodePosition ()
 Gets local position from the node as a Vector2 This method is used for velocity.
 
Vector2 GetGlobalColliderPosition ()
 Gets global position from the node as a Vector2 This method is used for collision detection.
 
void SetNodePosition (Vector2 position)
 Sets the position of the Node.
 
Vector2 GetOffset ()
 
void SetOffset (Vector2 offset)
 
float GetRotation ()
 
void SetRotation (float r)
 
AABB GetAABB ()
 
void SetStatic (bool b)
 
bool IsStatic ()
 
void SetTrigger (bool b)
 
bool IsTrigger ()
 
void SetLayer (string layer)
 
string GetLayer ()
 
bool IsAABBOverlapping ()
 
void SetAABBOverlapping (bool b)
 
void SetAllowedCollisionLayers (List< string > layers)
 Pass in a list of layers with which this collider should be able to collide with.
 
List< string > GetAllowedCollisionLayers ()
 
void SolveCollisions (List< Collider > others)
 
void SolveCollision (Collider other, Vector2 velocity)
 
void SolveCollision (PolygonCollider other, Vector2 velocity)
 
void SolveCollision (CircleCollider other, Vector2 velocity)
 
bool PointInsideCollider (PointF point)
 
void CalculateAABB ()
 Each subclass will have its own method of calculating its AABB.
 
virtual void DrawDebug ()
 Define how to draw the verlet object for debugging (eg, draw the collider outline)
 
- Public Member Functions inherited from GREngine.Core.System.Behaviour
override void SetEnabled (bool state)
 
int CompareTo (Behaviour? other)
 
- Public Member Functions inherited from GREngine.Core.System.AbstractGameObject
delegate void EnabledChanged (bool state)
 
bool HasTag (string tag)
 

Protected Member Functions

override void OnAwake ()
 
override void OnStart ()
 
override void OnDestroy ()
 
override void OnUpdate (GameTime gameTime)
 
void SetAABB (AABB aabb)
 
void FireCorrectEvent (Vector2 collisionVector, Collider other)
 
void FireTriggerEnter (Vector2 collisionVector, Collider other)
 
void FireCollisionEnter (Vector2 collisionVector, Collider other)
 
- Protected Member Functions inherited from GREngine.Core.System.Behaviour
virtual void OnFixedUpdate (GameTime gameTime)
 

Protected Attributes

ICollisionSystem collisionSystem
 
- Protected Attributes inherited from GREngine.Core.System.Behaviour
readonly uint InstanceID
 
- Protected Attributes inherited from GREngine.Core.System.AbstractGameObject
readonly HashSet< string > Tags = new()
 

Properties

bool Debug = false [get, set]
 
float VelocityDampingMultiplier = 1 [get, set]
 
Vector2 Velocity [get, set]
 
- Properties inherited from GREngine.Core.System.Behaviour
Game Game [get, set]
 
NodeNode [get, set]
 
- Properties inherited from GREngine.Core.System.AbstractGameObject
bool Enabled = true [get]
 
string Name = "Generic Object" [get, protected set]
 

Events

TriggerEvent? OnTriggerEnter
 
CollisionEvent? OnCollisionEnter
 
- Events inherited from GREngine.Core.System.AbstractGameObject
EnabledChanged? EnabledChangedEvent
 

Member Function Documentation

◆ DrawDebug()

virtual void GREngine.Core.Physics2D.Collider.DrawDebug ( )
inlinevirtual

Define how to draw the verlet object for debugging (eg, draw the collider outline)

Reimplemented in GREngine.Core.Physics2D.CircleCollider, and GREngine.Core.Physics2D.PolygonCollider.

◆ GetGlobalColliderPosition()

Vector2 GREngine.Core.Physics2D.Collider.GetGlobalColliderPosition ( )
inline

Gets global position from the node as a Vector2 This method is used for collision detection.

Returns

◆ OnAwake()

override void GREngine.Core.Physics2D.Collider.OnAwake ( )
inlineprotectedvirtual

Reimplemented from GREngine.Core.System.Behaviour.

◆ OnDestroy()

override void GREngine.Core.Physics2D.Collider.OnDestroy ( )
inlineprotectedvirtual

Reimplemented from GREngine.Core.System.Behaviour.

◆ OnStart()

override void GREngine.Core.Physics2D.Collider.OnStart ( )
inlineprotectedvirtual

Reimplemented from GREngine.Core.System.Behaviour.

◆ OnUpdate()

override void GREngine.Core.Physics2D.Collider.OnUpdate ( GameTime  gameTime)
inlineprotectedvirtual

Reimplemented from GREngine.Core.System.Behaviour.

◆ SetAllowedCollisionLayers()

void GREngine.Core.Physics2D.Collider.SetAllowedCollisionLayers ( List< string >  layers)
inline

Pass in a list of layers with which this collider should be able to collide with.

Parameters
layers

◆ SetNodePosition()

void GREngine.Core.Physics2D.Collider.SetNodePosition ( Vector2  position)
inline

Sets the position of the Node.

Parameters
position

The documentation for this class was generated from the following file: