Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Ketsji/KX_IpoConvert.cpp
| Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | if ((interp = adtList->GetScalarInterpolator("clip_end", 0))) { | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_clipend, interp); | interpolator= new KX_ScalarInterpolator(&ipocontr->m_clipend, interp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| ipocontr->SetModifyClipEnd(true); | ipocontr->SetModifyClipEnd(true); | ||||
| } | } | ||||
| return ipocontr; | return ipocontr; | ||||
| } | } | ||||
| void BL_ConvertWorldIpos(struct World* blenderworld,KX_BlenderSceneConverter *converter) | |||||
| { | |||||
| if (blenderworld->adt) { | |||||
| KX_WorldIpoController* ipocontr = new KX_WorldIpoController(); | |||||
| // Erwin, hook up the world ipo controller here | |||||
| // Gino: hook it up to what ? | |||||
| // is there a userinterface element for that ? | |||||
| // for now, we have some new python hooks to access the data, for a work-around | |||||
| ipocontr->m_mist_start = blenderworld->miststa; | |||||
| ipocontr->m_mist_dist = blenderworld->mistdist; | |||||
| ipocontr->m_mist_rgb[0] = blenderworld->horr; | |||||
| ipocontr->m_mist_rgb[1] = blenderworld->horg; | |||||
| ipocontr->m_mist_rgb[2] = blenderworld->horb; | |||||
| BL_InterpolatorList *adtList= GetAdtList(blenderworld->adt->action, converter); | SG_Controller * BL_CreateWorldIPO( bAction *action, struct World *blenderworld, KX_BlenderSceneConverter *converter ) | ||||
| { | |||||
| KX_WorldIpoController *ipocontr = NULL; | |||||
moguri: This should be renamed to BL_CreateWorldIPO() to match the other functions. | |||||
| // For each active channel in the adtList add an | if (blenderworld) { | ||||
| // interpolator to the game object. | BL_InterpolatorList *adtList = GetAdtList(action, converter); | ||||
| // For each active channel in the adtList add an interpolator to the game object. | |||||
| KX_IInterpolator *interpolator; | KX_IInterpolator *interpolator; | ||||
| KX_IScalarInterpolator *interp; | KX_IScalarInterpolator *interp; | ||||
| for (int i=0; i<3; i++) { | for (int i=0; i<3; i++) { | ||||
| if ((interp = adtList->GetScalarInterpolator("ambient_color", i))) { | |||||
| if (!ipocontr) { | |||||
| ipocontr = new KX_WorldIpoController(); | |||||
| } | |||||
| interpolator = new KX_ScalarInterpolator(&ipocontr->m_ambi_rgb[i], interp); | |||||
| ipocontr->AddInterpolator(interpolator); | |||||
| ipocontr->SetModifyAmbientColor(true); | |||||
| } | |||||
| } | |||||
| for (int i=0; i<3; i++) { | |||||
| if ((interp = adtList->GetScalarInterpolator("horizon_color", i))) { | if ((interp = adtList->GetScalarInterpolator("horizon_color", i))) { | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_rgb[i], interp); | if (!ipocontr) { | ||||
| ipocontr = new KX_WorldIpoController(); | |||||
| } | |||||
| interpolator = new KX_ScalarInterpolator(&ipocontr->m_hori_rgb[i], interp); | |||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| ipocontr->SetModifyMistColor(true); | ipocontr->SetModifyHorizonColor(true); | ||||
| } | } | ||||
| } | } | ||||
| if ((interp = adtList->GetScalarInterpolator("mist.depth", 0))) { | if ((interp = adtList->GetScalarInterpolator("mist_settings.start", 0))) { | ||||
| if (!ipocontr) { | |||||
| ipocontr = new KX_WorldIpoController(); | |||||
| } | |||||
| interpolator = new KX_ScalarInterpolator(&ipocontr->m_mist_start, interp); | |||||
| ipocontr->AddInterpolator(interpolator); | |||||
| ipocontr->SetModifyMistStart(true); | |||||
| } | |||||
| if ((interp = adtList->GetScalarInterpolator("mist_settings.depth", 0))) { | |||||
| if (!ipocontr) { | |||||
| ipocontr = new KX_WorldIpoController(); | |||||
| } | |||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_dist, interp); | interpolator = new KX_ScalarInterpolator(&ipocontr->m_mist_dist, interp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| ipocontr->SetModifyMistDist(true); | ipocontr->SetModifyMistDist(true); | ||||
| } | } | ||||
| if ((interp = adtList->GetScalarInterpolator("mist.start", 0))) { | if ((interp = adtList->GetScalarInterpolator("mist_settings.intensity", 0))) { | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_start, interp); | if (!ipocontr) { | ||||
| ipocontr = new KX_WorldIpoController(); | |||||
| } | |||||
| interpolator = new KX_ScalarInterpolator(&ipocontr->m_mist_intensity, interp); | |||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| ipocontr->SetModifyMistStart(true); | ipocontr->SetModifyMistIntensity(true); | ||||
| } | } | ||||
| if (ipocontr) { | |||||
| ipocontr->m_mist_start = blenderworld->miststa; | |||||
| ipocontr->m_mist_dist = blenderworld->mistdist; | |||||
| ipocontr->m_mist_intensity = blenderworld->misi; | |||||
| ipocontr->m_hori_rgb[0] = blenderworld->horr; | |||||
| ipocontr->m_hori_rgb[1] = blenderworld->horg; | |||||
| ipocontr->m_hori_rgb[2] = blenderworld->horb; | |||||
| ipocontr->m_ambi_rgb[0] = blenderworld->ambr; | |||||
| ipocontr->m_ambi_rgb[1] = blenderworld->ambg; | |||||
| ipocontr->m_ambi_rgb[2] = blenderworld->ambb; | |||||
| } | } | ||||
| } | } | ||||
| return ipocontr; | |||||
| } | |||||
| SG_Controller *BL_CreateMaterialIpo( | SG_Controller *BL_CreateMaterialIpo( | ||||
| struct bAction *action, | struct bAction *action, | ||||
| Material* blendermaterial, | Material* blendermaterial, | ||||
| dword matname_hash, | dword matname_hash, | ||||
| KX_GameObject* gameobj, | KX_GameObject* gameobj, | ||||
| KX_BlenderSceneConverter *converter | KX_BlenderSceneConverter *converter | ||||
| ) | ) | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||
This should be renamed to BL_CreateWorldIPO() to match the other functions.