Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mesh without vertex normals to SPS #14464

Merged
merged 1 commit into from Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/dev/core/src/Particles/solidParticleSystem.ts
Expand Up @@ -759,7 +759,7 @@ export class SolidParticleSystem implements IDisposable {
/**
* Adds some particles to the SPS from the model shape. Returns the shape id.
* Please read the doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/immutable_sps
* @param mesh is any Mesh object that will be used as a model for the solid particles.
* @param mesh is any Mesh object that will be used as a model for the solid particles. If the mesh does not have vertex normals, it will turn on the recomputeNormals attribute.
* @param nb (positive integer) the number of particles to be created from this model
* @param options {positionFunction} is an optional javascript function to called for each particle on SPS creation.
* {vertexFunction} is an optional javascript function to called for each vertex of each particle on SPS creation
Expand All @@ -777,7 +777,7 @@ export class SolidParticleSystem implements IDisposable {
const meshNor = <FloatArray>mesh.getVerticesData(VertexBuffer.NormalKind);
this.recomputeNormals = meshNor ? false : true;
const indices = Array.from(meshInd);
const shapeNormals = Array.from(meshNor);
const shapeNormals = meshNor ? Array.from(meshNor) : [];
const shapeColors = meshCol ? Array.from(meshCol) : [];
const storage = options && options.storage ? options.storage : null;
let bbInfo: Nullable<BoundingInfo> = null;
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/tools/tests/test/visualization/config.json
Expand Up @@ -1768,6 +1768,11 @@
"title": "Child overriding parent font properties",
"playgroundId": "#QFK9K4#25",
"referenceImage": "Childoverridingparentfontproperties.png"
},
{
"title": "Add mesh without vertex normals to SPS",
"playgroundId": "#H1SEDF#1",
"referenceImage": "AddmeshwithoutvertexnormalstoSPS.png"
}
]
}