JackStephen
03-29-2007, 09:57 PM
Does anybody know how to activate the Figure Mode on a Biped?
This is what i've tried but it doesn't work.
bool BipedFigureMode(INode* node, bool state) {
if (node->IsRootNode()) return false;
Control* c = node->GetTMController();
if ((c->ClassID() == BIPSLAVE_CONTROL_CLASS_ID) ||
(c->ClassID() == BIPBODY_CONTROL_CLASS_ID) ||
(c->ClassID() == FOOTPRINT_CLASS_ID)) {
IBipedExport *iBiped =(IBipedExport *)c->GetInterface(I_BIPINTERFACE);
if (iBiped) {
if (state) iBiped->BeginFigureMode(1);
else iBiped->EndFigureMode(1);
Control* iMaster = (Control *) c->GetInterface(I_MASTER);
iMaster->NotifyDependents(FOREVER, PART_TM, REFMSG_CHANGE);
c->ReleaseInterface(I_MASTER,iMaster);
c->ReleaseInterface(I_BIPINTERFACE,iBiped);
return true;
}
}
return false;
}
This is what i've tried but it doesn't work.
bool BipedFigureMode(INode* node, bool state) {
if (node->IsRootNode()) return false;
Control* c = node->GetTMController();
if ((c->ClassID() == BIPSLAVE_CONTROL_CLASS_ID) ||
(c->ClassID() == BIPBODY_CONTROL_CLASS_ID) ||
(c->ClassID() == FOOTPRINT_CLASS_ID)) {
IBipedExport *iBiped =(IBipedExport *)c->GetInterface(I_BIPINTERFACE);
if (iBiped) {
if (state) iBiped->BeginFigureMode(1);
else iBiped->EndFigureMode(1);
Control* iMaster = (Control *) c->GetInterface(I_MASTER);
iMaster->NotifyDependents(FOREVER, PART_TM, REFMSG_CHANGE);
c->ReleaseInterface(I_MASTER,iMaster);
c->ReleaseInterface(I_BIPINTERFACE,iBiped);
return true;
}
}
return false;
}
