MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetPositionOffset

Method GetPositionOffset

TombEngine/Game/Hud/TargetHighlighter.cpp:41–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 Vector2 CrosshairData::GetPositionOffset(short orientOffset) const
42 {
43 constexpr auto ANGLE_OFFSET = ANGLE(-360.0f / (SEGMENT_COUNT * 2));
44
45 float offsetDist = GetRadius();
46 auto relPosOffset = Vector2(offsetDist, 0.0f);
47 auto rotMatrix = Matrix::CreateRotationZ(TO_RAD((Orientation + orientOffset) + ANGLE_OFFSET));
48
49 auto posOffset = Vector2::Transform(relPosOffset, rotMatrix);
50 return GetAspectCorrect2DPosition(posOffset);
51 }
52
53 void CrosshairData::SetPrimary()
54 {

Callers 1

AddCrosshairMethod · 0.80

Calls 4

ANGLEFunction · 0.85
TO_RADFunction · 0.85
Vector2Function · 0.50

Tested by

no test coverage detected