MCPcopy Create free account
hub / github.com/chrxh/alien / correctPosition

Method correctPosition

source/EngineInterface/SpaceCalculator.cpp:41–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void SpaceCalculator::correctPosition(RealVector2D& pos) const
42{
43 auto intPart = toIntVector2D(pos);
44 auto fracPart = RealVector2D{pos.x - toFloat(intPart.x), pos.y - toFloat(intPart.y)};
45 correctIntPosition(intPart, _worldSize);
46 pos = {static_cast<float>(intPart.x) + fracPart.x, static_cast<float>(intPart.y) + fracPart.y};
47}
48
49RealVector2D SpaceCalculator::getCorrectedPosition(RealVector2D const& pos) const
50{

Callers

nothing calls this directly

Calls 3

toIntVector2DFunction · 0.85
toFloatFunction · 0.85
correctIntPositionFunction · 0.85

Tested by

no test coverage detected