Ejemplo n.º 1
0
void morphChannel::SetUpNewController()
{
	int in, out;
	GetBezierDefaultTangentType(in, out);
	SetBezierDefaultTangentType(BEZKEY_STEP, BEZKEY_STEP);
	Control *c = (Control*)CreateInstance(CTRL_FLOAT_CLASS_ID,GetDefaultController(CTRL_FLOAT_CLASS_ID)->ClassID());
	cblock->SetValue(0,0,0.0f);
	cblock->SetController(0,c);
	SetBezierDefaultTangentType(in, out);
}
Ejemplo n.º 2
0
// REMOVEBIPED
void RemoveBiped(INode *bipRoot, Interface *theInterface)
{
    SuspendAnimate();   
    AnimateOn();
    
    // remember Max's default controllers (for the user)
    ClassDesc* defaultRotCtrl=GetDefaultController(CTRL_ROTATION_CLASS_ID);
    ClassDesc* defaultPosCtrl=GetDefaultController(CTRL_POSITION_CLASS_ID);
    ClassDesc* defaultScaleCtrl=GetDefaultController(CTRL_SCALE_CLASS_ID);
    
    // change default controllers to linear to create linear controllers
    // since we have no tan info
    DllDir* dllDir=&theInterface->GetDllDir();
    ClassDirectory* classDir=&dllDir->ClassDir();

    ClassDesc* rotCtrl = classDir->FindClass( SClass_ID(CTRL_ROTATION_CLASS_ID),
                                Class_ID(TCBINTERP_ROTATION_CLASS_ID,0));  // was Class_ID(LININTERP_ROTATION_CLASS_ID,0));

    ClassDesc* posCtrl = classDir->FindClass( SClass_ID(CTRL_POSITION_CLASS_ID),
                                    Class_ID(LININTERP_POSITION_CLASS_ID, 0));

    ClassDesc* scaleCtrl = classDir->FindClass( SClass_ID(CTRL_SCALE_CLASS_ID),
                                            Class_ID(LININTERP_SCALE_CLASS_ID, 0));

    SetDefaultController(CTRL_ROTATION_CLASS_ID, rotCtrl);
    SetDefaultController(CTRL_POSITION_CLASS_ID, posCtrl);
    SetDefaultController(CTRL_SCALE_CLASS_ID, scaleCtrl);

    ProcessNodeRecurse(bipRoot, nil, theInterface);

    //deinit
    ResumeAnimate();
    
    // remember Max's default controllers (for the user)
    SetDefaultController(CTRL_ROTATION_CLASS_ID, defaultRotCtrl);
    SetDefaultController(CTRL_POSITION_CLASS_ID, defaultPosCtrl);
    SetDefaultController(CTRL_SCALE_CLASS_ID, defaultScaleCtrl);
}
Ejemplo n.º 3
0
std::shared_ptr<cTerrainRLCharController> cScenarioTrainHike::GetDefaultLLC() const
{
	auto waypoint_ctrl = std::dynamic_pointer_cast<cWaypointController>(GetDefaultController());
	auto LLC_ctrl = std::dynamic_pointer_cast<cTerrainRLCharController>(waypoint_ctrl->GetLLC());
	return LLC_ctrl;
}