MCPcopy Create free account
hub / github.com/aardappel/lobster / ApplyLinearImpulse

Method ApplyLinearImpulse

dev/include/Box2D/Particle/b2ParticleSystem.cpp:4480–4490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4478}
4479
4480void b2ParticleSystem::ApplyLinearImpulse(int32 firstIndex, int32 lastIndex,
4481 const b2Vec2& impulse)
4482{
4483 const float32 numParticles = (float32)(lastIndex - firstIndex);
4484 const float32 totalMass = numParticles * GetParticleMass();
4485 const b2Vec2 velocityDelta = impulse / totalMass;
4486 for (int32 i = firstIndex; i < lastIndex; i++)
4487 {
4488 m_velocityBuffer.data[i] += velocityDelta;
4489 }
4490}
4491
4492void b2ParticleSystem::QueryAABB(b2QueryCallback* callback,
4493 const b2AABB& aabb) const

Callers 5

SolvePressureMethod · 0.45
SolveDampingMethod · 0.45
SolveRigidDampingMethod · 0.45
SolveExtraDampingMethod · 0.45
SolveViscousMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected