Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Converter/BL_BlenderDataConversion.cpp')
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index d69ae6b1821..494d2853058 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -2651,6 +2651,40 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
dofbit<<=1;
}
}
+ else if(dat->type == PHY_CONE_TWIST_CONSTRAINT)
+ {
+ int dof;
+ int dofbit = 1<<3; // bitflag use_angular_limit_x
+
+ for (dof=3;dof<6;dof++)
+ {
+ if(dat->flag & dofbit)
+ {
+ kxscene->GetPhysicsEnvironment()->setConstraintParam(constraintId,dof,dat->minLimit[dof],dat->maxLimit[dof]);
+ }
+ else
+ {
+ //maxLimit < 0 means free(disabled limit) for this degree of freedom
+ kxscene->GetPhysicsEnvironment()->setConstraintParam(constraintId,dof,1,-1);
+ }
+ dofbit<<=1;
+ }
+ }
+ else if (dat->type == PHY_LINEHINGE_CONSTRAINT)
+ {
+ int dof = 3; // dof for angular x
+ int dofbit = 1<<3; // bitflag use_angular_limit_x
+
+ if (dat->flag & dofbit)
+ {
+ kxscene->GetPhysicsEnvironment()->setConstraintParam(constraintId,dof,
+ dat->minLimit[dof],dat->maxLimit[dof]);
+ } else
+ {
+ //minLimit > maxLimit means free(disabled limit) for this degree of freedom
+ kxscene->GetPhysicsEnvironment()->setConstraintParam(constraintId,dof,1,-1);
+ }
+ }
}
}
}