C#Code
C#Code
Public Member Functions | Protected Attributes
Libraries.Collision.CircleCollision2D Class Reference
Inheritance diagram for Libraries.Collision.CircleCollision2D:
Libraries.Collision.BaseCollision Libraries.Collision.BaseCollision

List of all members.

Public Member Functions

 CircleCollision2D ()
 CircleCollision2D (Vector2 center, float rad)
bool CollisionTest (CircleCollision2D check)
bool PointInCircleTest (Vector2 point)
bool PointInCircleTest (Vector3 point)
float GetDistSqr (Vector3 point)
float GetDistSqr (CircleCollision2D circle)
float GetRad ()
void SetRad (float rad)
void Set (Vector2 center, float rad)
void Set (Vector3 center, float rad)
void SetCenter (Vector2 center)
void SetCenter (Vector3 center)
 CircleCollision2D ()
 CircleCollision2D (Vector2 center, float rad)
bool CollisionTest (CircleCollision2D check)
bool PointInCircleTest (Vector2 point)
bool PointInCircleTest (Vector3 point)
float GetDistSqr (Vector3 point)
float GetDistSqr (CircleCollision2D circle)
float GetRad ()
void SetRad (float rad)
void Set (Vector2 center, float rad)
void Set (Vector3 center, float rad)
void SetCenter (Vector2 center)
void SetCenter (Vector3 center)

Protected Attributes

Vector2 m_center
 Top left and bottom right corners.
float m_rad
 Radius of the circle.
float m_radSquare
 Precalculated square of the radius.

Detailed Description

2D axis alligned circle collision handling for 3D space. X is increasing going right, Y is increasing going up.


Constructor & Destructor Documentation

Libraries.Collision.CircleCollision2D.CircleCollision2D ( )

Default constructor.

Libraries.Collision.CircleCollision2D.CircleCollision2D ( Vector2  center,
float  rad 
)

Constructor.

topL - Top left corner.
bottomR - Bottom right corner.
Libraries.Collision.CircleCollision2D.CircleCollision2D ( )

Default constructor.

Libraries.Collision.CircleCollision2D.CircleCollision2D ( Vector2  center,
float  rad 
)

Constructor.

topL - Top left corner.
bottomR - Bottom right corner.

Member Function Documentation

bool Libraries.Collision.CircleCollision2D.CollisionTest ( CircleCollision2D  check)

Check for a collision with the given object.

check - Rect to check for a collision with.

Return:
Value is true if a collision was detected, false if not.
bool Libraries.Collision.CircleCollision2D.CollisionTest ( CircleCollision2D  check)

Check for a collision with the given object.

check - Rect to check for a collision with.

Return:
Value is true if a collision was detected, false if not.
float Libraries.Collision.CircleCollision2D.GetDistSqr ( Vector3  point)

Get the squared distance between the circle center and the point.

point - Point to check.

Return:
Value is true if the point is in the circle, false if not.
float Libraries.Collision.CircleCollision2D.GetDistSqr ( CircleCollision2D  circle)

Get the squared distance between the circle centers.

point - Point to check.

Return:
Value is true if the point is in the circle, false if not.
float Libraries.Collision.CircleCollision2D.GetDistSqr ( CircleCollision2D  circle)

Get the squared distance between the circle centers.

point - Point to check.

Return:
Value is true if the point is in the circle, false if not.
float Libraries.Collision.CircleCollision2D.GetDistSqr ( Vector3  point)

Get the squared distance between the circle center and the point.

point - Point to check.

Return:
Value is true if the point is in the circle, false if not.
float Libraries.Collision.CircleCollision2D.GetRad ( )

Get the circle radius.

Return:
Value is the radius of the circle.

float Libraries.Collision.CircleCollision2D.GetRad ( )

Get the circle radius.

Return:
Value is the radius of the circle.

bool Libraries.Collision.CircleCollision2D.PointInCircleTest ( Vector2  point)

Test if a point is in the rectangle.

point - Point to check.

Return:
Value is true if the point is in the circle, false if not.
bool Libraries.Collision.CircleCollision2D.PointInCircleTest ( Vector3  point)

Test if a point is in the rectangle.

point - Point to check.

Return:
Value is true if the point is in the circle, false if not.
bool Libraries.Collision.CircleCollision2D.PointInCircleTest ( Vector2  point)

Test if a point is in the rectangle.

point - Point to check.

Return:
Value is true if the point is in the circle, false if not.
bool Libraries.Collision.CircleCollision2D.PointInCircleTest ( Vector3  point)

Test if a point is in the rectangle.

point - Point to check.

Return:
Value is true if the point is in the circle, false if not.
void Libraries.Collision.CircleCollision2D.Set ( Vector2  center,
float  rad 
)

Set the collision area values.

center - Center of the collision area.
rad - Radius to use.
void Libraries.Collision.CircleCollision2D.Set ( Vector2  center,
float  rad 
)

Set the collision area values.

center - Center of the collision area.
rad - Radius to use.
void Libraries.Collision.CircleCollision2D.Set ( Vector3  center,
float  rad 
)

Set the collision area values.

center - Center of the collision area. Uses the x,y components.
rad - Radius to use.
void Libraries.Collision.CircleCollision2D.Set ( Vector3  center,
float  rad 
)

Set the collision area values.

center - Center of the collision area. Uses the x,y components.
rad - Radius to use.
void Libraries.Collision.CircleCollision2D.SetCenter ( Vector3  center)

Set the center coord of the cirle.

center - Center of the circle. Uses the x,y components.
void Libraries.Collision.CircleCollision2D.SetCenter ( Vector2  center)

Set the center coord of the cirle.

center - Center of the circle.
void Libraries.Collision.CircleCollision2D.SetCenter ( Vector3  center)

Set the center coord of the cirle.

center - Center of the circle. Uses the x,y components.
void Libraries.Collision.CircleCollision2D.SetCenter ( Vector2  center)

Set the center coord of the cirle.

center - Center of the circle.
void Libraries.Collision.CircleCollision2D.SetRad ( float  rad)

Set the radius to the given value. Precalcs the radius squared.

rad - Radius to use.
void Libraries.Collision.CircleCollision2D.SetRad ( float  rad)

Set the radius to the given value. Precalcs the radius squared.

rad - Radius to use.

Member Data Documentation

Top left and bottom right corners.

Radius of the circle.

Precalculated square of the radius.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Properties