From 570f3a88bc1e00c6410205139d55c16c684311d4 Mon Sep 17 00:00:00 2001 From: durswd Date: Wed, 29 Nov 2023 14:26:43 +0900 Subject: [PATCH 1/2] Fix a bug where a particle is not spawned from the last polygon --- Dev/Cpp/Effekseer/Effekseer/Model/Model.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dev/Cpp/Effekseer/Effekseer/Model/Model.cpp b/Dev/Cpp/Effekseer/Effekseer/Model/Model.cpp index 7948dcc402..817045796c 100644 --- a/Dev/Cpp/Effekseer/Effekseer/Model/Model.cpp +++ b/Dev/Cpp/Effekseer/Effekseer/Model/Model.cpp @@ -139,7 +139,7 @@ Model::Emitter Model::GetEmitter(IRandObject* g, int32_t time, CoordinateSystem return GetEmitterFromVertex(g, time, coordinate, magnification); } - int32_t faceInd = (int32_t)((GetFaceCount(time) - 1) * (g->GetRand())); + int32_t faceInd = static_cast(GetFaceCount(time) * g->GetRand()); faceInd = Clamp(faceInd, GetFaceCount(time) - 1, 0); const Face& face = GetFaces(time)[faceInd]; const Vertex& v0 = GetVertexes(time)[face.Indexes[0]]; @@ -185,7 +185,7 @@ Model::Emitter Model::GetEmitterFromVertex(IRandObject* g, int32_t time, Coordin return Model::Emitter{}; } - int32_t vertexInd = (int32_t)((GetVertexCount(time) - 1) * (g->GetRand())); + int32_t vertexInd = static_cast(GetVertexCount(time) * g->GetRand()); vertexInd = Clamp(vertexInd, GetVertexCount(time) - 1, 0); const Vertex& v = GetVertexes(time)[vertexInd]; @@ -246,7 +246,7 @@ Model::Emitter Model::GetEmitterFromFace(IRandObject* g, int32_t time, Coordinat return Model::Emitter{}; } - int32_t faceInd = (int32_t)((GetFaceCount(time) - 1) * (g->GetRand())); + int32_t faceInd = static_cast(GetFaceCount(time) * g->GetRand()); faceInd = Clamp(faceInd, GetFaceCount(time) - 1, 0); const Face& face = GetFaces(time)[faceInd]; const Vertex& v0 = GetVertexes(time)[face.Indexes[0]]; From c508f0f78805a52cb4b622315c5b995f3f3d87bf Mon Sep 17 00:00:00 2001 From: durswd Date: Wed, 29 Nov 2023 16:22:12 +0900 Subject: [PATCH 2/2] fix --- TestData | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestData b/TestData index 64a3d06ee8..80f1402604 160000 --- a/TestData +++ b/TestData @@ -1 +1 @@ -Subproject commit 64a3d06ee86eb510a412dc4197eb10909ae31967 +Subproject commit 80f14026041606709c4bc9c39102f9953df954ca