Verlet Intergration Soft Body
Loading...
Searching...
No Matches
PhysicsCSAlevlProject.RectangleCollider(Rectangle rectangle) Class Reference

The RectangleCollider class represents an axis-aligned rectangular collider defined by a Rectangle structure. More...

Inheritance diagram for PhysicsCSAlevlProject.RectangleCollider:
PhysicsCSAlevlProject.Collider

Public Member Functions

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.
Public Member Functions inherited from PhysicsCSAlevlProject.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,.

Public Attributes

Rectangle Rectangle = rectangle
 the rectangle that defines the bounds of the rectangle collider

Additional Inherited Members

Properties inherited from PhysicsCSAlevlProject.Collider
virtual Vector2 Position [get, set]
 the position of the collider

Detailed Description

The RectangleCollider class represents an axis-aligned rectangular collider defined by a Rectangle structure.

Parameters
rectangle

Member Function Documentation

◆ 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
point
closestPoint
Returns

◆ Draw()

override void PhysicsCSAlevlProject.RectangleCollider.Draw ( SpriteBatch spriteBatch,
PrimitiveBatch primitiveBatch )
inlinevirtual

Draws the collider.

Parameters
spriteBatch
primitiveBatch

Reimplemented from PhysicsCSAlevlProject.Collider.


The documentation for this class was generated from the following file:
  • PhysicsCSAlevlProject/Objects.Colliders.cs