- 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.
This commit is contained in:
Campbell Barton
2009-08-27 06:55:54 +00:00
parent 0db2975ff6
commit 324b3fbe74
3 changed files with 8 additions and 8 deletions

View File

@@ -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();