The SeperatedAxisRectangleCollider class represents a rectangle collider that can be rotated and uses the Separating Axis Theorem (SAT) for collision detection.
More...
|
|
override Collider | DeepCopy () |
|
| SeperatedAxisRectangleCollider (Rectangle rectangle, float angle) |
|
override bool | ContainsPoint (Vector2 point, out Vector2 closestPoint) |
| override void | Draw (SpriteBatch spriteBatch, PrimitiveBatch primitiveBatch) |
| | Draws the collider.
|
|
override Collider | DeepCopy () |
|
| PolygonSeperatedAxisCollider (Vector2[] vertices) |
|
override bool | ContainsPoint (Vector2 point, out Vector2 closestPoint) |
| 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,.
|
|
|
float | HalfWidth |
| | the half width of the rectangle collider used for calculating the vertices and axes of the rectangle
|
|
float | HalfHeight |
| | the half height of the rectangle collider used for calculating the vertices and axes of the rectangle
|
|
Vector2[] | Vertices |
| | the vertices of the polygon collider defined in local space
|
|
Vector2[] | worldVertices |
| | the vertices of the polygon collider defined in world space
|
|
|
Vector2[] | Axis = new Vector2[4] [get, private set] |
| | all of the axes of the rectangle collider, which are used for collision detection using the Separating Axis Theorem (SAT)
|
|
override Vector2 | Position [get, set] |
| | the position of the rectangle collider, which is the center point of the rectangle. When the position is set, it updates the position of the rectangle used for drawing and recalculates the vertices and axes of the rectangle based on the new position.
|
|
float | Angle [get, set] |
| | the angle of the rectangle collider in radians, which determines the rotation of the rectangle. When the angle is set, it updates the rotation of the rectangle used for drawing and recalculates the vertices and axes of the rectangle based on the new angle.
|
|
override Vector2 | Position [get, set] |
| | the position of the polygon collider, which is the center point of the polygon. When the position is set, it updates the position of the polygon used for drawing and recalculates the vertices and axes of the polygon based on the new position.
|
|
float | angle [get, set] |
| | the angle of the polygon collider in radians, which determines the rotation of the polygon. When the angle is set, it updates the rotation of the polygon used for drawing and recalculates the vertices and axes of the polygon based on the new angle.
|
|
virtual Vector2 | Position [get, set] |
| | the position of the collider
|
|
|
void | SetAxis () |
| | recreates the axes and vertices of the rectangle collider based on the current angle and half width and half height of the rectangle.
|
|
|
Vector2 | _position |
| | the position of the rectangle collider, which is the center point of the rectangle
|
|
PrimitiveBatch.Rectangle | rectangleDraw |
| | the rectangle used for drawing the collider
|
The SeperatedAxisRectangleCollider class represents a rectangle collider that can be rotated and uses the Separating Axis Theorem (SAT) for collision detection.
◆ Draw()
| override void PhysicsCSAlevlProject.SeperatedAxisRectangleCollider.Draw |
( |
SpriteBatch | spriteBatch, |
|
|
PrimitiveBatch | primitiveBatch ) |
|
inlinevirtual |
The documentation for this class was generated from the following file:
- PhysicsCSAlevlProject/Objects.Colliders.cs