@google/model-viewer
Advanced tools
Comparing version 3.0.2 to 3.1.0
@@ -91,4 +91,5 @@ /* @license | ||
video.muted = true; | ||
video.playsInline = true; | ||
video.loop = true; | ||
video.play(); | ||
video.loop = true; | ||
const texture = new VideoTexture(video); | ||
@@ -95,0 +96,0 @@ return this[$buildTexture](texture); |
@@ -1,2 +0,2 @@ | ||
import { Box3, Camera, Event as ThreeEvent, Material, Mesh, Object3D, PerspectiveCamera, Raycaster, Scene, Sphere, Texture, Vector2, Vector3, WebGLRenderer } from 'three'; | ||
import { AnimationActionLoopStyles, Box3, Camera, Event as ThreeEvent, Material, Mesh, Object3D, PerspectiveCamera, Raycaster, Scene, Sphere, Texture, Vector2, Vector3, WebGLRenderer } from 'three'; | ||
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer.js'; | ||
@@ -169,3 +169,3 @@ import ModelViewerElementBase, { RendererInterface } from '../model-viewer-base.js'; | ||
*/ | ||
playAnimation(name?: string | null, crossfadeTime?: number, loopMode?: number, repetitionCount?: number): void; | ||
playAnimation(name?: string | null, crossfadeTime?: number, loopMode?: AnimationActionLoopStyles, repetitionCount?: number): void; | ||
stopAnimation(): void; | ||
@@ -172,0 +172,0 @@ updateAnimation(step: number): void; |
@@ -83,3 +83,3 @@ /* @license | ||
this.threeRenderer.outputEncoding = sRGBEncoding; | ||
this.threeRenderer.physicallyCorrectLights = true; | ||
this.threeRenderer.useLegacyLights = false; | ||
this.threeRenderer.setPixelRatio(1); // handle pixel ratio externally | ||
@@ -86,0 +86,0 @@ this.debugger = !!options.debug ? new Debugger(this) : null; |
{ | ||
"name": "@google/model-viewer", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "Easily display interactive 3D models on the web and in AR!", | ||
@@ -79,3 +79,3 @@ "repository": "https://github.com/google/model-viewer", | ||
"peerDependencies": { | ||
"three": "^0.149.0" | ||
"three": "^0.151.2" | ||
}, | ||
@@ -90,3 +90,3 @@ "devDependencies": { | ||
"@types/pngjs": "^6.0.1", | ||
"@types/three": "^0.148.1", | ||
"@types/three": "^0.150.0", | ||
"@ungap/event-target": "^0.2.3", | ||
@@ -111,3 +111,3 @@ "chai": "^4.3.6", | ||
"typescript": "4.8.4", | ||
"three": "^0.149.0" | ||
"three": "^0.151.2" | ||
}, | ||
@@ -114,0 +114,0 @@ "publishConfig": { |
@@ -1,6 +0,1 @@ | ||
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.0.1/model-viewer.min.js"></script> | ||
<p align="center"> | ||
<model-viewer alt="Neil Armstrong's Spacesuit from the Smithsonian Digitization Programs Office and National Air and Space Museum" src="https://modelviewer.dev/shared-assets/models/NeilArmstrong.glb" ar environment-image="https://modelviewer.dev/shared-assets/environments/moon_1k.hdr" poster="https://modelviewer.dev/shared-assets/models/NeilArmstrong.webp" shadow-intensity="1" camera-controls touch-action="pan-y" style="width: 480px; height: 600px"></model-viewer> | ||
</p> | ||
# `<model-viewer>` | ||
@@ -7,0 +2,0 @@ |
@@ -153,4 +153,5 @@ /* @license | ||
video.muted = true; | ||
video.playsInline = true; | ||
video.loop = true; | ||
video.play(); | ||
video.loop = true; | ||
const texture = new VideoTexture(video); | ||
@@ -157,0 +158,0 @@ |
@@ -16,3 +16,3 @@ /* @license | ||
import {Color, DoubleSide, FrontSide, MeshStandardMaterial} from 'three'; | ||
import {Color, ColorRepresentation, DoubleSide, FrontSide, MeshStandardMaterial} from 'three'; | ||
@@ -262,3 +262,3 @@ import {AlphaMode, GLTF, Material as GLTFMaterial, RGB} from '../../three-components/gltf-instance/gltf-2.0.js'; | ||
} else { | ||
color.set(rgb).convertSRGBToLinear(); | ||
color.set(rgb as ColorRepresentation).convertSRGBToLinear(); | ||
} | ||
@@ -265,0 +265,0 @@ for (const material of this[$correlatedObjects] as |
@@ -16,3 +16,3 @@ /* @license | ||
import {Color, MeshStandardMaterial} from 'three'; | ||
import {Color, ColorRepresentation, MeshStandardMaterial} from 'three'; | ||
@@ -114,3 +114,3 @@ import {GLTF, PBRMetallicRoughness as GLTFPBRMetallicRoughness} from '../../three-components/gltf-instance/gltf-2.0.js'; | ||
} else { | ||
color.set(rgba).convertSRGBToLinear(); | ||
color.set(rgba as ColorRepresentation).convertSRGBToLinear(); | ||
} | ||
@@ -117,0 +117,0 @@ for (const material of this[$threeMaterials]) { |
@@ -16,3 +16,3 @@ /* @license | ||
import {AnimationAction, AnimationClip, AnimationMixer, Box3, Camera, Euler, Event as ThreeEvent, LoopPingPong, LoopRepeat, Material, Matrix3, Mesh, Object3D, PerspectiveCamera, Raycaster, Scene, Sphere, Texture, Triangle, Vector2, Vector3, WebGLRenderer} from 'three'; | ||
import {AnimationAction, AnimationActionLoopStyles, AnimationClip, AnimationMixer, Box3, Camera, Euler, Event as ThreeEvent, LoopPingPong, LoopRepeat, Material, Matrix3, Mesh, Object3D, PerspectiveCamera, Raycaster, Scene, Sphere, Texture, Triangle, Vector2, Vector3, WebGLRenderer} from 'three'; | ||
import {CSS2DRenderer} from 'three/examples/jsm/renderers/CSS2DRenderer.js'; | ||
@@ -667,3 +667,4 @@ // @ts-ignore | ||
name: string|null = null, crossfadeTime: number = 0, | ||
loopMode: number = LoopRepeat, repetitionCount: number = Infinity) { | ||
loopMode: AnimationActionLoopStyles = LoopRepeat, | ||
repetitionCount: number = Infinity) { | ||
if (this._currentGLTF == null) { | ||
@@ -670,0 +671,0 @@ return; |
@@ -150,3 +150,3 @@ /* @license | ||
this.threeRenderer.outputEncoding = sRGBEncoding; | ||
this.threeRenderer.physicallyCorrectLights = true; | ||
this.threeRenderer.useLegacyLights = false; | ||
this.threeRenderer.setPixelRatio(1); // handle pixel ratio externally | ||
@@ -153,0 +153,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21818813
129010
87