diff options
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 28 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 10 | ||||
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 13 |
4 files changed, 41 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index e8441d727d8..c71204e903d 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -205,6 +205,14 @@ void relink_constraints (struct ListBase *list) ID_NEW(data->tar); } break; + case CONSTRAINT_TYPE_RIGIDBODYJOINT: + { + bRigidBodyJointConstraint *data; + data = con->data; + + ID_NEW(data->tar); + } + break; case CONSTRAINT_TYPE_LOCLIMIT: { bLocLimitConstraint *data; @@ -340,6 +348,13 @@ char constraint_has_target (bConstraint *con) return 1; } break; + case CONSTRAINT_TYPE_RIGIDBODYJOINT: + { + bRigidBodyJointConstraint *data = con->data; + if (data->tar) + return 1; + } + break; } // Unknown types or CONSTRAINT_TYPE_NULL or no target return 0; @@ -422,6 +437,13 @@ Object *get_constraint_target(bConstraint *con, char **subtarget) return (data->tar); } break; + case CONSTRAINT_TYPE_RIGIDBODYJOINT: + { + bRigidBodyJointConstraint *data = con->data; + *subtarget= NULL; + return data->tar; + } + break; default: *subtarget= NULL; break; @@ -498,6 +520,12 @@ void set_constraint_target(bConstraint *con, Object *ob, char *subtarget) if(subtarget) BLI_strncpy(data->subtarget, subtarget, 32); } break; + case CONSTRAINT_TYPE_RIGIDBODYJOINT: + { + bRigidBodyJointConstraint *data = con->data; + data->tar= ob; + } + break; case CONSTRAINT_TYPE_MINMAX: { bMinMaxConstraint *data = (bMinMaxConstraint*)con->data; diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 5d8c959714f..b0ccf2c07b2 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -3664,15 +3664,6 @@ void drawRBpivot(bRigidBodyJointConstraint *data){ v[2] += dir[2]; glVertex3fv(v1); glVertex3fv(v); -/* v1[axis]= size*0.8; - v1[arrow_axis]= -size*0.125; - glVertex3fv(v1); - glVertex3fv(v2); - - v1[arrow_axis]= size*0.125; - glVertex3fv(v1); - glVertex3fv(v2); -*/ glEnd(); glRasterPos3fv(v); if (axis==0) @@ -3681,7 +3672,6 @@ void drawRBpivot(bRigidBodyJointConstraint *data){ BMF_DrawString(G.font, "py"); else BMF_DrawString(G.font, "pz"); - } glLineWidth (1.0f); setlinestyle(0); diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 91394c8c212..80db437bcd9 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -602,6 +602,10 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, // start the engine ketsjiengine->StartEngine(false); + + ketsjiengine->SetUseFixedTime(true); + + ketsjiengine->SetTicRate(blscene->r.frs_sec); // the mainloop while ((blscene->r.cfra<=blscene->r.efra)&&(!exitrequested)) @@ -609,14 +613,6 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, printf("frame %i\n",blscene->r.cfra); // first check if we want to exit exitrequested = ketsjiengine->GetExitCode(); - /*for (int ix=0;i<geobjs->GetCount();ix++){ - KX_GameObject* gameobj = (KX_GameObject*) geobjs->GetValue(ix); - if (!gameobj->IsDynamic()){ - //gameobj->UpdateNonDynas();//UpdateIPO((float)blscene->r.cfra,true, true, true); - struct Object* blenderobject = sceneconverter->FindBlenderObject(gameobj); - } - }*/ - // kick the engine ketsjiengine->NextFrame(); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 840df144778..0d9ad087c05 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1868,8 +1868,15 @@ void BL_ConvertBlenderObjects(struct Main* maggie, rendertools, converter, blenderscene); - - if (gameobj) + + bool isInActiveLayer = (blenderobject->lay & activeLayerBitInfo) !=0; + bool addobj=true; + + if (converter->addInitFromFrame) + if (!isInActiveLayer) + addobj=false; + + if (gameobj&&addobj) { MT_Point3 posPrev; MT_Matrix3x3 angor; @@ -1920,8 +1927,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, Material *mat = give_current_material(blenderobject, 1); if(mat) BL_ConvertMaterialIpos(mat, gameobj, converter); - bool isInActiveLayer = (blenderobject->lay & activeLayerBitInfo) !=0; - sumolist->Add(gameobj->AddRef()); BL_ConvertProperties(blenderobject,gameobj,timemgr,kxscene,isInActiveLayer); |