From d0d67af395b336d1847fe1097d09e532deb0714d Mon Sep 17 00:00:00 2001 From: JESTERRRRRR Date: Thu, 4 Oct 2018 23:29:21 +0100 Subject: [PATCH] Particle tile number/UV calculation change (#930) * Update ParticlePointMesh.java * Update ParticleTriMesh.java --- jme3-core/src/main/java/com/jme3/effect/ParticlePointMesh.java | 2 +- jme3-core/src/main/java/com/jme3/effect/ParticleTriMesh.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/effect/ParticlePointMesh.java b/jme3-core/src/main/java/com/jme3/effect/ParticlePointMesh.java index 3f56e483b..b9c0f43d8 100644 --- a/jme3-core/src/main/java/com/jme3/effect/ParticlePointMesh.java +++ b/jme3-core/src/main/java/com/jme3/effect/ParticlePointMesh.java @@ -144,7 +144,7 @@ public class ParticlePointMesh extends ParticleMesh { colors.putInt(p.color.asIntABGR()); int imgX = p.imageIndex % imagesX; - int imgY = (p.imageIndex - imgX) / imagesY; + int imgY = p.imageIndex/imagesX; float startX = ((float) imgX) / imagesX; float startY = ((float) imgY) / imagesY; diff --git a/jme3-core/src/main/java/com/jme3/effect/ParticleTriMesh.java b/jme3-core/src/main/java/com/jme3/effect/ParticleTriMesh.java index 8002197b0..16b9071d6 100644 --- a/jme3-core/src/main/java/com/jme3/effect/ParticleTriMesh.java +++ b/jme3-core/src/main/java/com/jme3/effect/ParticleTriMesh.java @@ -251,7 +251,7 @@ public class ParticleTriMesh extends ParticleMesh { if (uniqueTexCoords){ int imgX = p.imageIndex % imagesX; - int imgY = (p.imageIndex - imgX) / imagesY; + int imgY = p.imageIndex / imagesX; float startX = ((float) imgX) / imagesX; float startY = ((float) imgY) / imagesY;