![]() |
Ball and Spring Toy
Ian Parberry's "Introduction to Game Physics"
|
The wheel. More...
#include <Wheel.h>
Public Member Functions | |
| CWheel (UINT, float, float, Vector2) | |
| Constructor. More... | |
Public Member Functions inherited from CBody | |
| void | DeliverImpulse (float) |
| Deliver impulse to body. More... | |
| void | Teleport (const Vector2 &) |
| Magically teleport body by this amount. More... | |
| void | draw () |
| Draw body. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CBody | |
| CPoint * | CreatePoint (eSprite, const Vector2 &) |
| Create point. More... | |
| CSpring * | CreateSpring (eSprite, CPoint *, CPoint *, float=1.0f) |
| Create spring. More... | |
Protected Attributes inherited from CBody | |
| std::vector< CPoint * > | m_stdPt |
| Vector of pointers to points in this body. | |
| std::vector< CSpring * > | m_stdSpr |
| Vector of pointers to springs. | |
Static Protected Attributes inherited from CCommon | |
| static CRenderer * | m_pRenderer = nullptr |
| Pointer to the renderer. | |
| static CObjectManager * | m_pObjectManager = nullptr |
| Pointer to the object manager. | |
| static eBody | m_eCurrentBody = (eBody)0 |
| Current body type. | |
A wheel is a body that consists of n points laid out in a circle to form the circumference, and a central point acting as a hub. The points on the circumference are evenly spaced and each is connected to the next in a circle. All points on the circumference are connected to the hub. This is more like an n-gon than a wheel, but the presence of the hub makes it seem more wheel-like. It certainly rolls like a wheel and if I want to call it a wheel, I can, dammit.
| CWheel::CWheel | ( | UINT | n, |
| float | r, | ||
| float | s, | ||
| Vector2 | v | ||
| ) |
Make a cross-braced wheel of points connected by springs to a central hub.
| n | Number of sides. |
| r | Radius. |
| s | Coefficient of restitution of the springs. |
| v | Location of center. |