C# Class Nez.PhysicsShapes.Circle

Inheritance: Shape
Show file Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
radius float

Public Methods

Method Description
Circle ( float radius ) : System
collidesWithLine ( Vector2 start, Vector2 end, RaycastHit &hit ) : bool
collidesWithShape ( Shape other, CollisionResult &result ) : bool
containsPoint ( Vector2 point ) : bool

Gets whether or not the provided point lie within the bounds of this Circle.

containsPoint ( float x, float y ) : bool

Gets whether or not the provided coordinates lie within the bounds of this Circle.

getPointAlongEdge ( float angle ) : Vector2

Gets the point at the edge of this Circle from the provided angle

overlaps ( Shape other ) : bool
pointCollidesWithShape ( Vector2 point, CollisionResult &result ) : bool

Private Methods

Method Description
recalculateBounds ( Collider collider ) : void
recalculateBounds ( float radius, Vector2 position ) : void

internal hack used by Particles so they can reuse a Circle for all collision checks

Method Details

Circle() public method

public Circle ( float radius ) : System
radius float
return System

collidesWithLine() public method

public collidesWithLine ( Vector2 start, Vector2 end, RaycastHit &hit ) : bool
start Vector2
end Vector2
hit RaycastHit
return bool

collidesWithShape() public method

public collidesWithShape ( Shape other, CollisionResult &result ) : bool
other Shape
result CollisionResult
return bool

containsPoint() public method

Gets whether or not the provided point lie within the bounds of this Circle.
public containsPoint ( Vector2 point ) : bool
point Vector2 the point
return bool

containsPoint() public method

Gets whether or not the provided coordinates lie within the bounds of this Circle.
public containsPoint ( float x, float y ) : bool
x float The x coordinate of the point to check for containment.
y float The y coordinate of the point to check for containment.
return bool

getPointAlongEdge() public method

Gets the point at the edge of this Circle from the provided angle
public getPointAlongEdge ( float angle ) : Vector2
angle float an angle in radians
return Vector2

overlaps() public method

public overlaps ( Shape other ) : bool
other Shape
return bool

pointCollidesWithShape() public method

public pointCollidesWithShape ( Vector2 point, CollisionResult &result ) : bool
point Vector2
result CollisionResult
return bool

Property Details

radius public property

public float radius
return float