should only be applying rotation and scaling when transforming a normal
This commit is contained in:
parent
36f319a881
commit
70ccaedb0a
|
@ -172,7 +172,7 @@ public class ChunkVertexGenerator {
|
||||||
// transform if applicable... (this will probably just be per-tile rotation)
|
// transform if applicable... (this will probably just be per-tile rotation)
|
||||||
if (transform != null) {
|
if (transform != null) {
|
||||||
vertex.position.mul(transform);
|
vertex.position.mul(transform);
|
||||||
vertex.normal.mul(transform);
|
vertex.normal.rot(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
// translate vertex into "world/tilemap space"
|
// translate vertex into "world/tilemap space"
|
||||||
|
|
|
@ -145,7 +145,7 @@ public class ModelTileMesh extends TileMesh {
|
||||||
// TODO: better to throw exception (or check beforehand) if this is missing? setting zero's doesn't feel like the best solution
|
// TODO: better to throw exception (or check beforehand) if this is missing? setting zero's doesn't feel like the best solution
|
||||||
if (meshPart.mesh.getVertexAttribute(VertexAttributes.Usage.Normal) != null) {
|
if (meshPart.mesh.getVertexAttribute(VertexAttributes.Usage.Normal) != null) {
|
||||||
tmpNormal.set(vertices.get(offset), vertices.get(offset + 1), vertices.get(offset + 2))
|
tmpNormal.set(vertices.get(offset), vertices.get(offset + 1), vertices.get(offset + 2))
|
||||||
.mul(transform);
|
.rot(transform);
|
||||||
this.vertices.setNor(tmpNormal);
|
this.vertices.setNor(tmpNormal);
|
||||||
offset += 3;
|
offset += 3;
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in a new issue