Cleaned up partinstance.h, moved CFrame to PVInstance
This commit is contained in:
@@ -342,7 +342,7 @@ void eject(PartInstance * colliding, PartInstance * collider)
|
||||
if(colliding == collider || !colliding->canCollide || !collider->canCollide)
|
||||
return;
|
||||
if(G3D::CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(collider->getBox(), colliding->getBox()))
|
||||
collider->setVelocity(collider->getVelocity().reflectionDirection(colliding->cFrame.upVector())/1.3F);
|
||||
collider->setVelocity(collider->getVelocity().reflectionDirection(colliding->getCFrame().upVector())/1.3F);
|
||||
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ void Application::onGraphics(RenderDevice* rd) {
|
||||
{
|
||||
Vector3 size = part->getSize();
|
||||
Vector3 pos = part->getPosition();
|
||||
drawOutline(Vector3(0+size.x/2, 0+size.y/2, 0+size.z/2) ,Vector3(0-size.x/2,0-size.y/2,0-size.z/2), rd, lighting, Vector3(size.x/2, size.y/2, size.z/2), Vector3(pos.x, pos.y, pos.z), part->getCFrameRenderBased());
|
||||
drawOutline(Vector3(0+size.x/2, 0+size.y/2, 0+size.z/2) ,Vector3(0-size.x/2,0-size.y/2,0-size.z/2), rd, lighting, Vector3(size.x/2, size.y/2, size.z/2), Vector3(pos.x, pos.y, pos.z), part->getCFrame());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ void GroupInstance::render(RenderDevice * rd)
|
||||
Vector3 vec = Vector3(0,0,0);
|
||||
Vector3 up = Vector3(0,8,0);
|
||||
rd->setColor(getControllerColor(controller));
|
||||
rd->setObjectToWorldMatrix(primaryPart->cFrame);
|
||||
rd->setObjectToWorldMatrix(primaryPart->getCFrame());
|
||||
rd->beforePrimitive();
|
||||
|
||||
glBegin(GL_LINES);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
PartInstance::PartInstance(void) : _bevelSize(0.07f), _parseVert(0), _debugTimer(0)
|
||||
PartInstance::PartInstance(void)
|
||||
{
|
||||
PVInstance::PVInstance();
|
||||
glList = glGenLists(1);
|
||||
@@ -102,7 +102,7 @@ void PartInstance::setParent(Instance* prnt)
|
||||
}
|
||||
}
|
||||
|
||||
PartInstance::PartInstance(const PartInstance &oinst) : _bevelSize(0.07f), _parseVert(0), _debugTimer(0)
|
||||
PartInstance::PartInstance(const PartInstance &oinst)
|
||||
{
|
||||
PVInstance::PVInstance(oinst);
|
||||
glList = glGenLists(1);
|
||||
@@ -204,11 +204,6 @@ void PartInstance::setCFrame(CoordinateFrame coordinateFrame)
|
||||
position = coordinateFrame.translation;
|
||||
changed = true;
|
||||
}
|
||||
// Can probably be deleted
|
||||
CoordinateFrame PartInstance::getCFrameRenderBased()
|
||||
{
|
||||
return cFrame;//CoordinateFrame(getCFrame().rotation,Vector3(getCFrame().translation.x, getCFrame().translation.y, getCFrame().translation.z));
|
||||
}
|
||||
|
||||
bool PartInstance::collides(PartInstance * part)
|
||||
{
|
||||
@@ -231,16 +226,15 @@ bool PartInstance::collides(PartInstance * part)
|
||||
Box PartInstance::getBox()
|
||||
{
|
||||
Box box = Box(Vector3(size.x/2, size.y/2, size.z/2) ,Vector3(-size.x/2,-size.y/2,-size.z/2));
|
||||
CoordinateFrame c = getCFrameRenderBased();
|
||||
CoordinateFrame c = getCFrame();
|
||||
itemBox = c.toWorldSpace(box);
|
||||
return itemBox;
|
||||
}
|
||||
Sphere PartInstance::getSphere()
|
||||
{
|
||||
Sphere sphere = Sphere(Vector3(0,0,0), size.y/2);
|
||||
CoordinateFrame c = getCFrameRenderBased();
|
||||
//itemBox = c.toWorldSpace(Sphere);
|
||||
return sphere;//itemBox;
|
||||
CoordinateFrame c = getCFrame();
|
||||
return sphere;
|
||||
}
|
||||
|
||||
bool PartInstance::collides(Box box)
|
||||
|
||||
Reference in New Issue
Block a user