[1.0.22T5 - solved] disable debug visualization for 1 actor

nargil

09-02-2009 11:11:03

for a certain actor/body ?

actor->clearBodyFlag(NX_BF_VISUALIZATION);

doesn't work. I want the debug visualization to work with my objects, but disable it for the terrain which is an overkill for the gpu rendering.

this is how i turn it on.
this->mWorld->createDebugRenderer(this->getSceneMgrRW());
this->mWorld->getPhysXDriver()->setVisualisationActorAxesEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationBodyAngularVelocityEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationBodyAxesEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationBodyJointGroupsEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationBodyLinearVelocityEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationBodyMassAxesEnabled(false);
//this->mWorld->getPhysXDriver()->setVisualisationBodyMassAxesEnabled(true);
this->mWorld->getPhysXDriver()->setVisualisationWorldAxesEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationCollisionAABBsEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationCollisionAxesEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationCollisionCCDEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationCollisionCompoundsEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationCollisionDynamicEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationCollisionEdgesEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationCollisionFaceNormalsEnabled(false);
this->mWorld->getPhysXDriver()->setVisualisationCollisionSpheresEnabled(false);

NxOgre::Actors* act = this->mScene->getActors();
for(NxOgre::Actor* a = act->begin(); a = act->next();)
{
if(static_cast<MyAbstractActor*>(a)->getType()==12346)
{
std::cout << a->getName() << std::endl;
a->clearBodyFlag(NX_BF_VISUALIZATION);
}
}


it couts the name of the terrain i want to disable debug rendering for, but it's still being rendered

betajaen

09-02-2009 11:52:53

I think you have to disable it per shape for every actor you don't want and I'm pretty sure there is a param for it.

nargil

09-02-2009 12:11:37

thank you.

Added this to constructor of my terrain body.
for(int i=0; i<this->getNxActor()->getNbShapes(); i++)
this->getNxActor()->getShapes()[i]->setFlag(NxShapeFlag::NX_SF_VISUALIZATION, false);


Works fine.