![]() |
Box2D Binary Counter
Game Physics with a 2D Physics Engine
|
Binary counter. More...
#include <Counter.h>

Public Member Functions | |
| CCounter (float, float, UINT) | |
| Constructor. | |
| ~CCounter () | |
| Destructor. | |
| const UINT | GetBitCount () const |
| Get number of bits. | |
| const Vector2 | GetPos (UINT) const |
| Get position of a single-bit counter. | |
Private Attributes | |
| CBitCounter ** | m_pBitCounter = nullptr |
| Array of pointers to single-bit counters. | |
| UINT | m_nNumBits = 0ULL |
| Number of single-bit counters. | |
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, | ||
| UINT | n ) |
Constructor.
| x | X-coordinate of least-significant bit counter. |
| y | Y-coordinate of least-significant bit counter. |
| n | Number of bit counters |

| const UINT CCounter::GetBitCount | ( | ) | const |
Reader function for the number of bits.

| const Vector2 CCounter::GetPos | ( | UINT | n | ) | const |
Reader function for the position of a bit in Render World coordinates.
| n | Index of the required bit. |

