Removed legacy renderer, added cylinder pluses
This commit is contained in:
@@ -248,120 +248,7 @@ bool PartInstance::collides(Box box)
|
||||
return CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(getBox(), box);
|
||||
}
|
||||
|
||||
/*void PartInstance::addPlus(Vector3 v1)
|
||||
{
|
||||
float renderY = max(size.z, max(size.x, size.y))/2 * 0.775;
|
||||
Vector3 vx1 = v1 + Vector3(0, -renderY, -0.1f);
|
||||
Vector3 vx2 = v1 + Vector3(0, -renderY, 0.1f);
|
||||
Vector3 vx3 = v1 + Vector3(0, renderY, 0.1f);
|
||||
|
||||
addVertex(vx1,Color3::WHITE);
|
||||
addVertex(vx2,Color3::WHITE);
|
||||
addVertex(vx3,Color3::WHITE);
|
||||
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||
addSingularNormal(cross(vx2-vx1,vx3-vx1).direction());
|
||||
addSingularNormal(cross(vx3-vx2,vx1-vx2).direction());
|
||||
addSingularNormal(cross(vx1-vx3,vx2-vx3).direction());
|
||||
|
||||
vx1 = v1 + Vector3(0, renderY, 0.1f);
|
||||
vx2 = v1 + Vector3(0, renderY, -0.1f);
|
||||
vx3 = v1 + Vector3(0, -renderY, -0.1f);
|
||||
|
||||
addVertex(vx1,Color3::WHITE);
|
||||
addVertex(vx2,Color3::WHITE);
|
||||
addVertex(vx3,Color3::WHITE);
|
||||
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||
addSingularNormal(cross(vx2-vx1,vx3-vx1).direction());
|
||||
addSingularNormal(cross(vx3-vx2,vx1-vx2).direction());
|
||||
addSingularNormal(cross(vx1-vx3,vx2-vx3).direction());
|
||||
|
||||
vx3 = v1 + Vector3(0, -0.1f, -renderY);
|
||||
vx2 = v1 + Vector3(0, 0.1f, -renderY);
|
||||
vx1 = v1 + Vector3(0, 0.1f, renderY);
|
||||
|
||||
addVertex(vx1,Color3::WHITE);
|
||||
addVertex(vx2,Color3::WHITE);
|
||||
addVertex(vx3,Color3::WHITE);
|
||||
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||
addSingularNormal(cross(vx2-vx1,vx3-vx1).direction());
|
||||
addSingularNormal(cross(vx3-vx2,vx1-vx2).direction());
|
||||
addSingularNormal(cross(vx1-vx3,vx2-vx3).direction());
|
||||
|
||||
vx3 = v1 + Vector3(0, 0.1f, renderY);
|
||||
vx2 = v1 + Vector3(0, -0.1f, renderY);
|
||||
vx1 = v1 + Vector3(0, -0.1f, -renderY);
|
||||
|
||||
addVertex(vx1,Color3::WHITE);
|
||||
addVertex(vx2,Color3::WHITE);
|
||||
addVertex(vx3,Color3::WHITE);
|
||||
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||
addSingularNormal(cross(vx2-vx1,vx3-vx1).direction());
|
||||
addSingularNormal(cross(vx3-vx2,vx1-vx2).direction());
|
||||
addSingularNormal(cross(vx1-vx3,vx2-vx3).direction());
|
||||
|
||||
}
|
||||
|
||||
|
||||
void PartInstance::addPlus2(Vector3 v1)
|
||||
{
|
||||
float renderY = max(size.z, max(size.x, size.y))/2 * 0.775;
|
||||
Vector3 vx3 = v1 + Vector3(0, -renderY, -0.1f);
|
||||
Vector3 vx2 = v1 + Vector3(0, -renderY, 0.1f);
|
||||
Vector3 vx1 = v1 + Vector3(0, renderY, 0.1f);
|
||||
|
||||
addVertex(vx1,Color3::WHITE);
|
||||
addVertex(vx2,Color3::WHITE);
|
||||
addVertex(vx3,Color3::WHITE);
|
||||
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||
addSingularNormal(cross(vx2-vx1,vx3-vx1).direction());
|
||||
addSingularNormal(cross(vx3-vx2,vx1-vx2).direction());
|
||||
addSingularNormal(cross(vx1-vx3,vx2-vx3).direction());
|
||||
|
||||
vx3 = v1 + Vector3(0, renderY, 0.1f);
|
||||
vx2 = v1 + Vector3(0, renderY, -0.1f);
|
||||
vx1 = v1 + Vector3(0, -renderY, -0.1f);
|
||||
|
||||
addVertex(vx1,Color3::WHITE);
|
||||
addVertex(vx2,Color3::WHITE);
|
||||
addVertex(vx3,Color3::WHITE);
|
||||
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||
addSingularNormal(cross(vx2-vx1,vx3-vx1).direction());
|
||||
addSingularNormal(cross(vx3-vx2,vx1-vx2).direction());
|
||||
addSingularNormal(cross(vx1-vx3,vx2-vx3).direction());
|
||||
|
||||
vx1 = v1 + Vector3(0, -0.1f, -renderY);
|
||||
vx2 = v1 + Vector3(0, 0.1f, -renderY);
|
||||
vx3 = v1 + Vector3(0, 0.1f, renderY);
|
||||
|
||||
addVertex(vx1,Color3::WHITE);
|
||||
addVertex(vx2,Color3::WHITE);
|
||||
addVertex(vx3,Color3::WHITE);
|
||||
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||
addSingularNormal(cross(vx2-vx1,vx3-vx1).direction());
|
||||
addSingularNormal(cross(vx3-vx2,vx1-vx2).direction());
|
||||
addSingularNormal(cross(vx1-vx3,vx2-vx3).direction());
|
||||
|
||||
vx1 = v1 + Vector3(0, 0.1f, renderY);
|
||||
vx2 = v1 + Vector3(0, -0.1f, renderY);
|
||||
vx3 = v1 + Vector3(0, -0.1f, -renderY);
|
||||
|
||||
addVertex(vx1,Color3::WHITE);
|
||||
addVertex(vx2,Color3::WHITE);
|
||||
addVertex(vx3,Color3::WHITE);
|
||||
//addNormals(cross(v2-v1,v3-v1).direction());
|
||||
addSingularNormal(cross(vx2-vx1,vx3-vx1).direction());
|
||||
addSingularNormal(cross(vx3-vx2,vx1-vx2).direction());
|
||||
addSingularNormal(cross(vx1-vx3,vx2-vx3).direction());
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//int rings = 15;
|
||||
//int sectors = 15;
|
||||
void PartInstance::render(RenderDevice* rd) {
|
||||
//if(nameShown)
|
||||
//postRenderStack.push_back(this);
|
||||
if (changed)
|
||||
{
|
||||
|
||||
@@ -381,8 +268,6 @@ void PartInstance::render(RenderDevice* rd) {
|
||||
rd->setObjectToWorldMatrix(cFrame);
|
||||
glCallList(glList);
|
||||
postRender(rd);
|
||||
//rd->setObjectToWorldMatrix(cFrame);
|
||||
|
||||
}
|
||||
|
||||
PartInstance::~PartInstance(void)
|
||||
|
||||
Reference in New Issue
Block a user