The RectangleCollider class represents an axis-aligned rectangular collider defined by a Rectangle structure.
More...
|
|
override Collider | DeepCopy () |
| override bool | ContainsPoint (Vector2 point, out Vector2 closestPoint) |
| | Determines if the given point is contained within the rectangle collider and calculates the closest point on the rectangle to the given point.
|
| override void | Draw (SpriteBatch spriteBatch, PrimitiveBatch primitiveBatch) |
| | Draws the collider.
|
| bool | ContainsPoint (Vector2 point, out Vector2 closestPoint) |
| | Determines if the given point is contained within the collider and calculates the closest point on the collider to the given point. This method is used for collision detection and response, allowing the application to determine if a particle or object is colliding with the collider and to find the nearest point on the collider's surface for accurate physics interactions. The method returns true if the point is inside the collider, and false otherwise, while also providing the closest point on the collider as an output parameter. it outputs the same point if the point is outside the collider, which is used for calculating the collision response direction and magnitude based on how far the point is from the collider's surface.
|
| Collider | DeepCopy () |
| | Creates a deep copy of the collider,.
|
|
|
Rectangle | Rectangle = rectangle |
| | the rectangle that defines the bounds of the rectangle collider
|
|
|
virtual Vector2 | Position [get, set] |
| | the position of the collider
|
The RectangleCollider class represents an axis-aligned rectangular collider defined by a Rectangle structure.
- Parameters
-
◆ ContainsPoint()
| override bool PhysicsCSAlevlProject.RectangleCollider.ContainsPoint |
( |
Vector2 | point, |
|
|
out Vector2 | closestPoint ) |
|
inline |
Determines if the given point is contained within the rectangle collider and calculates the closest point on the rectangle to the given point.
- Parameters
-
- Returns
◆ Draw()
| override void PhysicsCSAlevlProject.RectangleCollider.Draw |
( |
SpriteBatch | spriteBatch, |
|
|
PrimitiveBatch | primitiveBatch ) |
|
inlinevirtual |
The documentation for this class was generated from the following file:
- PhysicsCSAlevlProject/Objects.Colliders.cs