X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGraphic%2FDecal.cpp;h=335a4bc9471d2a6e74de93f39d0da3af9fbebefe;hb=e468592233fbcc6ab8d7892cc0d7afa05dbbee39;hp=cb1ee99bf3369160a97ea26c615a1ab957d17fc4;hpb=22b201f5b0fb2802e53e0b4c90b806a9147da730;p=lugaru.git diff --git a/Source/Graphic/Decal.cpp b/Source/Graphic/Decal.cpp index cb1ee99..335a4bc 100644 --- a/Source/Graphic/Decal.cpp +++ b/Source/Graphic/Decal.cpp @@ -105,100 +105,100 @@ Decal::Decal(XYZ _position, decal_type _type, float _opacity, float _rotation, f { float placex, placez; if (which == 0) { - placex = vertex[model.Triangles[i].vertex[0]].x; - placez = vertex[model.Triangles[i].vertex[0]].z; + placex = model.vertex[model.Triangles[i].vertex[0]].x; + placez = model.vertex[model.Triangles[i].vertex[0]].z; texcoords[0][0] = (placex - position.x) / (size) / 2 + .5; texcoords[0][1] = (placez - position.z) / (size) / 2 + .5; vertex[0].x = placex; vertex[0].z = placez; - vertex[0].y = vertex[model.Triangles[i].vertex[0]].y; + vertex[0].y = model.vertex[model.Triangles[i].vertex[0]].y; - placex = vertex[model.Triangles[i].vertex[1]].x; - placez = vertex[model.Triangles[i].vertex[1]].z; + placex = model.vertex[model.Triangles[i].vertex[1]].x; + placez = model.vertex[model.Triangles[i].vertex[1]].z; texcoords[1][0] = (placex - position.x) / (size) / 2 + .5; texcoords[1][1] = (placez - position.z) / (size) / 2 + .5; vertex[1].x = placex; vertex[1].z = placez; - vertex[1].y = vertex[model.Triangles[i].vertex[1]].y; + vertex[1].y = model.vertex[model.Triangles[i].vertex[1]].y; - placex = vertex[model.Triangles[i].vertex[2]].x; - placez = vertex[model.Triangles[i].vertex[2]].z; + placex = model.vertex[model.Triangles[i].vertex[2]].x; + placez = model.vertex[model.Triangles[i].vertex[2]].z; texcoords[2][0] = (placex - position.x) / (size) / 2 + .5; texcoords[2][1] = (placez - position.z) / (size) / 2 + .5; vertex[2].x = placex; vertex[2].z = placez; - vertex[2].y = vertex[model.Triangles[i].vertex[2]].y; + vertex[2].y = model.vertex[model.Triangles[i].vertex[2]].y; } else if (which == 1) { - placex = vertex[model.Triangles[i].vertex[0]].y; - placez = vertex[model.Triangles[i].vertex[0]].z; + placex = model.vertex[model.Triangles[i].vertex[0]].y; + placez = model.vertex[model.Triangles[i].vertex[0]].z; texcoords[0][0] = (placex - position.y) / (size) / 2 + .5; texcoords[0][1] = (placez - position.z) / (size) / 2 + .5; - vertex[0].x = vertex[model.Triangles[i].vertex[0]].x; + vertex[0].x = model.vertex[model.Triangles[i].vertex[0]].x; vertex[0].z = placez; vertex[0].y = placex; - placex = vertex[model.Triangles[i].vertex[1]].y; - placez = vertex[model.Triangles[i].vertex[1]].z; + placex = model.vertex[model.Triangles[i].vertex[1]].y; + placez = model.vertex[model.Triangles[i].vertex[1]].z; texcoords[1][0] = (placex - position.y) / (size) / 2 + .5; texcoords[1][1] = (placez - position.z) / (size) / 2 + .5; - vertex[1].x = vertex[model.Triangles[i].vertex[1]].x; + vertex[1].x = model.vertex[model.Triangles[i].vertex[1]].x; vertex[1].z = placez; vertex[1].y = placex; - placex = vertex[model.Triangles[i].vertex[2]].y; - placez = vertex[model.Triangles[i].vertex[2]].z; + placex = model.vertex[model.Triangles[i].vertex[2]].y; + placez = model.vertex[model.Triangles[i].vertex[2]].z; texcoords[2][0] = (placex - position.y) / (size) / 2 + .5; texcoords[2][1] = (placez - position.z) / (size) / 2 + .5; - vertex[2].x = vertex[model.Triangles[i].vertex[2]].x; + vertex[2].x = model.vertex[model.Triangles[i].vertex[2]].x; vertex[2].z = placez; vertex[2].y = placex; } else { - placex = vertex[model.Triangles[i].vertex[0]].x; - placez = vertex[model.Triangles[i].vertex[0]].y; + placex = model.vertex[model.Triangles[i].vertex[0]].x; + placez = model.vertex[model.Triangles[i].vertex[0]].y; texcoords[0][0] = (placex - position.x) / (size) / 2 + .5; texcoords[0][1] = (placez - position.y) / (size) / 2 + .5; vertex[0].x = placex; - vertex[0].z = vertex[model.Triangles[i].vertex[0]].z; + vertex[0].z = model.vertex[model.Triangles[i].vertex[0]].z; vertex[0].y = placez; - placex = vertex[model.Triangles[i].vertex[1]].x; - placez = vertex[model.Triangles[i].vertex[1]].y; + placex = model.vertex[model.Triangles[i].vertex[1]].x; + placez = model.vertex[model.Triangles[i].vertex[1]].y; texcoords[1][0] = (placex - position.x) / (size) / 2 + .5; texcoords[1][1] = (placez - position.y) / (size) / 2 + .5; vertex[1].x = placex; - vertex[1].z = vertex[model.Triangles[i].vertex[1]].z; + vertex[1].z = model.vertex[model.Triangles[i].vertex[1]].z; vertex[1].y = placez; - placex = vertex[model.Triangles[i].vertex[2]].x; - placez = vertex[model.Triangles[i].vertex[2]].y; + placex = model.vertex[model.Triangles[i].vertex[2]].x; + placez = model.vertex[model.Triangles[i].vertex[2]].y; texcoords[2][0] = (placex - position.x) / (size) / 2 + .5; texcoords[2][1] = (placez - position.y) / (size) / 2 + .5; vertex[2].x = placex; - vertex[2].z = vertex[model.Triangles[i].vertex[2]].z; + vertex[2].z = model.vertex[model.Triangles[i].vertex[2]].z; vertex[2].y = placez; } }