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

Method accelerate

source/EngineInterface/Descriptions.cpp:247–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void DataDescription::accelerate(RealVector2D const& velDelta, float angularVelDelta)
248{
249 auto center = calcCenter();
250
251 auto accelerate = [&](RealVector2D const& pos, RealVector2D& vel) {
252 auto relPos = pos - center;
253 vel += Physics::tangentialVelocity(relPos, velDelta, angularVelDelta);
254 };
255 for (auto& cell : cells) {
256 accelerate(cell.pos, cell.vel);
257 }
258 for (auto& particle : particles) {
259 accelerate(particle.pos, particle.vel);
260 }
261}
262
263std::unordered_set<uint64_t> DataDescription::getCellIds() const
264{

Callers 2

gridMultiplyMethod · 0.80
randomMultiplyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected