@j-kyoda/vue-three-vrm 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,6 +34,9 @@ const vrm_url = 'models/chico_hoodie.vrm'
34
34
  // toDo: Please enter your VRMA file URL here.(OPTION)
35
35
  const vrma_url = 'models/sample.vrma'
36
36
 
37
+ let _vrm_model = null
38
+
39
+
37
40
  const context_initialized = async (context) => {
38
41
  render_context.value = context // save context
39
42
  context_ready.value = true // Begin model loading.
@@ -42,6 +45,9 @@ const context_initialized = async (context) => {
42
45
  const model_loaded = (name, vrm_model) => {
43
46
  const context = render_context.value
44
47
 
48
+ // save
49
+ _vrm_model = vrm_model
50
+
45
51
  // add model to scene
46
52
  const model = vrm_model.scene
47
53
  model.name = name
@@ -50,6 +56,14 @@ const model_loaded = (name, vrm_model) => {
50
56
 
51
57
  animation.value = true // Starting animation.
52
58
  }
59
+
60
+ const cb_animate = (context) => {
61
+ const { deltaTime } = context
62
+ if (_vrm_model != null) {
63
+ // animate
64
+ _vrm_model.updateAnimation(deltaTime)
65
+ }
66
+ }
53
67
  </script>
54
68
 
55
69
  <template>
@@ -61,6 +75,7 @@ const model_loaded = (name, vrm_model) => {
61
75
  :useAxesHelper="false"
62
76
  :useDefaultLight="true"
63
77
  v-on:initialized="context_initialized"
78
+ v-on:animate="cb_animate"
64
79
  />
65
80
  </div>
66
81
  <div v-if="context_ready">
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- .box[data-v-1e83d65e]{display:block;width:100%;height:100%}
1
+ .box[data-v-7a2a753c]{display:block;width:100%;height:100%}