mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
f1f0fbaf16
* NewGenAnim * Fix/Optimize simple directional blending * Class transition by type (#29) * Transition & Gradient transition (#30) * The default ExitCondition should be 1.0 * Do correct graph eval * Fix PoseSubgraph connect() signature order (#31) * Graph defaults test (#32) * Conditions (#33) * Trigger (#34) * Transition should only be considered when satemachine exited (#35) * Add layer.name (#36) * Fix some behaviours; add API to query poses and transition (#37) Fix single frame exit condition behaviours; Fix pose -> subgraph behaviours * Support self transition; refactor sub state machine implementation (#38) * Temp * Flat whole layer statemachine * Add test for test reset triggers * Allow self transition * Self transition test * Fix deserialize (#39) * update animgraph template (#40) * The inheritance of any state (#41) * StateMachine events (#42) * Fix state machine events; Allow multiple transitions between two nodes (#43) * Transition priority test (#44) * Optimize variable bind (#45) * Fix variable bind errors (#46) * Expose blend algorithm to editor (#47) * Cont (#48) * update animgraph template (#49) * update animgraph template * update animgraph template * Pose speed (#50) * blend tree add EditorExtendable data (#51) * Correct pose blend duration (#52) * Export some types (#53) * animation pose EditorExtendable (#54) (cherry picked from commit d5dd5f32c9dbacb68c016ff8ba56d383c781a021) * Implement clone() (#55) * Fix trigger condition serialization (#56) * Add variable type: integer (#57) * Optimize 0 weight case (#58) * Relative duration (#59) * update_hdr_skybox (#9230) * Rename.. (#60) * Optimize animation blend item export (#61) * Fix Type (#62) * modify aniamtion graph template data (#63) * modify aniamtion graph template data * add animation graph component template * Fix serialize issue (#64) * Optimize (#65) * Remove MotionState.startRatio, loop (#66) * Update (#67) * Fix circular reference (#68) * CR (#69) * Fix exit time greater than 1 (#70) Co-authored-by: 黄森斌 <arsen2010@126.com> Co-authored-by: linshunjun <49218738+linshunjun@users.noreply.github.com>
34 lines
1011 B
TypeScript
34 lines
1011 B
TypeScript
declare global {
|
|
namespace jest {
|
|
interface Matchers<R> {
|
|
toBeCloseToArray<T extends number>(expected: T[]): CustomMatcherResult;
|
|
}
|
|
}
|
|
}
|
|
|
|
expect.extend({
|
|
toBeCloseToArray<T extends number>(received: T, expected: T[], epsilon = 1e-5) {
|
|
if (!Array.isArray(received)) {
|
|
return {
|
|
pass: false,
|
|
message: () => `Expected ${received} to be Array`,
|
|
};
|
|
}
|
|
if (received.length !== expected.length) {
|
|
return {
|
|
pass: false,
|
|
message: () => `Expected ${received} to have length ${expected.length}`,
|
|
};
|
|
}
|
|
return received.every((v: number, i: number) => Math.abs(v - expected[i]) < epsilon) ? ({
|
|
pass: true,
|
|
message: () => `Expected ${received} not to be ${expected}`,
|
|
}) : ({
|
|
pass: false,
|
|
message: () => `Expected ${received} to be ${expected}`,
|
|
});
|
|
},
|
|
});
|
|
|
|
export {};
|