forked from kripken/ammo.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: wasm addFunction tests (kripken#332)
* Migrates tests to global Ammo, initialized once per file Fixes concurrency issues when testing wasm ammo * Provide some addFunction wasm signature constants * Adds a test helper to create discrete dynamics worlds * Adds test coverage for all contact callbacks * Builds and tests addFunction in the ci workflow * Enables Ammo.addFunction by default * Removes addFunction detection and test skipping * Replaces RESERVED_FUNCTION_POINTERS with ALLOW_TABLE_GROWTH
- Loading branch information
Showing
13 changed files
with
174 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
Module['CONTACT_ADDED_CALLBACK_SIGNATURE'] = 'iiiiiiii'; | ||
Module['CONTACT_DESTROYED_CALLBACK_SIGNATURE'] = 'ii'; | ||
Module['CONTACT_PROCESSED_CALLBACK_SIGNATURE'] = 'iiii'; | ||
Module['INTERNAL_TICK_CALLBACK_SIGNATURE'] = 'vif'; | ||
|
||
// Reassign global Ammo to the loaded module: | ||
this['Ammo'] = Module; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function createDiscreteDynamicsWorld() { | ||
const collisionConfiguration = new Ammo.btDefaultCollisionConfiguration() | ||
const dispatcher = new Ammo.btCollisionDispatcher(collisionConfiguration) | ||
const broadphase = new Ammo.btDbvtBroadphase() | ||
const solver = new Ammo.btSequentialImpulseConstraintSolver() | ||
const world = new Ammo.btDiscreteDynamicsWorld( | ||
dispatcher, | ||
broadphase, | ||
solver, | ||
collisionConfiguration | ||
) | ||
return world | ||
} | ||
|
||
module.exports = createDiscreteDynamicsWorld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters