Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpUnitMotion_System.cpp
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | if (!it->second.cmpPosition->IsInWorld()) | ||||
it->second.needUpdate = false; | it->second.needUpdate = false; | ||||
continue; | continue; | ||||
} | } | ||||
else | else | ||||
it->second.cmpUnitMotion->PreMove(it->second); | it->second.cmpUnitMotion->PreMove(it->second); | ||||
it->second.initialPos = it->second.cmpPosition->GetPosition2D(); | it->second.initialPos = it->second.cmpPosition->GetPosition2D(); | ||||
it->second.initialAngle = it->second.cmpPosition->GetRotation().Y; | it->second.initialAngle = it->second.cmpPosition->GetRotation().Y; | ||||
it->second.pos = it->second.initialPos; | it->second.pos = it->second.initialPos; | ||||
it->second.speed = it->second.cmpUnitMotion->GetCurrentSpeed(); | |||||
it->second.angle = it->second.initialAngle; | it->second.angle = it->second.initialAngle; | ||||
ENSURE(it->second.pos.X.ToInt_RoundToZero() / PUSHING_GRID_SIZE < m_MovingUnits.width() && | ENSURE(it->second.pos.X.ToInt_RoundToZero() / PUSHING_GRID_SIZE < m_MovingUnits.width() && | ||||
it->second.pos.Y.ToInt_RoundToZero() / PUSHING_GRID_SIZE < m_MovingUnits.height()); | it->second.pos.Y.ToInt_RoundToZero() / PUSHING_GRID_SIZE < m_MovingUnits.height()); | ||||
std::vector<EntityMap<MotionState>::iterator>& subdiv = m_MovingUnits.get( | std::vector<EntityMap<MotionState>::iterator>& subdiv = m_MovingUnits.get( | ||||
it->second.pos.X.ToInt_RoundToZero() / PUSHING_GRID_SIZE, | it->second.pos.X.ToInt_RoundToZero() / PUSHING_GRID_SIZE, | ||||
it->second.pos.Y.ToInt_RoundToZero() / PUSHING_GRID_SIZE | it->second.pos.Y.ToInt_RoundToZero() / PUSHING_GRID_SIZE | ||||
); | ); | ||||
subdiv.emplace_back(it); | subdiv.emplace_back(it); | ||||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator