![]() |
Colliding Shapes
Ian Parberry's "Introduction to Game Physics"
|
Arc descriptor. More...
#include <Arc.h>
Public Member Functions | |
| CArcDesc () | |
| Constructor. More... | |
| CArcDesc (const Vector2 &, float, float, float, float=1.0f) | |
| Constructor. More... | |
| void | SetAngles (float, float) |
| Set the angles. More... | |
| void | GetEndPts (Vector2 &, Vector2 &) |
| Get end points. More... | |
| float | GetAngle0 () |
| Get angle 0. More... | |
| float | GetAngle1 () |
| Get angle 1. More... | |
Public Member Functions inherited from CCircleDesc | |
| CCircleDesc () | |
| Constructor. More... | |
| CCircleDesc (const Vector2 &, float, float=1.0f) | |
| Constructor. More... | |
Public Member Functions inherited from CShapeDesc | |
| CShapeDesc (eShape) | |
| Constructor. More... | |
| CShapeDesc () | |
| Default constructor. More... | |
Private Attributes | |
| Vector2 | m_vPt0 |
| Point 0. | |
| Vector2 | m_vPt1 |
| Point 1. | |
| float | m_fAngle0 = 0.0f |
| Angle from center to point 0. | |
| float | m_fAngle1 = 0.0f |
| Angle from center to point 1. | |
| Vector2 | m_vTangent0 |
| Tangent at point 0. | |
| Vector2 | m_vTangent1 |
| Tangent at point 1. | |
Additional Inherited Members | |
Public Attributes inherited from CCircleDesc | |
| float | m_fRadius = 0.0f |
| Radius. | |
Public Attributes inherited from 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. |
| float CArcDesc::GetAngle0 | ( | ) |
Reader function for angle 0.
| float CArcDesc::GetAngle1 | ( | ) |
Reader function for angle 1.
| void CArcDesc::GetEndPts | ( | Vector2 & | p0, |
| Vector2 & | p1 | ||
| ) |
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 normalzie them first.
| a0 | The first angle. |
| a1 | The second angle. |
1.8.14