//************************************ // Method: PBPhysicalizeCB // FullName: PBPhysicalizeCB // Access: public // Returns: CKERROR // Qualifier: // Parameter: const CKBehaviorContext& behcontext //************************************ CKERROR PBPhysicalizeCB(const CKBehaviorContext& behcontext) { CKBehavior *beh = behcontext.Behavior; switch(behcontext.CallbackMessage) { case CKM_BEHAVIORATTACH: case CKM_BEHAVIORLOAD: case CKM_BEHAVIORSETTINGSEDITED: { DWORD useDWorld; beh->GetLocalParameterValue(bbS_USE_DEFAULT_WORLD,&useDWorld); beh->EnableInputParameter(bbI_TargetWorld,!useDWorld); /* DWORD useDWorldSS; beh->GetLocalParameterValue(bbS_USE_WORLD_SLEEP_SETTINGS,&useDWorldSS); beh->EnableInputParameter(bbI_SleepSettings,!useDWorldSS); DWORD useDWorldDS; beh->GetLocalParameterValue(bbS_USE_WORLD_DAMPING_SETTINGS,&useDWorldDS); beh->EnableInputParameter(bbI_DampingSettings,!useDWorldDS); */ DWORD useDWorldM; beh->GetLocalParameterValue(bbS_USE_WORLD_MATERIAL,&useDWorldM); beh->EnableInputParameter(bbI_Material,!useDWorldM); } break; } return CKBR_OK; }
//************************************ // Method: PJRevoluteCB // FullName: PJRevoluteCB // Access: public // Returns: CKERROR // Qualifier: // Parameter: const CKBehaviorContext& behcontext //************************************ CKERROR PJRevoluteCB(const CKBehaviorContext& behcontext) { CKBehavior *beh = behcontext.Behavior; switch(behcontext.CallbackMessage) { case CKM_BEHAVIORATTACH: case CKM_BEHAVIORLOAD: case CKM_BEHAVIORSETTINGSEDITED: { DWORD twistLimit; beh->GetLocalParameterValue(1,&twistLimit); beh->EnableInputParameter(bbI_HighLimit,twistLimit); beh->EnableInputParameter(bbI_LowLimit,twistLimit); DWORD springSwing; beh->GetLocalParameterValue(0,&springSwing); beh->EnableInputParameter(bbI_Spring,springSwing); DWORD motor; beh->GetLocalParameterValue(2,&motor); beh->EnableInputParameter(bbI_Motor,motor); break; } } return CKBR_OK; }
//************************************ // Method: PWOverlapSphereCB // FullName: PWOverlapSphereCB // Access: public // Returns: CKERROR // Qualifier: // Parameter: const CKBehaviorContext& behcontext //************************************ CKERROR PWOverlapSphereCB(const CKBehaviorContext& behcontext) { CKBehavior *beh = behcontext.Behavior; switch(behcontext.CallbackMessage) { case CKM_BEHAVIORATTACH: case CKM_BEHAVIORLOAD: case CKM_BEHAVIORSETTINGSEDITED: { DWORD groups; beh->GetLocalParameterValue(bbS_Groups,&groups); beh->EnableInputParameter(bbI_Groups,groups); DWORD mask; beh->GetLocalParameterValue(bbS_Mask,&mask); beh->EnableInputParameter(bbI_Mask,mask); } break; } return CKBR_OK; }
CKERROR GeneralCameraOrbitCallback(const CKBehaviorContext& context) { CKBehavior* beh = context.Behavior; switch(context.CallbackMessage) { case CKM_BEHAVIORCREATE: case CKM_BEHAVIORLOAD: { VxVector InitialAngles(INF,INF,INF); beh->SetLocalParameterValue(LOCAL_INIT,&InitialAngles); VxVector RotationAngles(0,0,0); beh->SetLocalParameterValue(LOCAL_ROT,&RotationAngles); } break; case CKM_BEHAVIORSETTINGSEDITED: { // Update the needed input for "returns" CKBOOL Returns = TRUE; beh->GetLocalParameterValue(LOCAL_RETURN,&Returns); beh->EnableInputParameter(IN_SPEED_RETURN, Returns); // Updates the needed inputs for limiting the move CKBOOL Limited = TRUE; beh->GetLocalParameterValue(LOCAL_LIMITS,&Limited); beh->EnableInputParameter(IN_MIN_H,Limited); beh->EnableInputParameter(IN_MAX_H,Limited); beh->EnableInputParameter(IN_MIN_V,Limited); beh->EnableInputParameter(IN_MAX_V,Limited); beh->EnableInputParameter(IN_MIN_ZOOM,Limited); beh->EnableInputParameter(IN_MAX_ZOOM,Limited); } break; default: break; } return CKBR_OK; }