1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-23 20:02:32 +08:00

Merge pull request #64 from SaFrMo/build-error-fix

Fix build error
This commit is contained in:
Kevin LEVRON 2021-05-26 22:12:14 +02:00 committed by GitHub
commit 6f9251a5de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,10 +18,10 @@ export default defineComponent({
components: { Box, Camera, LambertMaterial, PointLight, Renderer, Scene },
mounted() {
const renderer = this.$refs.renderer as RendererPublicInterface
const box = this.$refs.box as MeshPublicInterface
if (renderer && box) {
const mesh = (this.$refs.box as MeshPublicInterface).mesh
if (renderer && mesh) {
renderer.onBeforeRender(() => {
box.mesh.rotation.x += 0.01
mesh.rotation.x += 0.01
})
}
},