import { _decorator, Component, Node, v3, Vec3 } from ‘cc’;
const { ccclass, property } = _decorator;
const frameData = [
{
“x”: 1279,
“y”: 0,
“z”: 0,
},
{
“x”: 1277,
“y”: 0,
“z”: 0,
},
// {
// “x”: 127990,
// “y”: 0,
// “z”: 0,
// },
// {
// “x”: 127970,
// “y”: 0,
// “z”: 0,
// },
];
@ccclass(‘test’)
export class test extends Component {
start() {
this.node.setPosition(frameData[0].x, frameData[0].y, frameData[0].z);
}
update(deltaTime) {
this.node.setPosition(
Vec3.lerp(v3(), this.node.position, frameData[1], deltaTime)
);
}
}
参考以上代码。
lerp过程在不同大小的位置上的时候表现的不一致。
安卓客户端上 超过5000范围上的lerp插帧会有明显的卡顿现象,这个有办法解么?