Skip to content

Commit

Permalink
test: update config
Browse files Browse the repository at this point in the history
  • Loading branch information
luzhuang committed Oct 18, 2024
1 parent 0bc262c commit 213958a
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 32 deletions.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"test": "vitest",
"coverage": "vitest --coverage --ui",
"coverage": "vitest --coverage",
"coverage:ui": "vitest --coverage --ui",
"build": "npm run b:module && npm run b:types",
"lint": "eslint packages/*/src --ext .ts",
"watch": "cross-env NODE_ENV=release BUILD_TYPE=MODULE rollup -cw -m inline",
Expand Down Expand Up @@ -36,6 +37,8 @@
"@types/webxr": "latest",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"@vitest/coverage-v8": "2.1.3",
"@vitest/ui": "2.1.3",
"bumpp": "^9.5.2",
"cross-env": "^5.2.0",
"cypress": "^12.17.1",
Expand All @@ -49,6 +52,7 @@
"lint-staged": "^10.5.3",
"nyc": "^15.1.0",
"odiff-bin": "^2.5.0",
"playwright": "^1.48.1",
"prettier": "^3.0.0",
"rollup": "^2.36.1",
"rollup-plugin-glslify": "^1.2.0",
Expand Down
20 changes: 10 additions & 10 deletions packages/core/src/animation/Keyframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ export class Keyframe<
T = V extends number
? number
: V extends Vector2
? Vector2
: V extends Vector3
? Vector3
: V extends Vector4 | Color | Quaternion | Rect
? Vector4
: V extends number[] | Float32Array
? number[]
: V extends ReferResource
? ReferResource
: never
? Vector2
: V extends Vector3
? Vector3
: V extends Vector4 | Color | Quaternion | Rect
? Vector4
: V extends number[] | Float32Array
? number[]
: V extends ReferResource
? ReferResource
: never
> {
/** The time of the Keyframe. */
time: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ export class AnimationCurveOwner<V extends KeyframeValueType> {
? srcCurve._evaluateAdditive(srcTime, this.baseEvaluateData)
: srcCurve._evaluate(srcTime, this.baseEvaluateData)
: additive
? this.cureType._getZeroValue(this.baseEvaluateData.value)
: this.defaultValue;
? this.cureType._getZeroValue(this.baseEvaluateData.value)
: this.defaultValue;

const destValue =
destCurve && destCurve.keys.length
? additive
? destCurve._evaluateAdditive(destTime, this.crossEvaluateData)
: destCurve._evaluate(destTime, this.crossEvaluateData)
: additive
? this.cureType._getZeroValue(this.crossEvaluateData.value)
: this.defaultValue;
? this.cureType._getZeroValue(this.crossEvaluateData.value)
: this.defaultValue;

return this._lerpValue(srcValue, destValue, crossWeight);
}
Expand All @@ -126,8 +126,8 @@ export class AnimationCurveOwner<V extends KeyframeValueType> {
? destCurve._evaluateAdditive(destTime, this.crossEvaluateData)
: destCurve._evaluate(destTime, this.crossEvaluateData)
: additive
? this.cureType._getZeroValue(this.crossEvaluateData.value)
: this.defaultValue;
? this.cureType._getZeroValue(this.crossEvaluateData.value)
: this.defaultValue;

return this._lerpValue(srcValue, destValue, crossWeight);
}
Expand Down
Loading

0 comments on commit 213958a

Please sign in to comment.