Green Rock Engine 0
|
Public Member Functions | |
CollisionSystem (Game game) | |
override void | Update (GameTime gameTime) |
bool | AABBOverlap (AABB a, AABB b) |
Tests whether two AABB's overlap. | |
AABB | GetCombinedAABBRegion (AABB a, AABB b) |
Creates a new AABB that represents the AABB that the two given AABB's cover (AABB Union) | |
AABB | GetAABBOverlapRegion (AABB a, AABB b) |
Creates a new AABB that represents where 2 given AABB's overlap (AABB Intersection) | |
bool | PointIsInAABB (PointF p, AABB aabb) |
bool | LinesSegmentsOverlap (PointF a1, PointF a2, PointF b1, PointF b2) |
Checks whether the AABB's of two line segments overlap (hence potential intersection) | |
bool | LinesCanIntersect (Line l1, Line l2) |
This simply checks if two Lines can intersect since their gradients are not the same. | |
PointF | LineIntersectionPoint (Line l1, Line l2) |
Will take two lines that will intersect, and finds their intersection point. | |
bool | IntersectionIsWithinLineSegments (PointF intersection, PointF a1, PointF a2, PointF b1, PointF b2) |
Checks whether passed in point falls between the bounds of both lines to ensure that an intersection occurred inside the segments. | |
bool | LineCanIntersectCircle (PointF p1, PointF p2, PointF c, float r) |
Return whether a line segment intersect a circle in TWO PLACES. | |
List< PointF > | LineIntersectsCircle (PointF p1, PointF p2, PointF c, float r) |
void | AddCollisionObject (Collider obj) |
void | RemoveCollisionObject (Collider obj) |
HashSet< Collider > | GetColliderObjects () |
bool | PointIsCollidingWithLayer (PointF point, string layer) |
List< Collider > | GetCollidersOfLayer (string layer) |
Raycast2DResult | Raycast2D (PointF origin, Vector2 direction, float distance, List< string > layers) |
Casts a ray from a point in given direction for given distance. Will stop at the first collider hit. | |
Tests whether two AABB's overlap.
a | |
b |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Implements GREngine.Core.Physics2D.ICollisionSystem.
Creates a new AABB that represents where 2 given AABB's overlap (AABB Intersection)
a | |
b |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Implements GREngine.Core.Physics2D.ICollisionSystem.
Creates a new AABB that represents the AABB that the two given AABB's cover (AABB Union)
a | |
b |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Checks whether passed in point falls between the bounds of both lines to ensure that an intersection occurred inside the segments.
///
intersection | |
a1 | Origin of line 1 |
a2 | end of line 1 |
b1 | Origin of line 2 |
b2 | end of line 2 |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Return whether a line segment intersect a circle in TWO PLACES.
p1 | |
p2 | |
c | |
r |
Will take two lines that will intersect, and finds their intersection point.
l1 | Primary Line |
l2 | Other colliders line |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Implements GREngine.Core.Physics2D.ICollisionSystem.
This simply checks if two Lines can intersect since their gradients are not the same.
l1 | Primary Line |
l2 | Other colliders line |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Checks whether the AABB's of two line segments overlap (hence potential intersection)
a1 | Origin of line 1 |
a2 | end of line 1 |
b1 | Origin of line 2 |
b2 | end of line 2 |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Casts a ray from a point in given direction for given distance. Will stop at the first collider hit.
origin | Point the raycast starts |
direction | direction in which it is cast |
distance | max distance the ray will extend |
layers | the layers the ray is allowed to collide with |
Implements GREngine.Core.Physics2D.ICollisionSystem.
|
inline |
Implements GREngine.Core.Physics2D.ICollisionSystem.