Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cocos/2d/assembler/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function fillMeshVertices3D (node: Node, renderer: IBatcher, renderData:
}

export function updateOpacity (renderData: RenderData, opacity: number): void {
if(!renderData.chunk) {
if (!renderData.chunk) {
// When the allocation of chunk in StaticVBAccessor fails (when the allocated buffer is too large), chunk will be null.
return;
}
Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/renderer/mesh-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export class MeshBuffer {

this.floatsPerVertex = getAttributeStride(attrs) >> 2;

var vDataCountLimit = 65536; // 2^16 - 1
let vDataCountLimit = 65536; // 2^16 - 1
const glApi = device.gfxAPI;
if (glApi === API.WEBGPU || glApi === API.WEBGL2 || glApi === API.WEBGL && device.hasFeature(Feature.ELEMENT_INDEX_UINT)) {
vDataCountLimit = 4294967295; // 2^32 - 1
Expand Down
1 change: 0 additions & 1 deletion cocos/3d/skeletal-animation/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
THE SOFTWARE.
*/


export const MAX_ANIMATION_LAYER = 32;
7 changes: 2 additions & 5 deletions cocos/3d/skeletal-animation/skeletal-animation-blending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
this.deRef(internal.node, internal.property);
}

public ref<P extends BlendingPropertyName> (node: Node, property: P): PropertyBlendStateTypeMap<PropertyBlendState<Vec3>, PropertyBlendState<Quat>>[P]
{
public ref<P extends BlendingPropertyName> (node: Node, property: P): PropertyBlendStateTypeMap<PropertyBlendState<Vec3>, PropertyBlendState<Quat>>[P] {

Check warning on line 56 in cocos/3d/skeletal-animation/skeletal-animation-blending.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 156. Maximum allowed is 150

Check warning on line 56 in cocos/3d/skeletal-animation/skeletal-animation-blending.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 156. Maximum allowed is 150
let nodeBlendState = this._nodeBlendStates.get(node);
if (!nodeBlendState) {
nodeBlendState = this.createNodeBlendState();
Expand Down Expand Up @@ -211,9 +210,7 @@
&& !properties.scale;
}

public refProperty<P extends BlendingPropertyName> (
node: Node, property: BlendingPropertyName,
): NodeBlendState<TVec3PropertyBlendState, TQuatPropertyBlendState>['_properties'][P] {
public refProperty<P extends BlendingPropertyName> (node: Node, property: BlendingPropertyName): NodeBlendState<TVec3PropertyBlendState, TQuatPropertyBlendState>['_properties'][P] {

Check warning on line 213 in cocos/3d/skeletal-animation/skeletal-animation-blending.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 185. Maximum allowed is 150

Check warning on line 213 in cocos/3d/skeletal-animation/skeletal-animation-blending.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 185. Maximum allowed is 150
const { _properties: properties } = this;
let propertyBlendState: TVec3PropertyBlendState | TQuatPropertyBlendState;
switch (property) {
Expand Down
4 changes: 1 addition & 3 deletions cocos/animation/animation-curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
} else if (propertyCurveData.easingMethods !== undefined) {
this.types = new Array(this._values.length).fill(null);
for (const index of Object.keys(propertyCurveData.easingMethods)) {
this.types[index] = getCurveType(propertyCurveData.easingMethods[index]);

Check failure on line 121 in cocos/animation/animation-curve.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `LegacyEasingMethod`

Check failure on line 121 in cocos/animation/animation-curve.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `LegacyEasingMethod`
}
} else {
this.type = null;
Expand Down Expand Up @@ -246,9 +246,7 @@
index = sampler.ratios.length - 1;
} else {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return curve.valueBetween(
ratio, index - 1, sampler.ratios[index - 1], index, sampler.ratios[index],
);
return curve.valueBetween(ratio, index - 1, sampler.ratios[index - 1], index, sampler.ratios[index]);
}
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
Expand Down
4 changes: 1 addition & 3 deletions cocos/animation/core/pose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,7 @@
};
})();

export function applyDeltaTransforms (
target: TransformArray, delta: TransformArray, alpha: number, transformFilter: TransformFilter | undefined = undefined,
): void {
export function applyDeltaTransforms (target: TransformArray, delta: TransformArray, alpha: number, transformFilter: TransformFilter | undefined = undefined): void {

Check warning on line 214 in cocos/animation/core/pose.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 165. Maximum allowed is 150

Check warning on line 214 in cocos/animation/core/pose.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 165. Maximum allowed is 150
const nTransforms = target.length;
assertIsTrue(nTransforms === delta.length);
if (!transformFilter) {
Expand Down
2 changes: 1 addition & 1 deletion cocos/animation/core/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class Transform {
&& Vec3.equals(a._scale, b._scale, epsilon);
}

public static strictEquals (a: ReadonlyTransform, b: ReadonlyTransform):boolean {
public static strictEquals (a: ReadonlyTransform, b: ReadonlyTransform): boolean {
return Vec3.strictEquals(a._position, b._position)
&& Quat.strictEquals(a._rotation, b._rotation)
&& Vec3.strictEquals(a._scale, b._scale);
Expand Down
18 changes: 5 additions & 13 deletions cocos/animation/cubic-spline-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
this.outTangent = outTangent || new ConstructorX();
}

public lerp (to: CubicSplineValueClass, t: number, dt: number):T {
public lerp (to: CubicSplineValueClass, t: number, dt: number): T {
const p0 = this.dataPoint;
const p1 = to.dataPoint;
// dt => t_k+1 - t_k
Expand Down Expand Up @@ -93,7 +93,7 @@
// Tracking issue: https://github.com/cocos/cocos-engine/issues/14640
if (ConstructorX as any === Quat) {
const lerp = CubicSplineValueClass.prototype.lerp;
CubicSplineValueClass.prototype.lerp = function (this: CubicSplineValueClass, to: CubicSplineValueClass, t: number, dt: number): Quat {

Check warning on line 96 in cocos/animation/cubic-spline-value.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function

Check warning on line 96 in cocos/animation/cubic-spline-value.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
const result = lerp.call(this, to, t, dt) as Quat;
Quat.normalize(result, result);
return result;
Expand All @@ -106,9 +106,7 @@
/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
export const CubicSplineVec2Value = makeCubicSplineValueConstructor(
'cc.CubicSplineVec2Value', Vec2, Vec2.multiplyScalar, Vec2.scaleAndAdd,
);
export const CubicSplineVec2Value = makeCubicSplineValueConstructor('cc.CubicSplineVec2Value', Vec2, Vec2.multiplyScalar, Vec2.scaleAndAdd);

/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
Expand All @@ -118,9 +116,7 @@
/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
export const CubicSplineVec3Value = makeCubicSplineValueConstructor(
'cc.CubicSplineVec3Value', Vec3, Vec3.multiplyScalar, Vec3.scaleAndAdd,
);
export const CubicSplineVec3Value = makeCubicSplineValueConstructor('cc.CubicSplineVec3Value', Vec3, Vec3.multiplyScalar, Vec3.scaleAndAdd);

/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
Expand All @@ -130,9 +126,7 @@
/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
export const CubicSplineVec4Value = makeCubicSplineValueConstructor(
'cc.CubicSplineVec4Value', Vec4, Vec4.multiplyScalar, Vec4.scaleAndAdd,
);
export const CubicSplineVec4Value = makeCubicSplineValueConstructor('cc.CubicSplineVec4Value', Vec4, Vec4.multiplyScalar, Vec4.scaleAndAdd);

/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
Expand All @@ -142,9 +136,7 @@
/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
export const CubicSplineQuatValue = makeCubicSplineValueConstructor(
'cc.CubicSplineQuatValue', Quat, Quat.multiplyScalar, Quat.scaleAndAdd,
);
export const CubicSplineQuatValue = makeCubicSplineValueConstructor('cc.CubicSplineQuatValue', Quat, Quat.multiplyScalar, Quat.scaleAndAdd);

/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
Expand Down
12 changes: 3 additions & 9 deletions cocos/animation/exotic-animation/exotic-animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,19 +625,13 @@
binder: Binder,
) {
if (position) {
this._position = createExoticTrackEvaluationRecord(
position.times, position.values, Vec3, path, 'position', binder,
);
this._position = createExoticTrackEvaluationRecord(position.times, position.values, Vec3, path, 'position', binder);
}
if (rotation) {
this._rotation = createExoticTrackEvaluationRecord(
rotation.times, rotation.values, Quat, path, 'rotation', binder,
);
this._rotation = createExoticTrackEvaluationRecord(rotation.times, rotation.values, Quat, path, 'rotation', binder);
}
if (scale) {
this._scale = createExoticTrackEvaluationRecord(
scale.times, scale.values, Vec3, path, 'scale', binder,
);
this._scale = createExoticTrackEvaluationRecord(scale.times, scale.values, Vec3, path, 'scale', binder);
}
}

Expand Down Expand Up @@ -936,8 +930,8 @@
let min = Number.POSITIVE_INFINITY;
let max = Number.NEGATIVE_INFINITY;
values.forEach((value) => {
min = Math.min(value, min);

Check failure on line 933 in cocos/animation/exotic-animation/exotic-animation.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `number`

Check failure on line 933 in cocos/animation/exotic-animation/exotic-animation.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `number`
max = Math.max(value, max);

Check failure on line 934 in cocos/animation/exotic-animation/exotic-animation.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `number`

Check failure on line 934 in cocos/animation/exotic-animation/exotic-animation.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `number`
});
const extent = max - min;
// Should consider `extent === 0.0`.
Expand Down
4 changes: 1 addition & 3 deletions cocos/animation/marionette/animation-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,7 @@
* @param type The variable's type.
* @param initialValue Initial value.
*/
public addVariable<TVariableType extends VariableType> (
name: string, type: TVariableType, initialValue?: VariableTypeValueTypeMap[TVariableType],
): VariableDescription {
public addVariable<TVariableType extends VariableType> (name: string, type: TVariableType, initialValue?: VariableTypeValueTypeMap[TVariableType]): VariableDescription {

Check warning on line 941 in cocos/animation/marionette/animation-graph.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 173. Maximum allowed is 150

Check warning on line 941 in cocos/animation/marionette/animation-graph.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 173. Maximum allowed is 150
const variable = createVariable(type, initialValue);
this._variables[name] = variable;
return variable;
Expand Down
3 changes: 1 addition & 2 deletions cocos/animation/marionette/asset-creation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

export { InvalidTransitionError, VariableNotDefinedError } from './errors';
export { AnimationGraph, isAnimationTransition, StateMachine, SubStateMachine, EmptyStateTransition, EmptyState, ProceduralPoseState, ProceduralPoseTransition } from './animation-graph';

Check warning on line 26 in cocos/animation/marionette/asset-creation.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 186. Maximum allowed is 150

Check warning on line 26 in cocos/animation/marionette/asset-creation.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 186. Maximum allowed is 150
export type { Transition, AnimationTransition, Layer, State } from './animation-graph';
export { BinaryCondition, UnaryCondition, TriggerCondition } from './state-machine/condition';
export type { Condition } from './state-machine/condition';
Expand All @@ -43,6 +43,5 @@

export type { PoseGraph } from './pose-graph/pose-graph';

export * from './pose-graph/op/index'
export * from './pose-graph/op/index';
export type { EnterNodeInfo } from './pose-graph/foundation/authoring/enter-node-info';

12 changes: 6 additions & 6 deletions cocos/animation/marionette/pose-graph/op/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@

const POSE_NODE_OUTPUT_BINDING_KEY = 0;

export function getInputKeys (node: PoseGraphNode) {

Check failure on line 25 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function

Check failure on line 25 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function
return globalPoseGraphNodeInputManager.getInputKeys(node);
}

export function isValidInputKey (node: PoseGraphNode, key: PoseGraphInputKey) {

Check failure on line 29 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function

Check failure on line 29 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function
return globalPoseGraphNodeInputManager.hasInput(node, key);
}

export function getInputMetadata (node: PoseGraphNode, key: PoseGraphInputKey) {

Check failure on line 33 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function

Check failure on line 33 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function
return globalPoseGraphNodeInputManager.getInputMetadata(node, key);
}

Expand All @@ -52,15 +52,15 @@
return graph.getShell(node)?.findBinding(key);
}

export function getInputInsertInfos (node: PoseGraphNode) {

Check failure on line 55 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function

Check failure on line 55 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function
return globalPoseGraphNodeInputManager.getInputInsertInfos(node);
}

export function insertInput (graph: PoseGraph, node: PoseGraphNode, insertId: PoseGraphNodeInputInsertId) {

Check failure on line 59 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function

Check failure on line 59 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function
return globalPoseGraphNodeInputManager.insertInput(graph, node, insertId);
}

export function deleteInput (graph: PoseGraph, node: PoseGraphNode, key: PoseGraphInputKey) {

Check failure on line 63 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function

Check failure on line 63 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function
globalPoseGraphNodeInputManager.deleteInput(graph, node, key);
}

Expand All @@ -80,18 +80,18 @@
};
})();

export function getOutputType(node: PoseGraphNode, outputId: OutputKey) {
export function getOutputType (node: PoseGraphNode, outputId: OutputKey) {

Check failure on line 83 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function

Check failure on line 83 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing return type on function
if (node instanceof PoseNode) {
return PoseGraphType.POSE;
} else if (node instanceof PureValueNode) {
const outputIndex = Number(outputId);
if (outputIndex < 0 || outputIndex >= node.outputCount) {
throw new Error(`${node} does not have specified output key ${outputId}`);

Check warning on line 89 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "PureValueNode" of template literal expression

Check warning on line 89 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "PureValueNode" of template literal expression
} else {
return node.getOutputType(outputIndex);
}
} else {
throw new Error(`${node} does not have specified output key.`);

Check warning on line 94 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "PoseGraphNode" of template literal expression

Check warning on line 94 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "PoseGraphNode" of template literal expression
}
}

Expand All @@ -105,11 +105,11 @@

const inputMetadata = getInputMetadata(consumerNode, key);
if (!inputMetadata) {
error(`Consumer node does not have such specified input key ${key}`);

Check warning on line 108 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "NodeInputPath" of template literal expression

Check warning on line 108 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "NodeInputPath" of template literal expression
return;
}

let outputIndex = 0;
const outputIndex = 0;
let outputType: PoseGraphType;
if (producer instanceof PureValueNode) {
if (typeof outputKey !== 'number') {
Expand All @@ -118,7 +118,7 @@
}
const outputIndex = Number(outputKey);
if (outputIndex < 0 || outputIndex >= producer.outputCount) {
error(`Producer node does not have such specified output key ${key}`);

Check warning on line 121 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "NodeInputPath" of template literal expression

Check warning on line 121 in cocos/animation/marionette/pose-graph/op/internal.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "NodeInputPath" of template literal expression
return;
}
outputType = producer.getOutputType(outputIndex);
Expand All @@ -129,7 +129,7 @@
}
outputType = PoseGraphType.POSE;
}

const inputType = inputMetadata.type;
if (inputType !== outputType) {
error(`Type mismatch: input has type ${PoseGraphType[inputType]}, output has type ${PoseGraphType[outputType]}.`);
Expand Down Expand Up @@ -167,7 +167,7 @@
graph.getShell(node)?.deleteBinding(key);
}

export function connectOutputNode(graph: PoseGraph, producer: PoseNode) {
export function connectOutputNode (graph: PoseGraph, producer: PoseNode) {
const { outputNode } = graph;
const outputNodeInputKeys = getInputKeys(outputNode);
assertIsTrue(outputNodeInputKeys.length === 1);
Expand All @@ -192,7 +192,7 @@
const [
propertyKey,
elementIndex = -1,
] = inputKey;
] = inputKey;
const property = node[propertyKey];
if (!Array.isArray(property)) {
return property;
Expand All @@ -203,7 +203,7 @@
return property[elementIndex];
}

export function isWellFormedInputKey(test: unknown): test is PoseGraphInputKey {
export function isWellFormedInputKey (test: unknown): test is PoseGraphInputKey {
if (!Array.isArray(test)) {
return false;
}
Expand Down
12 changes: 8 additions & 4 deletions cocos/animation/marionette/pose-graph/pose-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ export abstract class PoseNode extends PoseGraphNode {

if (POSE_NODE_EVALUATION_STACK_ORDER_DEBUG_ENABLED) {
// The stack should certainly increase 1.
assertIsTrue(context._stackSize_debugging === stackSizeBefore + 1,
`PoseNode.doEvaluate() should certainly push a pose node onto the stack and return it.`);
assertIsTrue(
context._stackSize_debugging === stackSizeBefore + 1,
`PoseNode.doEvaluate() should certainly push a pose node onto the stack and return it.`,
);
// The returned pose should be the increased pose, that's,
// can not return a already-popped pose.
assertIsTrue(context._isStackTopPose_debugging(pose),
`PoseNode.doEvaluate() should certainly push a pose node onto the stack and return it.`);
assertIsTrue(
context._isStackTopPose_debugging(pose),
`PoseNode.doEvaluate() should certainly push a pose node onto the stack and return it.`,
);
}

const currentSpace = pose._poseTransformSpace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,7 @@ class EvaluationRecord {
const item = items[iPose];
// Reset starting weight as current weight.
// Don't use `item.weight` since it's absolute weight.
item.selfSourceWeight = lerp(
item.selfSourceWeight, item.selfTargetWeight, oldUniformTransitionRatio,
);
item.selfSourceWeight = lerp(item.selfSourceWeight, item.selfTargetWeight, oldUniformTransitionRatio);
if (iPose === newChoseIndex) {
item.selfTargetWeight = 1.0;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ export const solveTwoBoneIK = ((): (root: Transform, middle: Transform, end: Tra
const cacheVec3_2 = new Vec3();
return (
out: Quat,
sourceOrigin: Readonly<Vec3>, sourceDestination: Readonly<Vec3>,
targetOrigin: Readonly<Vec3>, targetDestination: Readonly<Vec3>,
sourceOrigin: Readonly<Vec3>,
sourceDestination: Readonly<Vec3>,
targetOrigin: Readonly<Vec3>,
targetDestination: Readonly<Vec3>,
// eslint-disable-next-line arrow-body-style
): Quat => {
return Quat.rotationTo(
Expand Down Expand Up @@ -106,16 +108,20 @@ export const solveTwoBoneIK = ((): (root: Transform, middle: Transform, end: Tra

const qA = calculateRotationBetweenRays(
cacheQuat,
pA, pB,
pA, bSolved,
pA,
pB,
pA,
bSolved,
);
Quat.multiply(qA, qA, root.rotation);
root.rotation = qA;

const qB = calculateRotationBetweenRays(
cacheQuat,
pB, pC,
bSolved, cSolved,
pB,
pC,
bSolved,
cSolved,
);
Quat.multiply(qB, qB, middle.rotation);
middle.rotation = qB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ const debuggerMap = new WeakMap<object, TwoBoneIKDebugger>();

export function debugTwoBoneIKDraw (
key: unknown,
a: Readonly<Vec3>, b: Readonly<Vec3>, c: Readonly<Vec3>,
a: Readonly<Vec3>,
b: Readonly<Vec3>,
c: Readonly<Vec3>,
): void {
if (typeof key !== 'object' || !key) {
return;
Expand Down
2 changes: 1 addition & 1 deletion cocos/animation/marionette/pose-graph/pure-value-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export abstract class PureValueNode extends PoseGraphNode {
return this._outputTypes.length;
}

public getOutputType (outputIndex: number):PoseGraphType {
public getOutputType (outputIndex: number): PoseGraphType {
return this._outputTypes[outputIndex];
}

Expand Down
6 changes: 4 additions & 2 deletions cocos/animation/tracks/array-track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ export class RealArrayTrack extends Track {
this._channels.splice(value);
} else if (value > nChannels) {
this._channels.push(
...Array.from({ length: value - nChannels },
(): Channel<RealCurve> => new Channel<RealCurve>(new RealCurve())),
...Array.from(
{ length: value - nChannels },
(): Channel<RealCurve> => new Channel<RealCurve>(new RealCurve()),
),
);
}
}
Expand Down
6 changes: 4 additions & 2 deletions cocos/audio/audio-downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ export function loadAudioPlayer (url: string, options: Record<string, any>, onCo
});
}

function createAudioClip (id: string,
function createAudioClip (
id: string,
data: AudioMeta,
options: Record<string, any>,
onComplete: ((err: Error | null, data?: AudioClip | null) => void)): void {
onComplete: ((err: Error | null, data?: AudioClip | null) => void),
): void {
const out = new AudioClip();
out._nativeUrl = id;
out._nativeAsset = data;
Expand Down
7 changes: 5 additions & 2 deletions cocos/audio/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ replaceProperty(AudioClip, 'AudioClip', [
]);

// deprecate AudioClip property
markAsWarning(AudioClip.prototype, 'AudioClip.prototype',
markAsWarning(
AudioClip.prototype,
'AudioClip.prototype',
[
'state',
'play',
Expand All @@ -53,4 +55,5 @@ markAsWarning(AudioClip.prototype, 'AudioClip.prototype',
].map((item) => ({
name: item,
suggest: `please use AudioSource.prototype.${item} instead`,
})));
})),
);
8 changes: 4 additions & 4 deletions cocos/core/data/custom-serializable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface SerializationOutput {
writeSuper(): void;
}

export type SerializationContext = {
export interface SerializationContext {
/**
* The main serializing asset or root node in the scene/prefab passed to the serialization procedure.
*/
Expand All @@ -87,17 +87,17 @@ export type SerializationContext = {
* Customized arguments passed to serialization procedure.
*/
customArguments: Record<PropertyKey, unknown>;
};
}

/**
* @engineInternal
*/
export type DeserializationContext = {
export interface DeserializationContext {
/**
* True if the deserialization procedure is deserializing from CCON.
*/
fromCCON: boolean;
};
}

export interface CustomSerializable {
[serializeTag](output: SerializationOutput, context: SerializationContext): void;
Expand Down
Loading
Loading