![]() |
The Shapes Library
Game Physics with Bespoke Code
|
Arc descriptor. More...
#include <Arc.h>


Public Member Functions | |
| CArcDesc () | |
| Constructor. | |
| CArcDesc (const Vector2 &, float, float, float, float=1.0f) | |
| Constructor. | |
| void | SetAngles (float, float) |
| Set the angles. | |
| void | GetEndPts (Vector2 &, Vector2 &) const |
| Get end points. | |
| const float | GetAngle0 () const |
| Get angle 0. | |
| const float | GetAngle1 () const |
| Get angle 1. | |
Public Member Functions inherited from Shapes::CCircleDesc | |
| CCircleDesc () | |
| Constructor. | |
| CCircleDesc (const Vector2 &, float, float=1.0f) | |
| Constructor. | |
Public Member Functions inherited from Shapes::CShapeDesc | |
| CShapeDesc (eShape) | |
| Constructor. | |
| CShapeDesc () | |
| Default constructor. | |
Additional Inherited Members | |
Public Attributes inherited from Shapes::CCircleDesc | |
| float | m_fRadius = 0.0f |
| Radius. | |
Public Attributes inherited from Shapes::CShapeDesc | |
| eShape | m_eShapeType = eShape::Unknown |
| Type of shape. | |
| Vector2 | m_vPos |
| Position. | |
| float | m_fElasticity = 1.0f |
| Elasticity, aka restitution, bounciness. | |
| eMotion | m_eMotionType = eMotion::Static |
| How shape moves. | |
| bool | m_bIsSensor = false |
| Sensor only, no rebound. | |
The arc descriptor describes an arc shape.
| CArcDesc::CArcDesc | ( | ) |
The default contructor creates an arc descriptor whose angles are zero.
| CArcDesc::CArcDesc | ( | const Vector2 & | p0, |
| float | r, | ||
| float | a0, | ||
| float | a1, | ||
| float | e = 1.0f ) |
This constructor creates an arc descriptor given the arc's center, radius, angles, and elasticity.
| p0 | Position of center. |
| r | Radius. |
| a0 | First angle. |
| a1 | Second angle. |
| e | Elasticity. |
| const float CArcDesc::GetAngle0 | ( | ) | const |
Reader function for angle 0.
| const float CArcDesc::GetAngle1 | ( | ) | const |
Reader function for angle 1.
| void CArcDesc::GetEndPts | ( | Vector2 & | p0, |
| Vector2 & | p1 ) const |
Calculate the end points from the arc center, angles, and radius. Assumes that these values have already been set.
| p0 | [out] An end point. |
| p1 | [out] Another end point. |
| void CArcDesc::SetAngles | ( | float | a0, |
| float | a1 ) |
Set the arc descriptor's angles, making sure to normalize them first.
| a0 | The first angle. |
| a1 | The second angle. |
