Skip to content

Commit

Permalink
ready to ship
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliusNmn committed Feb 26, 2024
1 parent de2f6df commit 85e9045
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/demo/Demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ export class Demo {
renderer: THREE.WebGLRenderer
camera: THREE.PerspectiveCamera
physics: Physics
gravity = 0
constructor(canvas: HTMLCanvasElement) {
this.physics = new Physics()
this.scene = new THREE.Scene()
Expand Down Expand Up @@ -490,7 +491,7 @@ export class Demo {

const gui = new GUI();
// lllfc (lowerLeftLegFrontContraction)
gui.add(this, "lllfc", 0, 1, 0.01);
gui.add(this, "gravity", -50, 1, 0.01);

// Start the loop!
this.animate()
Expand Down Expand Up @@ -660,6 +661,8 @@ export class Demo {
const mat = (line.material as THREE.LineBasicMaterial)
mat.color = new THREE.Color(1 - muscle.currentContraction, 0, muscle.currentContraction)
}

this.physics.world.gravity = new CANNON.Vec3(0,this.gravity,0);//-9.81,0)
/*
// Render contacts
this.contactMeshCache.restart()
Expand Down

0 comments on commit 85e9045

Please sign in to comment.