gpt4 book ai didi

javascript - 未捕获的类型错误 : Cannot redefine property: rotation

转载 作者:行者123 更新时间:2023-11-30 10:16:11 27 4
gpt4 key购买 nike

我刚刚在另一台笔记本电脑上检查了一个正在运行的项目。使用 npm 和 bower 安装所有内容后,当我尝试在本地主机上运行它时,出现以下错误:

Uncaught TypeError: Cannot redefine property: rotation 

在(非缩小 three.js r67 中的第 7542 行):

THREE.Object3D = function () {

this.id = THREE.Object3DIdCount ++;
this.uuid = THREE.Math.generateUUID();

this.name = '';

this.parent = undefined;
this.children = [];

this.up = new THREE.Vector3( 0, 1, 0 );

this.position = new THREE.Vector3();

var scope = this;

Object.defineProperties( this, {
rotation: {
enumerable: true,
value: new THREE.Euler().onChange( function () {
scope.quaternion.setFromEuler( scope.rotation, false );
} )
}, [...]

所以 three.js 出了点问题,我不知道为什么,但它显然破坏了整个应用程序。有人经历过吗?

最佳答案

这是故意的。

这些模式不再有效:

object.rotation = object2.rotation
object.rotation = new THREE.Euler( 1, 0, 0 );

改为这样做:

object.rotation.copy( object2.rotation );
object.rotation.set( 1, 0, 0 );

下一个版本将对此有更好的错误消息。

关于javascript - 未捕获的类型错误 : Cannot redefine property: rotation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23617901/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com