Skip to content

Commit

Permalink
chore: add physics control
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Oct 6, 2024
1 parent 20b36e8 commit 76e3646
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ export const Model = () => {
audioDelayTime,
audioPath,
modelPath,
modelPhysics,
modelScale,
} = useControls('Assets', {
animationPath: `${examples}models/mmd/vmds/wavefile_v2.vmd`,
audioDelayTime: 160 * 1 / 30,
audioPath: `${examples}models/mmd/audios/wavefile_short.mp3`,
modelPath: `${pmx}miku/Tda式初音ミク・アペンド_Ver1.10.pmx`,
modelPhysics: true,
modelScale: {
max: 0.2,
min: 0.01,
step: 0.01,
value: 0.08,
},

})

useEffect(() => {
Expand All @@ -56,7 +57,7 @@ export const Model = () => {

loader.loadAnimation(animationPath, model, (animation) => {
model.animations.push(animation as AnimationClip)
helper.add(model, { animation: model.animations, physics: true })
helper.add(model, { animation: model.animations, physics: modelPhysics })
})

audio.setBuffer(buffer)
Expand Down

0 comments on commit 76e3646

Please sign in to comment.