mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
3d v1.0.0 release (#4746)
* optimize deconstruction * optimize data copy
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user