We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这是我的代码:它实现在第一人称视角的镜头动画,将镜头移动到某个位置。我期望,之后不会再回到动画前的位置。它就呆在哪儿,可是 ` const rigidRef = useRef(null); // 玩家所在刚体 const [disable, setDisable] = useState(false);
// 相机移动 function cameraMoveTo(to: Vector3) { if (!camera) return; setDisable(true); new TWEEN.Tween(camera.position, tweenGroup) .to( { x: to.x, y: to.y, z: to.z, }, 1800 ) .easing(TWEEN.Easing.Quartic.InOut) .start() .onComplete(() => { setDisable(false); rigidRef.current!.setTranslation(to, false); }); }
cameraMoveTo(new Vector3(0.5, 1, 6));
<Ecctrl // 人物设置 position={startPos} camInitDir={START_DIR} maxVelLimit={SPEED} // 人物移动速度 turnVelMultiplier={1} turnSpeed={100} name="player" // 相机设置 camListenerTarget="document" camCollision={false} camInitDis={-0.01} camMinDis={-0.01} camMaxDis={-0.01} camLerpMult={1000} camFollowMult={1000} camUpLimit={Math.PI / 10} camLowLimit={-Math.PI / 10} // 移动设置 mode="CameraBasedMovement" disableFollowCam={disable} autoBalance={false} floatHeight={0} ref={rigidRef} />`
The text was updated successfully, but these errors were encountered:
貌似不是镜头跟随玩家,而是玩家跟随镜头,我能在disableFollowCam时更新followCamera的位置吗
Sorry, something went wrong.
No branches or pull requests
这是我的代码:它实现在第一人称视角的镜头动画,将镜头移动到某个位置。我期望,之后不会再回到动画前的位置。它就呆在哪儿,可是
`
const rigidRef = useRef(null); // 玩家所在刚体
const [disable, setDisable] = useState(false);
// 相机移动
function cameraMoveTo(to: Vector3) {
if (!camera) return;
setDisable(true);
new TWEEN.Tween(camera.position, tweenGroup)
.to(
{
x: to.x,
y: to.y,
z: to.z,
},
1800
)
.easing(TWEEN.Easing.Quartic.InOut)
.start()
.onComplete(() => {
setDisable(false);
rigidRef.current!.setTranslation(to, false);
});
}
cameraMoveTo(new Vector3(0.5, 1, 6));
The text was updated successfully, but these errors were encountered: