ManualObject bug in 1.8.1?
Posted: Sun Oct 14, 2012 6:16 pm
I used manual objects in Ogre 1.7.? without any problem. When I ported the project to Byatis I saw that the manuaobjects I were using (3 lines for a gizmo) were not present and but the resto of the object in thqat classe were in their regular position and working fine.
in this case n is 0 but is supposed to be two? what happened?I think to have followed the tutorial correctly.
Code: Select all
lineX = mSceneMgr->createManualObject("lineX");
lineY = mSceneMgr->createManualObject("lineY");
lineZ = mSceneMgr->createManualObject("lineZ");
lineX->setCastShadows(false);
lineY->setCastShadows(false);
lineZ->setCastShadows(false);
objX->setRenderQueueGroup(Ogre::RenderQueueGroupID::RENDER_QUEUE_OVERLAY);
objY->setRenderQueueGroup(Ogre::RenderQueueGroupID::RENDER_QUEUE_OVERLAY);
objZ->setRenderQueueGroup(Ogre::RenderQueueGroupID::RENDER_QUEUE_OVERLAY);
lineX->setRenderQueueGroup(Ogre::RenderQueueGroupID::RENDER_QUEUE_OVERLAY);
lineY->setRenderQueueGroup(Ogre::RenderQueueGroupID::RENDER_QUEUE_OVERLAY);
lineZ->setRenderQueueGroup(Ogre::RenderQueueGroupID::RENDER_QUEUE_OVERLAY);
gizmoNode = mSceneMgr->createSceneNode();
gizmoNode->setPosition(0,0,0);
nodeX = gizmoNode->createChildSceneNode();
nodeY = gizmoNode->createChildSceneNode();
nodeZ = gizmoNode->createChildSceneNode();
nodeX->attachObject(lineX);
nodeY->attachObject(lineY);
nodeZ->attachObject(lineZ);
nodeX->attachObject(objX);
nodeY->attachObject(objY);
nodeZ->attachObject(objZ);
nodeX->setVisible(true);
nodeY->setVisible(true);
nodeZ->setVisible(true);
initLineMaterial(0);
initLineMaterial(1);
initLineMaterial(2);
lineX->setDynamic(true);
lineX->setDebugDisplayEnabled(true);
lineX->clear();
lineX->begin("linematx", Ogre::RenderOperation::OT_LINE_LIST);
lineX->colour(Ogre::ColourValue::Red);
lineX->position(gizmoNode->getPosition().x-translation/2,nodeX->getPosition().y,nodeX->getPosition().z);
lineX->position(nodeX->getPosition());
lineX->end();
int n = lineX->getCurrentVertexCount();
n;