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:
authorCampbell Barton <ideasman42@gmail.com>2009-08-30 03:41:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-30 03:41:09 +0400
commit75697c40a039e8f64573bedd5211c442e2af9e9c (patch)
treeaf111682037c4568eec377984005928046d867b6 /source/gameengine
parentc2696ae63182da338d69a5127f03b1ad8b88f6c9 (diff)
parentd7bf9688ac78169a37fbfc0d3d5bcd5b5be19170 (diff)
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22717:22875
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp27
-rw-r--r--source/gameengine/PyDoc/GameLogic.py8
4 files changed, 6 insertions, 41 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index ed03bb0bdd5..230820719aa 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1377,7 +1377,9 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
bool isCompoundChild = false;
bool hasCompoundChildren = !parent && (blenderobject->gameflag & OB_CHILD);
- if (parent/* && (parent->gameflag & OB_DYNAMIC)*/) {
+ /* When the parent is not OB_DYNAMIC and has no OB_COLLISION then it gets no bullet controller
+ * and cant be apart of the parents compound shape */
+ if (parent && (parent->gameflag & (OB_DYNAMIC | OB_COLLISION))) {
if ((parent->gameflag & OB_CHILD) != 0 && (blenderobject->gameflag & OB_CHILD))
{
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 91213bee865..eeff39ab9b1 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -2520,12 +2520,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
}
}
MT_Point3 fromPoint = NodeGetWorldPosition();
+
if (dist != 0.0f)
- {
- MT_Vector3 toDir = toPoint-fromPoint;
- toDir.normalize();
- toPoint = fromPoint + (dist) * toDir;
- }
+ toPoint = fromPoint + dist * (toPoint-fromPoint).safe_normalized();
+
PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = GetPhysicsController();
KX_GameObject *parent = GetParent();
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 5afaf61dee2..67ab67814b2 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -448,32 +448,6 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *)
}
-static PyObject *gEvalExpression(PyObject*, PyObject* value)
-{
- char* txt= _PyUnicode_AsString(value);
-
- if (txt==NULL) {
- PyErr_SetString(PyExc_TypeError, "Expression.calc(text): expects a single string argument");
- return NULL;
- }
-
- CParser parser;
- CExpression* expr = parser.ProcessText(txt);
- CValue* val = expr->Calculate();
- expr->Release();
-
- if (val) {
- PyObject* pyobj = val->ConvertValueToPython();
- if (pyobj)
- return pyobj;
- else
- return val->GetProxy();
- }
-
- Py_RETURN_NONE;
-}
-
-
static struct PyMethodDef game_methods[] = {
{"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (const char *)gPyExpandPath_doc},
{"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (const char *)gPySendMessage_doc},
@@ -500,7 +474,6 @@ static struct PyMethodDef game_methods[] = {
{"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (const char *)"Gets the estimated average frame rate"},
{"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (const char *)"Gets a list of blend files in the same directory as the current blend file"},
{"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (const char *)"Prints GL Extension Info"},
- {"EvalExpression", (PyCFunction)gEvalExpression, METH_O, (const char *)"Evaluate a string as a game logic expression"},
{NULL, (PyCFunction) NULL, 0, NULL }
};
diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py
index 72e2c3ed7f5..d22b1690e74 100644
--- a/source/gameengine/PyDoc/GameLogic.py
+++ b/source/gameengine/PyDoc/GameLogic.py
@@ -447,14 +447,6 @@ def setPhysicsTicRate(ticrate):
@type ticrate: float
"""
-def EvalExpression(text):
- """
- Evaluate the string as an expression, similar to the expression controller logic brick.
- @param text: The expression to evaluate.
- @type text: string
- @return: The result of the expression. The type depends on the expression.
- """
-
#{ Utility functions
def getAverageFrameRate():
"""