Const AdvancedComposes the two D8 operations.
Taking ^ as reflection:
| E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 | |
|---|---|---|---|---|---|---|---|---|
| E=0 | E | S | W | N | E^ | S^ | W^ | N^ |
| S=2 | S | W | N | E | S^ | W^ | N^ | E^ |
| W=4 | W | N | E | S | W^ | N^ | E^ | S^ |
| N=6 | N | E | S | W | N^ | E^ | S^ | W^ |
| E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |
| S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |
| W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |
| N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |
[This is a Cayley table]https://en.wikipedia.org/wiki/Cayley_table
Approximates the vector V(dx,dy) into one of the
eight directions provided by groupD8.
| Rotation | Direction |
|---|---|
| 0° | East |
Checks if the rotation angle is vertical, i.e. south or north. It doesn't work for reflections.
Reflection about the main diagonal.
Helps sprite to compensate texture packer rotation.
Reflection about X-axis.
Reflection about Y-axis.
| Rotation | Direction |
|---|---|
| -90°/270°↻ | North |
| Rotation | Direction |
|---|---|
| -45°/315°↻ | Northeast |
| Rotation | Direction |
|---|---|
| -135°/225°↻ | Northwest |
Reflection about reverse diagonal.
Adds 180 degrees to rotation, which is a commutative operation.
| Rotation | Direction |
|---|---|
| 90°↻ | South |
| Rotation | Direction |
|---|---|
| 45°↻ | Southeast |
Reverse of add.
| Rotation | Direction |
|---|---|
| 135°↻ | Southwest |
Transforms rectangle coordinates based on texture packer rotation. Used when texture atlas pages are rotated and coordinates need to be adjusted.
| Rotation | Direction |
|---|---|
| 180° | West |
Implements the dihedral group D8, which is similar to [group D4]http://mathworld.wolfram.com/DihedralGroupD4.html; D8 is the same but with diagonals, and it is used for texture rotations.
The directions the U- and V- axes after rotation of an angle of
a: GD8Constantare the vectors(uX(a), uY(a))and(vX(a), vY(a)). These aren't necessarily unit vectors.