diff --git a/cocos/animation/animation-state.ts b/cocos/animation/animation-state.ts index 10f460196d..a5a0ba85bd 100644 --- a/cocos/animation/animation-state.ts +++ b/cocos/animation/animation-state.ts @@ -612,27 +612,26 @@ export class AnimationState extends Playable { } for (const curveInstace of samplerSharedGroup.curves) { - const { curve, blendTarget, target, propertyName } = curveInstace; - if (curve.empty()) { + if (curveInstace.curve.empty()) { continue; } let value: any; if (!lerpRequired) { - value = curve.valueAt(index); + value = curveInstace.curve.valueAt(index); } else { - value = curve.valueBetween( + value = curveInstace.curve.valueBetween( ratio, samplerResultCache.from, samplerResultCache.fromRatio, samplerResultCache.to, samplerResultCache.toRatio); } - if (!curve._blendFunction || !blendTarget || blendTarget.refCount <= 1) { - target[propertyName] = value; + if (!curveInstace.curve._blendFunction || !curveInstace.blendTarget || curveInstace.blendTarget.refCount <= 1) { + curveInstace.target[curveInstace.propertyName] = value; } else { const { weight } = this; - blendTarget.value = curve._blendFunction(value, weight, blendTarget); - blendTarget.weight += weight; + curveInstace.blendTarget.value = curveInstace.curve._blendFunction(value, weight, curveInstace.blendTarget); + curveInstace.blendTarget.weight += weight; } } } diff --git a/cocos/renderer/scene/model.ts b/cocos/renderer/scene/model.ts index 740d52debe..e0d3106933 100644 --- a/cocos/renderer/scene/model.ts +++ b/cocos/renderer/scene/model.ts @@ -223,11 +223,9 @@ export class Model { this._uboUpdated = true; // @ts-ignore const worldMatrix = this._transform._mat; - mat4.array(f32_1, worldMatrix); - this._uboLocal.view.set(f32_1, UBOLocal.MAT_WORLD_OFFSET); + mat4.array(this._uboLocal.view, worldMatrix, UBOLocal.MAT_WORLD_OFFSET); mat4.inverseTranspose(m4_1, worldMatrix); - mat4.array(f32_1, m4_1); - this._uboLocal.view.set(f32_1, UBOLocal.MAT_WORLD_IT_OFFSET); + mat4.array(this._uboLocal.view, m4_1, UBOLocal.MAT_WORLD_IT_OFFSET); const commonLocal = this._localBindings.get(UBOLocal.BLOCK.name); if (commonLocal && commonLocal.buffer) {