Beispiel #1
0
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, converter);

		// For each active channel in the adtList add an
		// interpolator to the game object.
		
		KX_IInterpolator *interpolator;
		KX_IScalarInterpolator *interp;
		
		for(int i=0; i<3; i++) {
			if ((interp = adtList->GetScalarInterpolator("horizon_color", i))) {
				interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_rgb[i], interp);
				ipocontr->AddInterpolator(interpolator);
				ipocontr->SetModifyMistColor(true);
			}
		}

		if ((interp = adtList->GetScalarInterpolator("mist.depth", 0))) {
			interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_dist, interp);
			ipocontr->AddInterpolator(interpolator);
			ipocontr->SetModifyMistDist(true);
		}

		if ((interp = adtList->GetScalarInterpolator("mist.start", 0))) {
			interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_start, interp);
			ipocontr->AddInterpolator(interpolator);
			ipocontr->SetModifyMistStart(true);
		}
	}
}