Adding axis for debugging.
This commit is contained in:
parent
52446c765d
commit
ca1756c504
@ -26,12 +26,9 @@ namespace Ogre
|
|||||||
vecVertices.resize(m_listVertices.size());
|
vecVertices.resize(m_listVertices.size());
|
||||||
std::copy(m_listVertices.begin(), m_listVertices.end(), vecVertices.begin());
|
std::copy(m_listVertices.begin(), m_listVertices.end(), vecVertices.begin());
|
||||||
|
|
||||||
//vecIndices.resize(m_listTriangles.size() * 3);
|
|
||||||
for(std::vector<SurfaceVertexIterator>::iterator iterVertices = m_vecTriangleIndices.begin(); iterVertices != m_vecTriangleIndices.end(); ++iterVertices)
|
for(std::vector<SurfaceVertexIterator>::iterator iterVertices = m_vecTriangleIndices.begin(); iterVertices != m_vecTriangleIndices.end(); ++iterVertices)
|
||||||
{
|
{
|
||||||
std::vector<SurfaceVertex>::iterator iterVertex;
|
std::vector<SurfaceVertex>::iterator iterVertex = lower_bound(vecVertices.begin(), vecVertices.end(), **iterVertices);
|
||||||
|
|
||||||
iterVertex = lower_bound(vecVertices.begin(), vecVertices.end(), **iterVertices);
|
|
||||||
vecIndices.push_back(iterVertex - vecVertices.begin());
|
vecIndices.push_back(iterVertex - vecVertices.begin());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,124 +114,53 @@ namespace Ogre
|
|||||||
|
|
||||||
getRootSceneNode()->removeAndDestroyAllChildren();
|
getRootSceneNode()->removeAndDestroyAllChildren();
|
||||||
|
|
||||||
|
//Create Arrows
|
||||||
|
|
||||||
//Create surrounding box
|
ManualObject* xAxis = createManualObject("X-Axis");
|
||||||
//FIXME - should do this using indices
|
|
||||||
/*ManualObject* metalBox = createManualObject("MetalBox");
|
|
||||||
|
|
||||||
metalBox->begin("Examples/BumpyMetal",RenderOperation::OT_TRIANGLE_STRIP);
|
|
||||||
metalBox->position(0,0,0);
|
|
||||||
metalBox->textureCoord(0,0);
|
|
||||||
metalBox->normal(0,0,1);
|
|
||||||
metalBox->position(512,0,0);
|
|
||||||
metalBox->textureCoord(1,0);
|
|
||||||
metalBox->normal(0,0,1);
|
|
||||||
metalBox->position(0,512,0);
|
|
||||||
metalBox->textureCoord(0,1);
|
|
||||||
metalBox->normal(0,0,1);
|
|
||||||
metalBox->position(512,512,0);
|
|
||||||
metalBox->textureCoord(1,1);
|
|
||||||
metalBox->normal(0,0,1);
|
|
||||||
metalBox->end();*/
|
|
||||||
|
|
||||||
/*metalBox->begin("Examples/BumpyMetal",RenderOperation::OT_TRIANGLE_STRIP);
|
uint uArrowTotalLength = 256;
|
||||||
metalBox->position(0,0,0);
|
uint uArrowHeadLength = 8;
|
||||||
metalBox->textureCoord(0,0);
|
uint uArrowBarLength = uArrowTotalLength - uArrowHeadLength;
|
||||||
metalBox->normal(0,1,0);
|
|
||||||
metalBox->position(0,0,512);
|
|
||||||
metalBox->textureCoord(0,1);
|
|
||||||
metalBox->normal(0,1,0);
|
|
||||||
metalBox->position(512,0,0);
|
|
||||||
metalBox->textureCoord(1,0);
|
|
||||||
metalBox->normal(0,1,0);
|
|
||||||
metalBox->position(512,0,512);
|
|
||||||
metalBox->textureCoord(1,1);
|
|
||||||
metalBox->normal(0,1,0);
|
|
||||||
metalBox->end();*/
|
|
||||||
|
|
||||||
/*metalBox->begin("Examples/BumpyMetal",RenderOperation::OT_TRIANGLE_STRIP);
|
xAxis->begin("BaseWhiteNoLighting",RenderOperation::OT_TRIANGLE_LIST);
|
||||||
metalBox->position(0,0,0);
|
xAxis->position(0, -1,-1);
|
||||||
metalBox->textureCoord(0,0);
|
xAxis->position(uArrowBarLength, -1,-1);
|
||||||
metalBox->normal(1,0,0);
|
xAxis->position(0, 1,-1);
|
||||||
metalBox->position(0,512,0);
|
xAxis->position(uArrowBarLength, 1,-1);
|
||||||
metalBox->textureCoord(1,0);
|
xAxis->position(0, -1, 1);
|
||||||
metalBox->normal(1,0,0);
|
xAxis->position(uArrowBarLength, -1, 1);
|
||||||
metalBox->position(0,0,512);
|
xAxis->position(0, 1, 1);
|
||||||
metalBox->textureCoord(0,1);
|
xAxis->position(uArrowBarLength, 1, 1);
|
||||||
metalBox->normal(1,0,0);
|
|
||||||
metalBox->position(0,512,512);
|
|
||||||
metalBox->textureCoord(1,1);
|
|
||||||
metalBox->normal(1,0,0);
|
|
||||||
metalBox->end();
|
|
||||||
|
|
||||||
metalBox->begin("Examples/BumpyMetal",RenderOperation::OT_TRIANGLE_STRIP);
|
xAxis->position(uArrowBarLength, -2, -2);
|
||||||
metalBox->position(0,0,512);
|
xAxis->position(uArrowBarLength, 2, -2);
|
||||||
metalBox->textureCoord(0,0);
|
xAxis->position(uArrowBarLength, -2, 2);
|
||||||
metalBox->normal(0,0,-1);
|
xAxis->position(uArrowBarLength, 2, 2);
|
||||||
metalBox->position(0,512,512);
|
xAxis->position(uArrowTotalLength, 0, 0);
|
||||||
metalBox->textureCoord(0,1);
|
|
||||||
metalBox->normal(0,0,-1);
|
|
||||||
metalBox->position(512,0,512);
|
|
||||||
metalBox->textureCoord(1,0);
|
|
||||||
metalBox->normal(0,0,-1);
|
|
||||||
metalBox->position(512,512,512);
|
|
||||||
metalBox->textureCoord(1,1);
|
|
||||||
metalBox->normal(0,0,-1);
|
|
||||||
metalBox->end();
|
|
||||||
|
|
||||||
metalBox->begin("Examples/BumpyMetal",RenderOperation::OT_TRIANGLE_STRIP);
|
xAxis->index(0); xAxis->index(4); xAxis->index(2);
|
||||||
metalBox->position(0,512,0);
|
xAxis->index(2); xAxis->index(4); xAxis->index(6);
|
||||||
metalBox->textureCoord(0,0);
|
|
||||||
metalBox->normal(0,-1,0);
|
|
||||||
metalBox->position(512,512,0);
|
|
||||||
metalBox->textureCoord(1,0);
|
|
||||||
metalBox->normal(0,-1,0);
|
|
||||||
metalBox->position(0,512,512);
|
|
||||||
metalBox->textureCoord(0,1);
|
|
||||||
metalBox->normal(0,-1,0);
|
|
||||||
metalBox->position(512,512,512);
|
|
||||||
metalBox->textureCoord(1,1);
|
|
||||||
metalBox->normal(0,-1,0);
|
|
||||||
metalBox->end();
|
|
||||||
|
|
||||||
metalBox->begin("Examples/BumpyMetal",RenderOperation::OT_TRIANGLE_STRIP);
|
xAxis->index(7); xAxis->index(6); xAxis->index(4);
|
||||||
metalBox->position(512,0,0);
|
xAxis->index(4); xAxis->index(5); xAxis->index(7);
|
||||||
metalBox->textureCoord(0,0);
|
xAxis->index(0); xAxis->index(2); xAxis->index(3);
|
||||||
metalBox->normal(-1,0,0);
|
xAxis->index(3); xAxis->index(1); xAxis->index(0);
|
||||||
metalBox->position(512,0,512);
|
xAxis->index(2); xAxis->index(6); xAxis->index(7);
|
||||||
metalBox->textureCoord(0,1);
|
xAxis->index(7); xAxis->index(3); xAxis->index(2);
|
||||||
metalBox->normal(-1,0,0);
|
xAxis->index(0); xAxis->index(1); xAxis->index(5);
|
||||||
metalBox->position(512,512,0);
|
xAxis->index(5); xAxis->index(4); xAxis->index(0);
|
||||||
metalBox->textureCoord(1,0);
|
|
||||||
metalBox->normal(-1,0,0);
|
|
||||||
metalBox->position(512,512,512);
|
|
||||||
metalBox->textureCoord(1,1);
|
|
||||||
metalBox->normal(-1,0,0);
|
|
||||||
metalBox->end();
|
|
||||||
|
|
||||||
SceneNode* boxSceneNode = getRootSceneNode()->createChildSceneNode();
|
xAxis->index(8); xAxis->index(11); xAxis->index(9);
|
||||||
boxSceneNode->attachObject(metalBox);*/
|
xAxis->index(8); xAxis->index(10); xAxis->index(11);
|
||||||
|
xAxis->index(9); xAxis->index(11); xAxis->index(12);
|
||||||
|
xAxis->index(11); xAxis->index(10); xAxis->index(12);
|
||||||
|
xAxis->index(8); xAxis->index(9); xAxis->index(12);
|
||||||
|
xAxis->index(10); xAxis->index(8); xAxis->index(12);
|
||||||
|
xAxis->end();
|
||||||
|
|
||||||
/*ManualObject* water = createManualObject("WaterPlane");
|
SceneNode* axisNode = getRootSceneNode()->createChildSceneNode();
|
||||||
|
axisNode->attachObject(xAxis);
|
||||||
water->begin("DavidWater",RenderOperation::OT_TRIANGLE_STRIP);
|
|
||||||
water->position(-1024,100,-1024);
|
|
||||||
water->textureCoord(0,0);
|
|
||||||
water->normal(0,1,0);
|
|
||||||
water->position(-1024,100,1024);
|
|
||||||
water->textureCoord(0,1);
|
|
||||||
water->normal(0,1,0);
|
|
||||||
water->position(1024,100,-1024);
|
|
||||||
water->textureCoord(1,0);
|
|
||||||
water->normal(0,1,0);
|
|
||||||
water->position(1024,100,1024);
|
|
||||||
water->textureCoord(1,1);
|
|
||||||
water->normal(0,1,0);
|
|
||||||
|
|
||||||
water->end();
|
|
||||||
|
|
||||||
SceneNode* waterSceneNode = getRootSceneNode()->createChildSceneNode();
|
|
||||||
waterSceneNode->attachObject(water);*/
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -887,11 +816,6 @@ namespace Ogre
|
|||||||
m_normalGenerationMethod = method;
|
m_normalGenerationMethod = method;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void PolyVoxSceneManager::setMaterialNameForIndex(uchar uIndex, std::string sMaterialName)
|
|
||||||
{
|
|
||||||
m_aMaterialNames[uIndex] = sMaterialName;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
bool PolyVoxSceneManager::containsPoint(Vector3 pos, float boundary)
|
bool PolyVoxSceneManager::containsPoint(Vector3 pos, float boundary)
|
||||||
{
|
{
|
||||||
return volumeData->containsPoint(pos, boundary);
|
return volumeData->containsPoint(pos, boundary);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user