MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / getAngleSide

Function getAngleSide

source/game/StarGameTypes.cpp:84–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84pair<float, Direction> getAngleSide(float angle, bool ccRotation) {
85 angle = constrainAngle(angle);
86 Direction direction = Direction::Right;
87 if (angle > Constants::pi / 2) {
88 direction = Direction::Left;
89 angle = Constants::pi - angle;
90 } else if (angle < -Constants::pi / 2) {
91 direction = Direction::Left;
92 angle = -Constants::pi - angle;
93 }
94
95 if (direction == Direction::Left && ccRotation)
96 angle *= -1;
97
98 return make_pair(angle, direction);
99}
100
101}

Callers 7

damageSourcesMethod · 0.85
renderMethod · 0.85
tickSharedMethod · 0.85
updateMethod · 0.85
getAngleMethod · 0.85

Calls 1

constrainAngleFunction · 0.85

Tested by

no test coverage detected