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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-08-27 10:55:54 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-27 10:55:54 +0400
commit324b3fbe747a6544b60be1eb8a0cb6b01db736de (patch)
treec2a66d777b5a8ca815629a00c82ee68a8c15e3e8 /source
parent0db2975ff6cc2592b062f749059e640dc1e2b140 (diff)
- BGE crash fix when casting a ray to the same location as the object from python.
- Incorrect Mathutils vector docstrings. - last rayshade commit had an incomplete comment.
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/vector.c4
-rw-r--r--source/blender/render/intern/source/rayshade.c4
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp8
3 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c
index cb206363dbf..a7e00e2878a 100644
--- a/source/blender/python/api2_2x/vector.c
+++ b/source/blender/python/api2_2x/vector.c
@@ -58,8 +58,8 @@ struct PyMethodDef Vector_methods[] = {
{"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, Vector_Normalize_doc},
{"negate", (PyCFunction) Vector_Negate, METH_NOARGS, Vector_Negate_doc},
{"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, Vector_Resize2D_doc},
- {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize2D_doc},
- {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc},
+ {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize3D_doc},
+ {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize4D_doc},
{"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc},
{"reflect", ( PyCFunction ) Vector_Reflect, METH_O, Vector_Reflect_doc},
{"cross", ( PyCFunction ) Vector_Cross, METH_O, Vector_Dot_doc},
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 182e60365a6..e683a499e17 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -1240,7 +1240,9 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
if(shi->combinedflag & SCE_PASS_REFLECT) {
/* values in shr->spec can be greater then 1.0.
- * in the case when it is 1.0 diff */
+ * In this case the mircol uses a zero blending factor, so ignoring it is ok.
+ * Fixes bug #18837 - when the spec is higher then 1.0,
+ * diff can become a negative color - Campbell */
f1= 1.0f-i;
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index d04174a32aa..ba8905973d5 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -2597,12 +2597,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();