-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
46 lines (37 loc) · 1.23 KB
/
test.html
File metadata and controls
46 lines (37 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
<title>cannon-es Test</title>
</head>
<body>
<h1>cannon-es API Test</h1>
<div id="output"></div>
<script type="module">
import * as CANNON from 'cannon-es';
const output = document.getElementById('output');
function log(msg) {
output.innerHTML += '<div>' + msg + '</div>';
}
log('✅ cannon-es loaded successfully');
log('CANNON version: ' + (CANNON.version || 'unknown'));
// Test world creation
const world = new CANNON.World();
log('✅ World created');
// Test body creation
const body = new CANNON.Body({
mass: 1,
shape: new CANNON.Box(new CANNON.Vec3(1, 1, 1))
});
log('✅ Body created');
// Test Compound - if it exists
log('typeof CANNON.Compound: ' + typeof CANNON.Compound);
if (typeof CANNON.Compound !== 'undefined') {
const compound = new CANNON.Compound();
log('✅ Compound created');
} else {
log('⚠️ Compound not found - this is expected in newer cannon-es versions');
}
log('<strong>✅ All basic tests passed!</strong>');
</script>
</body>
</html>