Skip to content

Commit

Permalink
fix: getPositionData missing slice of vertex positions (#12375)
Browse files Browse the repository at this point in the history
* fix: getPositionData missing slice of vertex positions

* make _getPositionData only call getPositionData when data is not null
  • Loading branch information
BlakeOne authored Apr 11, 2022
1 parent a578406 commit f94bdc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/dev/core/src/Meshes/abstractMesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
* @returns the position data
*/
public getPositionData(applySkeleton: boolean = false, applyMorph: boolean = false, data?: Nullable<FloatArray>): Nullable<FloatArray> {
data = data ?? this.getVerticesData(VertexBuffer.PositionKind);
data = data ?? Tools.Slice(this.getVerticesData(VertexBuffer.PositionKind));

if (data && applyMorph && this.morphTargetManager) {
let faceIndexCount = 0;
Expand Down Expand Up @@ -1563,9 +1563,10 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
this._internalAbstractMeshDataInfo._positions[i] = pos[i]?.clone() || new Vector3();
}
}
return this.getPositionData(applySkeleton, applyMorph, data);
}

return this.getPositionData(applySkeleton, applyMorph, data);
return data;
}

/** @hidden */
Expand Down

0 comments on commit f94bdc9

Please sign in to comment.