diff --git a/source/attributes/data-comp-animation.md b/source/attributes/data-comp-animation.md new file mode 100644 index 0000000..9be5bfa --- /dev/null +++ b/source/attributes/data-comp-animation.md @@ -0,0 +1,35 @@ +# data-comp-animation + +```html + +``` + +## `action` + +Handles the animation starting and stopping. + +Values: `play`, `pause`, `stop` + +## `loop` + +Handles how the animation loops for the model file. If set to `true`/`false` ignores the value of `loopMode`, otherwise acts as a numerical looping count. + +Values: `true`, `false`, number >= 0 + +> if set to `true`/`false`, ignores the `loopMode` value + +## `loopMode` + +The format for how the looping should occur. Values are based on threejs defaults. + +Values: `once`, `repeat`, and `pingpong` + +> if set to `once`, ignores the `loop` value. + +## `clampWhenFinished` + +Freezes the animation state to the last frame when stop is called or any looping ends. + +Values: `true`, `false` + +> if not set, defaults to the threejs internals setup, which is `false` diff --git a/source/attributes/data-comp-audio.md b/source/attributes/data-comp-audio.md index 48f4e71..058d79c 100644 --- a/source/attributes/data-comp-audio.md +++ b/source/attributes/data-comp-audio.md @@ -1,7 +1,7 @@ # data-comp-audio ```html - + ``` Positional (aka Spatial) Audio can be attached to an entity using `data-comp-audio`, it has 4 values: @@ -10,9 +10,9 @@ Positional (aka Spatial) Audio can be attached to an entity using `data-comp-aud The path to the audio file. -## `state` +## `action` -The current state of the audio playback. +The current action state of the audio playback. Values: `play`, `pause`, `stop` (default) diff --git a/source/docs/mr-model.md b/source/docs/mr-model.md index 911fbcc..7a34496 100644 --- a/source/docs/mr-model.md +++ b/source/docs/mr-model.md @@ -38,6 +38,8 @@ * `src`: the path to the target model file +> Note: `data-comp-animation` can be useful here + ## Supported file types * Check out the [allowed extensions](https://docs.mrjs.io/js-api-utils/model/#modelloadmodelfilepath-extension--promisethreemesh) from the Model.loadModel function