Skip to content

Commit

Permalink
#5 set joint collision as true, angular damping multiply by 10
Browse files Browse the repository at this point in the history
  • Loading branch information
noname0310 committed Aug 12, 2023
1 parent 2d3b7ad commit 34bb529
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Binary file added res/constraint_test4.pmx
Binary file not shown.
5 changes: 3 additions & 2 deletions src/Runtime/mmdPhysics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export class MmdPhysics {
body.setMassProperties({ mass: rigidBody.mass });
// TODO: fix linearDamping calculation (multiply by 10 is nonsense)
body.setLinearDamping(rigidBody.linearDamping * 10);
body.setAngularDamping(rigidBody.angularDamping);
body.setAngularDamping(rigidBody.angularDamping * 10);
body.computeMassProperties();

nodes.push(node);
Expand Down Expand Up @@ -582,7 +582,8 @@ export class MmdPhysics {
jointFinalTransformB.m[4],
jointFinalTransformB.m[5],
jointFinalTransformB.m[6]
)
),
collision: true
},
limits,
scene
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Scene/constraintTestScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class SceneBuilder implements ISceneBuilder {
const mmdMesh = await SceneLoader.ImportMeshAsync(
undefined,
"res/",
"constraint_test3.pmx",
"constraint_test4.pmx",
scene
).then(result => result.meshes[0]);
mmdMesh.receiveShadows = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Test/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Engine } from "@babylonjs/core/Engines/engine";

import { BaseRuntime } from "./baseRuntime";
import { SceneBuilder } from "./Scene/physicsTestScene";
import { SceneBuilder } from "./Scene/constraintTestScene";

window.onload = (): void => {
const canvas = document.createElement("canvas");
Expand Down

0 comments on commit 34bb529

Please sign in to comment.