Skip to content

Commit

Permalink
bugfix: MutableCompoundShapeTest needs a better random-number engine
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jan 14, 2025
1 parent 0c3aa25 commit c336444
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2024 Stephen Gold
Copyright (c) 2024-2025 Stephen Gold
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -105,7 +105,8 @@ public void PrePhysicsUpdate(PreUpdateParams inParams)
shape.modifyShapes(0, count, mPosition, mRotation, 32, 32);

// Initialize frame dependent random number generator
DefaultRandomEngine frame_random=new DefaultRandomEngine(mFrameNumber++);
// Note: Explicitly using the Mersenne Twister random generator as on some platforms you get the seed back as the first random number
Mt19937 frame_random=new Mt19937(mFrameNumber++);

// Roll the dice
float roll = roll_distribution.nextFloat(frame_random);
Expand Down

0 comments on commit c336444

Please sign in to comment.