Fixed transformation of subentity bounding boxes.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5659 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2013-03-24 09:39:53 +00:00
parent a32d957d20
commit 0f25a6d7eb

View File

@ -5624,15 +5624,15 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
return; // TOO FAR AWAY
}
OOGL(glPushMatrix());
if ([self status] == STATUS_ACTIVE)
{
Vector abspos = position; // STATUS_ACTIVE means it is in control of it's own orientation
Vector abspos = position; // STATUS_ACTIVE means it is in control of its own orientation
Entity *last = nil;
Entity *father = [self owner];
OOMatrix r_mat;
OOGL(glPushMatrix());
while ((father)&&(father != last) &&father != NO_TARGET)
{
r_mat = [father drawRotationMatrix];
@ -5644,22 +5644,15 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
GLLoadOOMatrix([UNIVERSE viewMatrix]);
GLTranslateOOVector(abspos);
GLMultOOMatrix(rotMatrix);
[self drawImmediate:immediate translucent:translucent];
OOGL(glPopMatrix());
}
else
{
OOGL(glPushMatrix());
GLTranslateOOVector(position);
GLMultOOMatrix(rotMatrix);
[self drawImmediate:immediate translucent:translucent];
OOGL(glPopMatrix());
}
GLMultOOMatrix(rotMatrix);
[self drawImmediate:immediate translucent:translucent];
#ifndef NDEBUG
if (gDebugFlags & DEBUG_BOUNDING_BOXES)
{
@ -5667,6 +5660,8 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
}
#endif
OOGL(glPopMatrix());
OOVerifyOpenGLState();
}