Class: GroupD8

Tiny. GroupD8

new Tiny.GroupD8()

Implements Dihedral Group D_8, see group D4, D8 is the same but with diagonals. Used for texture rotations.

Vector xX(i), xY(i) is U-axis of sprite with rotation i
Vector yY(i), yY(i) is V-axis of sprite with rotation i
Rotations: 0 grad (0), 90 grad (2), 180 grad (4), 270 grad (6)
Mirrors: vertical (8), main diagonal (10), horizontal (12), reverse diagonal (14)
This is the small part of gameofbombs.com portal system. It works.

Author:
  • Ivan @ivanpopelyshev

Methods

staticTiny.GroupD8.byDirection(dx, dy){number}

Name Type Description
dx number

TODO

dy number

TODO

Returns:
Type Description
number TODO

staticTiny.GroupD8.isVertical(rotation){boolean}

Direction of main vector can be horizontal, vertical or diagonal.
Some objects work with vertical directions different.

Name Type Description
rotation number

The number to check.

Version:
  • 1.2.0
Returns:
Type Description
boolean Whether or not the direction is vertical

staticTiny.GroupD8.matrixAppendRotationInv(matrix, rotation, tx, ty)

Helps sprite to compensate texture packer rotation.

Name Type Description
matrix Tiny.Matrix

sprite world matrix

rotation number

The rotation factor to use.

tx number

sprite anchoring

ty number

sprite anchoring

staticTiny.GroupD8.rotate180(rotation){number}

Adds 180 degrees to rotation. Commutative operation.

Name Type Description
rotation number

The number to rotate.

Returns:
Type Description
number rotated number
Documentation generated by JSDoc 3.4.3 on Fri Jul 09 2021 19:32:26 GMT+0800 (CST)