Skip to content

Commit 0565184

Browse files
committed
Updates
1 parent 555b6ea commit 0565184

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

index.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
fix scale (use world unit)
1818
</label>
1919
<br>
20+
<label>
21+
<input type="checkbox" id="useRapier2d" checked>
22+
use rapier2d
23+
</label>
24+
<br>
2025
<label>
2126
<input type="checkbox" id="fixScalePixel">
2227
fix scale (use pixel unit)
@@ -97,7 +102,7 @@
97102
const fixScalePixel = document.getElementById('fixScalePixel').checked;
98103
const fixFixture = document.getElementById('fixFixture').checked;
99104
const moveUpHalfDepth = document.getElementById('moveUpHalfDepth').checked;
100-
105+
const useRapier2d = document.getElementById('useRapier2d').checked;
101106
const reader = new FileReader();
102107

103108
const { fixScale, removeUnwantedProperties, fixFixture: fixFixtureFn } = window.fixes;
@@ -118,6 +123,11 @@
118123
prefixParts.push('fixed_scale(pixel_unit)');
119124
}
120125

126+
if(useRapier2d) {
127+
obj.physicsEngine = 'rapier2d';
128+
obj.clientPhysicsEngine = 'rapier2d';
129+
}
130+
121131
// Apply fixture fix if checked
122132
if (fixFixture) {
123133
obj = fixFixtureFn(obj, moveUpHalfDepth);

0 commit comments

Comments
 (0)