Skip to content

Commit

Permalink
try 02
Browse files Browse the repository at this point in the history
  • Loading branch information
erincatto committed Aug 27, 2024
1 parent a7eb565 commit 570373f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions samples/sample_determinism.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FallingHinges : public Sample
enum
{
e_columns = 4,
e_rows = 30,
e_rows = 10,
};

explicit FallingHinges( Settings& settings )
Expand Down Expand Up @@ -46,7 +46,8 @@ class FallingHinges : public Sample
}

float h = 0.25f;
float r = 0.1f * h;
float r = 0.0f;
//0.1f * h;
b2Polygon box = b2MakeRoundedBox( h - r, h - r, r );

b2ShapeDef shapeDef = b2DefaultShapeDef();
Expand Down Expand Up @@ -132,6 +133,7 @@ class FallingHinges : public Sample
for ( int i = 0; i < bodyCount; ++i )
{
b2Transform xf = b2Body_GetTransform( m_bodies[i] );
printf( "%d %.9f %.9f %.9f %.9f\n", i, xf.p.x, xf.p.y, xf.q.c, xf.q.s );
m_hash = b2Hash( m_hash, reinterpret_cast<uint8_t*>( &xf ), sizeof( b2Transform ) );
}

Expand Down
2 changes: 1 addition & 1 deletion src/constraint_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// cause horrible cache stalls. To make this feasible I would need a way to block these writes.

// This is used for debugging by making all constraints be assigned to overflow.
#define B2_FORCE_OVERFLOW 0
#define B2_FORCE_OVERFLOW 1

_Static_assert( b2_graphColorCount == 12, "graph color count assumed to be 12" );

Expand Down

0 comments on commit 570373f

Please sign in to comment.