![]() |
Box2D Binary Counter
Ian Parberry's "Introduction to Game Physics"
|
Binary counter. More...
#include <Counter.h>
Public Member Functions | |
| CCounter (float, float, int) | |
| Constructor. More... | |
| ~CCounter () | |
| Destructor. | |
| int | GetBitCount () |
| Get number of bits. More... | |
| Vector2 | GetPos (int) |
| Get position of a single-bit counter. More... | |
Private Attributes | |
| CBitCounter ** | m_pBitCounter = nullptr |
| Array of pointers to single-bit counters. | |
| int | m_nNumBits = 0 |
| Number of single-bit counters. | |
Binary counter.
A multi-bit counter in Physics World, which is essentially made up of an array of single-bit counters.
| CCounter::CCounter | ( | float | x, |
| float | y, | ||
| int | n | ||
| ) |
Constructor.
| x | X-coordinate of least-significant bit counter. |
| y | Y-coordinate of least-significant bit counter. |
| n | Number of bit counters |
| int CCounter::GetBitCount | ( | ) |
Get number of bits.
Reader function for the number of bits.
| Vector2 CCounter::GetPos | ( | int | n | ) |
Get position of a single-bit counter.
Reader function for the position of a bit counter in Render World coordinates.
| n | Index of the required bit. |