- #86
- #88 
- #87 
- #89
This commit is contained in:
Erin Catto 2026-07-24 21:48:23 -07:00 • committed by GitHub
commit 781673be80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 705 additions and 152 deletions

View file

@ -208,15 +208,6 @@ static int sampleRagdollMesh = RegisterSample( "Ragdoll", "Mesh", RagdollOnMesh:
class RagdollPile : public Sample
{
public:
enum
{
#ifdef NDEBUG
e_count = 20
#else
e_count = 8
#endif
};
explicit RagdollPile( SampleContext* context )
: Sample( context )
{
@ -234,10 +225,10 @@ public:
b3CreateMeshShape( groundId, &shapeDef, m_groundMesh, b3Vec3_one );
g_randomSeed = 42;
float a = 0.1f * e_count;
float a = 0.1f * m_count;
b3Vec3 lower = { -a, -a, -a };
b3Vec3 upper = { a, a, a };
for ( int i = 0; i < e_count; ++i )
for ( int i = 0; i < m_count; ++i )
{
b3Vec3 offset = RandomVec3( lower, upper );
b3Pos position = { offset.x, 2.0f, offset.z };
@ -261,8 +252,9 @@ public:
return new RagdollPile( context );
}
static constexpr int m_count = m_isDebug ? 8 : 20;
b3MeshData* m_groundMesh;
Human m_humans[e_count] = {};
Human m_humans[m_count] = {};
};
static int sampleRagdollPile = RegisterSample( "Ragdoll", "Pile", RagdollPile::Create );