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

Method ComputeAABB

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

Compute the axis-aligned bounding box for all particles contained within this particle system. @param aabb Returns the axis-aligned bounding box of the system.

Source from the content-addressed store, hash-verified

2338/// within this particle system.
2339/// @param aabb Returns the axis-aligned bounding box of the system.
2340void b2ParticleSystem::ComputeAABB(b2AABB* const aabb) const
2341{
2342 const int32 particleCount = GetParticleCount();
2343 b2Assert(aabb);
2344 aabb->lowerBound.x = +b2_maxFloat;
2345 aabb->lowerBound.y = +b2_maxFloat;
2346 aabb->upperBound.x = -b2_maxFloat;
2347 aabb->upperBound.y = -b2_maxFloat;
2348
2349 for (int32 i = 0; i < particleCount; i++)
2350 {
2351 b2Vec2 p = m_positionBuffer.data[i];
2352 aabb->lowerBound = b2Min(aabb->lowerBound, p);
2353 aabb->upperBound = b2Max(aabb->upperBound, p);
2354 }
2355 aabb->lowerBound.x -= m_particleDiameter;
2356 aabb->lowerBound.y -= m_particleDiameter;
2357 aabb->upperBound.x += m_particleDiameter;
2358 aabb->upperBound.y += m_particleDiameter;
2359}
2360
2361// Associate a memory allocator with this object.
2362FixedSetAllocator::FixedSetAllocator(

Callers 7

ComputeAABBMethod · 0.45
QueryShapeAABBMethod · 0.45
QueryShapeAABBMethod · 0.45
CreateProxiesMethod · 0.45
SynchronizeMethod · 0.45

Calls 2

b2MinFunction · 0.85
b2MaxFunction · 0.85

Tested by

no test coverage detected