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

Method rotate

source/EngineInterface/Descriptions.cpp:229–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void DataDescription::rotate(float angle)
230{
231 auto rotationMatrix = Math::calcRotationMatrix(angle);
232 auto center = calcCenter();
233
234 auto rotate = [&](RealVector2D& pos) {
235 auto relPos = pos - center;
236 auto rotatedRelPos = rotationMatrix * relPos;
237 pos = center + rotatedRelPos;
238 };
239 for (auto& cell : cells) {
240 rotate(cell.pos);
241 }
242 for (auto& particle : particles) {
243 rotate(particle.pos);
244 }
245}
246
247void DataDescription::accelerate(RealVector2D const& velDelta, float angularVelDelta)
248{

Callers 2

gridMultiplyMethod · 0.80
randomMultiplyMethod · 0.80

Calls 1

rotateFunction · 0.85

Tested by

no test coverage detected