Skip to content

Commit

Permalink
Init Physic with Rappier
Browse files Browse the repository at this point in the history
  • Loading branch information
Gugustinette committed May 1, 2024
1 parent ebb8eda commit 0517277
Show file tree
Hide file tree
Showing 12 changed files with 377 additions and 24 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"vitest": "^1.5.0"
},
"dependencies": {
"@dimforge/rapier3d": "^0.12.0",
"three": "^0.164.1"
}
}
276 changes: 275 additions & 1 deletion playground/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"devDependencies": {
"@fibbojs/fibbo": "file:../",
"typescript": "^5.2.2",
"vite": "^5.2.0"
"vite": "^5.2.0",
"vite-plugin-top-level-await": "^1.4.1",
"vite-plugin-wasm": "^3.3.0"
}
}
5 changes: 3 additions & 2 deletions playground/src/classes/Duck.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { FibboGLTF } from '@fibbojs/fibbo'
import type { FibboScene } from '@fibbojs/fibbo'

export default class Duck extends FibboGLTF {
constructor() {
super('Duck.glb')
constructor(scene: FibboScene) {
super(scene, 'Duck.glb')
}

onFrame(delta: number) {
Expand Down
7 changes: 3 additions & 4 deletions playground/src/classes/GltfCube.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { FibboGLTF } from '@fibbojs/fibbo'
import type { FibboScene } from '@fibbojs/fibbo'

export default class GltfCube extends FibboGLTF {
constructor() {
super('Cube.gltf', 2, 0, -2)
constructor(scene: FibboScene) {
super(scene, 'Cube.gltf')
}

onFrame(delta: number) {
super.onFrame(delta)
this.object3D.rotation.x += 0.2 * delta
this.object3D.rotation.y += 0.2 * delta
}
}
Loading

0 comments on commit 0517277

Please sign in to comment.