collada_urdf: fix mesh loading bug

This commit is contained in:
tfield 2010-05-14 01:10:36 +00:00
parent ddefd56560
commit 37b000d41d
1 changed files with 8 additions and 2 deletions

View File

@ -95,10 +95,16 @@ void STLLoader::readBinary() {
int face_num = readLongInt(); int face_num = readLongInt();
for (int iface = 0; iface < face_num; iface++) { for (int iface = 0; iface < face_num; iface++) {
Vector3 normal(readFloat(), readFloat(), readFloat()); float nx = readFloat();
float ny = readFloat();
float nz = readFloat();
Vector3 normal(nx, ny, nz);
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
Vector3 vertex(readFloat(), readFloat(), readFloat()); float vx = readFloat();
float vy = readFloat();
float vz = readFloat();
Vector3 vertex(vx, vy, vz);
int index = mesh_->getVertexIndex(vertex); int index = mesh_->getVertexIndex(vertex);
if (index == -1) { if (index == -1) {