Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Ketsji/KX_IpoConvert.cpp
| Context not available. | |||||
| #include "SG_Node.h" | #include "SG_Node.h" | ||||
| #include "STR_HashedString.h" | #include <string> | ||||
| static BL_InterpolatorList *GetAdtList(struct bAction *for_act, KX_BlenderSceneConverter *converter) | static BL_InterpolatorList *GetAdtList(struct bAction *for_act, KX_BlenderSceneConverter *converter) | ||||
| { | { | ||||
| Context not available. | |||||
| Object* blenderobject = gameobj->GetBlenderObject(); | Object* blenderobject = gameobj->GetBlenderObject(); | ||||
| ipocontr->GetIPOTransform().SetPosition(MT_Point3(blenderobject->loc)); | ipocontr->GetIPOTransform().SetPosition(MT_Vector3(blenderobject->loc)); | ||||
| ipocontr->GetIPOTransform().SetEulerAngles(MT_Vector3(blenderobject->rot)); | ipocontr->GetIPOTransform().SetEulerAngles(MT_Vector3(blenderobject->rot)); | ||||
| ipocontr->GetIPOTransform().SetScaling(MT_Vector3(blenderobject->size)); | ipocontr->GetIPOTransform().SetScaling(MT_Vector3(blenderobject->size)); | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| for (int i = 0; i<3; i++) { | |||||
| if ((interp = adtList->GetScalarInterpolator("zenith_color", i))) { | |||||
| if (!ipocontr) { | |||||
| ipocontr = new KX_WorldIpoController(); | |||||
| } | |||||
| interpolator = new KX_ScalarInterpolator(&ipocontr->m_zeni_rgb[i], interp); | |||||
| ipocontr->AddInterpolator(interpolator); | |||||
| ipocontr->SetModifyZenithColor(true); | |||||
| } | |||||
| } | |||||
| if ((interp = adtList->GetScalarInterpolator("mist_settings.start", 0))) { | if ((interp = adtList->GetScalarInterpolator("mist_settings.start", 0))) { | ||||
| if (!ipocontr) { | if (!ipocontr) { | ||||
| ipocontr = new KX_WorldIpoController(); | ipocontr = new KX_WorldIpoController(); | ||||
| Context not available. | |||||
| SG_Controller *BL_CreateMaterialIpo( | SG_Controller *BL_CreateMaterialIpo( | ||||
| struct bAction *action, | struct bAction *action, | ||||
| Material* blendermaterial, | Material* blendermaterial, | ||||
| dword matname_hash, | RAS_IPolyMaterial *polymat, | ||||
| KX_GameObject* gameobj, | KX_GameObject* gameobj, | ||||
| KX_BlenderSceneConverter *converter | KX_BlenderSceneConverter *converter | ||||
| ) | ) | ||||
| Context not available. | |||||
| for (int i=0; i<3; i++) { | for (int i=0; i<3; i++) { | ||||
| if ((sinterp = adtList->GetScalarInterpolator("diffuse_color", i))) { | if ((sinterp = adtList->GetScalarInterpolator("diffuse_color", i))) { | ||||
| if (!ipocontr) { | if (!ipocontr) { | ||||
| ipocontr = new KX_MaterialIpoController(matname_hash); | ipocontr = new KX_MaterialIpoController(polymat); | ||||
| } | } | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_rgba[i], sinterp); | interpolator= new KX_ScalarInterpolator(&ipocontr->m_rgba[i], sinterp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| Context not available. | |||||
| if ((sinterp = adtList->GetScalarInterpolator("alpha", 0))) { | if ((sinterp = adtList->GetScalarInterpolator("alpha", 0))) { | ||||
| if (!ipocontr) { | if (!ipocontr) { | ||||
| ipocontr = new KX_MaterialIpoController(matname_hash); | ipocontr = new KX_MaterialIpoController(polymat); | ||||
| } | } | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_rgba[3], sinterp); | interpolator= new KX_ScalarInterpolator(&ipocontr->m_rgba[3], sinterp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| Context not available. | |||||
| for (int i=0; i<3; i++) { | for (int i=0; i<3; i++) { | ||||
| if ((sinterp = adtList->GetScalarInterpolator("specular_color", i))) { | if ((sinterp = adtList->GetScalarInterpolator("specular_color", i))) { | ||||
| if (!ipocontr) { | if (!ipocontr) { | ||||
| ipocontr = new KX_MaterialIpoController(matname_hash); | ipocontr = new KX_MaterialIpoController(polymat); | ||||
| } | } | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_specrgb[i], sinterp); | interpolator= new KX_ScalarInterpolator(&ipocontr->m_specrgb[i], sinterp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| Context not available. | |||||
| if ((sinterp = adtList->GetScalarInterpolator("specular_hardness", 0))) { | if ((sinterp = adtList->GetScalarInterpolator("specular_hardness", 0))) { | ||||
| if (!ipocontr) { | if (!ipocontr) { | ||||
| ipocontr = new KX_MaterialIpoController(matname_hash); | ipocontr = new KX_MaterialIpoController(polymat); | ||||
| } | } | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_hard, sinterp); | interpolator= new KX_ScalarInterpolator(&ipocontr->m_hard, sinterp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| Context not available. | |||||
| if ((sinterp = adtList->GetScalarInterpolator("specular_intensity", 0))) { | if ((sinterp = adtList->GetScalarInterpolator("specular_intensity", 0))) { | ||||
| if (!ipocontr) { | if (!ipocontr) { | ||||
| ipocontr = new KX_MaterialIpoController(matname_hash); | ipocontr = new KX_MaterialIpoController(polymat); | ||||
| } | } | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_spec, sinterp); | interpolator= new KX_ScalarInterpolator(&ipocontr->m_spec, sinterp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| Context not available. | |||||
| if ((sinterp = adtList->GetScalarInterpolator("diffuse_intensity", 0))) { | if ((sinterp = adtList->GetScalarInterpolator("diffuse_intensity", 0))) { | ||||
| if (!ipocontr) { | if (!ipocontr) { | ||||
| ipocontr = new KX_MaterialIpoController(matname_hash); | ipocontr = new KX_MaterialIpoController(polymat); | ||||
| } | } | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_ref, sinterp); | interpolator= new KX_ScalarInterpolator(&ipocontr->m_ref, sinterp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| Context not available. | |||||
| if ((sinterp = adtList->GetScalarInterpolator("emit", 0))) { | if ((sinterp = adtList->GetScalarInterpolator("emit", 0))) { | ||||
| if (!ipocontr) { | if (!ipocontr) { | ||||
| ipocontr = new KX_MaterialIpoController(matname_hash); | ipocontr = new KX_MaterialIpoController(polymat); | ||||
| } | } | ||||
| interpolator= new KX_ScalarInterpolator(&ipocontr->m_emit, sinterp); | interpolator= new KX_ScalarInterpolator(&ipocontr->m_emit, sinterp); | ||||
| ipocontr->AddInterpolator(interpolator); | ipocontr->AddInterpolator(interpolator); | ||||
| } | } | ||||
| if ((sinterp = adtList->GetScalarInterpolator("ambient", 0))) { | |||||
| if (!ipocontr) { | |||||
| ipocontr = new KX_MaterialIpoController(polymat); | |||||
| } | |||||
| interpolator = new KX_ScalarInterpolator(&ipocontr->m_ambient, sinterp); | |||||
| ipocontr->AddInterpolator(interpolator); | |||||
| } | |||||
| if ((sinterp = adtList->GetScalarInterpolator("specular_alpha", 0))) { | |||||
| if (!ipocontr) { | |||||
| ipocontr = new KX_MaterialIpoController(polymat); | |||||
| } | |||||
| interpolator = new KX_ScalarInterpolator(&ipocontr->m_specAlpha, sinterp); | |||||
| ipocontr->AddInterpolator(interpolator); | |||||
| } | |||||
| if (ipocontr) { | if (ipocontr) { | ||||
| ipocontr->m_rgba[0] = blendermaterial->r; | ipocontr->m_rgba[0] = blendermaterial->r; | ||||
| ipocontr->m_rgba[1] = blendermaterial->g; | ipocontr->m_rgba[1] = blendermaterial->g; | ||||
| Context not available. | |||||
| ipocontr->m_spec = blendermaterial->spec; | ipocontr->m_spec = blendermaterial->spec; | ||||
| ipocontr->m_ref = blendermaterial->ref; | ipocontr->m_ref = blendermaterial->ref; | ||||
| ipocontr->m_emit = blendermaterial->emit; | ipocontr->m_emit = blendermaterial->emit; | ||||
| ipocontr->m_ambient = blendermaterial->amb; | |||||
| ipocontr->m_alpha = blendermaterial->alpha; | ipocontr->m_alpha = blendermaterial->alpha; | ||||
| } | } | ||||
| Context not available. | |||||