Fixed axis display code.
This commit is contained in:
parent
e5fbb59db2
commit
05c5d1dbce
@ -78,7 +78,7 @@ namespace Ogre
|
|||||||
bool containsPoint(Vector3 pos, float boundary);
|
bool containsPoint(Vector3 pos, float boundary);
|
||||||
bool containsPoint(IntVector3 pos, uint boundary);
|
bool containsPoint(IntVector3 pos, uint boundary);
|
||||||
|
|
||||||
//void setAxisVisible(bool visible);
|
|
||||||
|
|
||||||
bool surfaceUpToDate[OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS];
|
bool surfaceUpToDate[OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS];
|
||||||
bool regionIsHomogenous[OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS];
|
bool regionIsHomogenous[OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS];
|
||||||
@ -92,9 +92,6 @@ namespace Ogre
|
|||||||
void markVoxelChanged(uint x, uint y, uint z);
|
void markVoxelChanged(uint x, uint y, uint z);
|
||||||
void markRegionChanged(uint firstX, uint firstY, uint firstZ, uint lastX, uint lastY, uint lastZ);
|
void markRegionChanged(uint firstX, uint firstY, uint firstZ, uint lastX, uint lastY, uint lastZ);
|
||||||
|
|
||||||
/*void createAxis(uint uSideLength);
|
|
||||||
SceneNode* m_axisNode;*/
|
|
||||||
|
|
||||||
|
|
||||||
static uint fileNo;
|
static uint fileNo;
|
||||||
|
|
||||||
|
@ -759,95 +759,7 @@ namespace Ogre
|
|||||||
return volumeData->containsPoint(pos, boundary);
|
return volumeData->containsPoint(pos, boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void PolyVoxSceneManager::createAxis(uint uSideLength)
|
/*
|
||||||
{
|
|
||||||
float fSideLength = static_cast<float>(uSideLength);
|
|
||||||
float fHalfSideLength = fSideLength/2.0;
|
|
||||||
Vector3 vecOriginAndConeScale(4.0,4.0,4.0);
|
|
||||||
|
|
||||||
//Create the main node for the axes
|
|
||||||
m_axisNode = getRootSceneNode()->createChildSceneNode();
|
|
||||||
|
|
||||||
//Create sphrere representing origin
|
|
||||||
SceneNode* originNode = m_axisNode->createChildSceneNode();
|
|
||||||
Entity *originSphereEntity = createEntity( "Origin Sphere", "Sphere.mesh" );
|
|
||||||
originSphereEntity->setMaterialName("WhiteMaterial");
|
|
||||||
originNode->attachObject(originSphereEntity);
|
|
||||||
originNode->scale(vecOriginAndConeScale);
|
|
||||||
|
|
||||||
//Create arrow body for x-axis
|
|
||||||
SceneNode *xAxisCylinderNode = m_axisNode->createChildSceneNode();
|
|
||||||
Entity *xAxisCylinderEntity = createEntity( "X Axis Cylinder", "Cylinder.mesh" );
|
|
||||||
xAxisCylinderEntity->setMaterialName("RedMaterial");
|
|
||||||
xAxisCylinderNode->attachObject(xAxisCylinderEntity);
|
|
||||||
xAxisCylinderNode->scale(Vector3(1.0,1.0,fHalfSideLength-4.0));
|
|
||||||
xAxisCylinderNode->translate(Vector3(fHalfSideLength,0.0,0.0));
|
|
||||||
xAxisCylinderNode->rotate(Vector3::UNIT_Y, Radian(1.5707));
|
|
||||||
|
|
||||||
//Create arrow head for x-axis
|
|
||||||
SceneNode *xAxisConeNode = m_axisNode->createChildSceneNode();
|
|
||||||
Entity *xAxisConeEntity = createEntity( "X Axis Cone", "Cone.mesh" );
|
|
||||||
xAxisConeEntity->setMaterialName("RedMaterial");
|
|
||||||
xAxisConeNode->attachObject(xAxisConeEntity);
|
|
||||||
xAxisConeNode->rotate(Vector3::UNIT_Y, Radian(1.5707));
|
|
||||||
xAxisConeNode->scale(vecOriginAndConeScale);
|
|
||||||
xAxisConeNode->translate(Vector3(fSideLength-4.0,0.0,0.0));
|
|
||||||
|
|
||||||
//Create arrow body for y-axis
|
|
||||||
SceneNode *yAxisCylinderNode = m_axisNode->createChildSceneNode();
|
|
||||||
Entity *yAxisCylinderEntity = createEntity( "Y Axis Cylinder", "Cylinder.mesh" );
|
|
||||||
yAxisCylinderEntity->setMaterialName("GreenMaterial");
|
|
||||||
yAxisCylinderNode->attachObject(yAxisCylinderEntity);
|
|
||||||
yAxisCylinderNode->scale(Vector3(1.0,1.0,fHalfSideLength-4.0));
|
|
||||||
yAxisCylinderNode->translate(Vector3(0.0,fHalfSideLength,0.0));
|
|
||||||
yAxisCylinderNode->rotate(Vector3::UNIT_X, Radian(1.5707));
|
|
||||||
|
|
||||||
//Create arrow head for y-axis
|
|
||||||
SceneNode *yAxisConeNode = m_axisNode->createChildSceneNode();
|
|
||||||
Entity *yAxisConeEntity = createEntity( "Y Axis Cone", "Cone.mesh" );
|
|
||||||
yAxisConeEntity->setMaterialName("GreenMaterial");
|
|
||||||
yAxisConeNode->attachObject(yAxisConeEntity);
|
|
||||||
yAxisConeNode->rotate(Vector3::UNIT_X, Radian(-1.5707));
|
|
||||||
yAxisConeNode->scale(vecOriginAndConeScale);
|
|
||||||
yAxisConeNode->translate(Vector3(0.0,fSideLength-4.0,0.0));
|
|
||||||
|
|
||||||
//Create arrow body for z-axis
|
|
||||||
SceneNode *zAxisCylinderNode = m_axisNode->createChildSceneNode();
|
|
||||||
Entity *zAxisCylinderEntity = createEntity( "Z Axis Cylinder", "Cylinder.mesh" );
|
|
||||||
zAxisCylinderEntity->setMaterialName("BlueMaterial");
|
|
||||||
zAxisCylinderNode->attachObject(zAxisCylinderEntity);
|
|
||||||
zAxisCylinderNode->translate(Vector3(0.0,0.0,fHalfSideLength));
|
|
||||||
zAxisCylinderNode->scale(Vector3(1.0,1.0,fHalfSideLength-4.0));
|
|
||||||
|
|
||||||
//Create arrow head for z-axis
|
|
||||||
SceneNode *zAxisConeNode = m_axisNode->createChildSceneNode();
|
|
||||||
Entity *zAxisConeEntity = createEntity( "Z Axis Cone", "Cone.mesh" );
|
|
||||||
zAxisConeEntity->setMaterialName("BlueMaterial");
|
|
||||||
zAxisConeNode->attachObject(zAxisConeEntity);
|
|
||||||
zAxisConeNode->translate(Vector3(0.0,0.0,fSideLength-4.0));
|
|
||||||
zAxisConeNode->scale(vecOriginAndConeScale);
|
|
||||||
|
|
||||||
//Create remainder of box
|
|
||||||
ManualObject* remainingBox = createManualObject("Remaining Box");
|
|
||||||
remainingBox->begin("BaseWhiteNoLighting",RenderOperation::OT_LINE_LIST);
|
|
||||||
remainingBox->position(0.0, 0.0, 0.0 ); remainingBox->position(0.0, 0.0, fSideLength );
|
|
||||||
remainingBox->position(0.0, fSideLength, 0.0 ); remainingBox->position(0.0, fSideLength, fSideLength );
|
|
||||||
remainingBox->position(fSideLength, 0.0, 0.0 ); remainingBox->position(fSideLength, 0.0, fSideLength );
|
|
||||||
remainingBox->position(fSideLength, fSideLength, 0.0 ); remainingBox->position(fSideLength, fSideLength, fSideLength );
|
|
||||||
|
|
||||||
remainingBox->position(0.0, 0.0, 0.0 ); remainingBox->position(0.0, fSideLength, 0.0 );
|
|
||||||
remainingBox->position(0.0, 0.0, fSideLength ); remainingBox->position(0.0, fSideLength, fSideLength );
|
|
||||||
remainingBox->position(fSideLength, 0.0, 0.0 ); remainingBox->position(fSideLength, fSideLength, 0.0 );
|
|
||||||
remainingBox->position(fSideLength, 0.0, fSideLength ); remainingBox->position(fSideLength, fSideLength, fSideLength );
|
|
||||||
|
|
||||||
remainingBox->position(0.0, 0.0, 0.0 ); remainingBox->position(fSideLength, 0.0, 0.0 );
|
|
||||||
remainingBox->position(0.0, 0.0, fSideLength ); remainingBox->position(fSideLength, 0.0, fSideLength );
|
|
||||||
remainingBox->position(0.0, fSideLength, 0.0 ); remainingBox->position(fSideLength, fSideLength, 0.0 );
|
|
||||||
remainingBox->position(0.0, fSideLength, fSideLength ); remainingBox->position(fSideLength, fSideLength, fSideLength );
|
|
||||||
remainingBox->end();
|
|
||||||
SceneNode *remainingBoxNode = m_axisNode->createChildSceneNode();
|
|
||||||
remainingBoxNode->attachObject(remainingBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolyVoxSceneManager::setAxisVisible(bool visible)
|
void PolyVoxSceneManager::setAxisVisible(bool visible)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user