From e2a9590a15c807c391ec7eff05c7168a8025ab7a Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sat, 24 May 2008 22:50:31 +0000 Subject: [PATCH] BGE patch: rename rayCastToEx() to rayCast() - better name --- source/gameengine/Ketsji/KX_GameObject.cpp | 6 +++--- source/gameengine/Ketsji/KX_GameObject.h | 2 +- source/gameengine/PyDoc/KX_GameObject.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 6b4fd565495..5fd5d2d5492 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -743,7 +743,7 @@ PyMethodDef KX_GameObject::Methods[] = { {"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_VARARGS}, KX_PYMETHODTABLE(KX_GameObject, getDistanceTo), KX_PYMETHODTABLE(KX_GameObject, rayCastTo), - KX_PYMETHODTABLE(KX_GameObject, rayCastToEx), + KX_PYMETHODTABLE(KX_GameObject, rayCast), {NULL,NULL} //Sentinel }; @@ -1381,8 +1381,8 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, Py_Return; } -KX_PYMETHODDEF_DOC(KX_GameObject, rayCastToEx, -"rayCastToEx(to,from,dist,prop): cast a ray and return tuple (object,hit,normal) of contact point with object within dist that matches prop or None if no hit\n" +KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, +"rayCast(to,from,dist,prop): cast a ray and return tuple (object,hit,normal) of contact point with object within dist that matches prop or None if no hit\n" " prop = property name that object must have; can be omitted => detect any object\n" " dist = max distance to look (can be negative => look behind); 0 or omitted => detect up to to\n" " from = 3-tuple or object reference for origin of ray (if object, use center of object)\n" diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 9e35e45270c..6e765978821 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -665,7 +665,7 @@ public: KX_PYMETHOD(KX_GameObject,RemoveParent); KX_PYMETHOD(KX_GameObject,GetPhysicsId); KX_PYMETHOD_DOC(KX_GameObject,rayCastTo); - KX_PYMETHOD_DOC(KX_GameObject,rayCastToEx); + KX_PYMETHOD_DOC(KX_GameObject,rayCast); KX_PYMETHOD_DOC(KX_GameObject,getDistanceTo); private : diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index b0f55b4ad7a..fbd896a55d1 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -174,7 +174,7 @@ class KX_GameObject: The ray is always casted from the center of the object, ignoring the object itself. The ray is casted towards the center of another object or an explicit [x,y,z] point. - Use rayCastToEx() if you need to retrieve the hit point + Use rayCast() if you need to retrieve the hit point @param other: [x,y,z] or object towards which the ray is casted @type other: L{KX_GameObject} or 3-tuple @@ -185,13 +185,13 @@ class KX_GameObject: @rtype: L{KX_GameObject} @return: the first object hit or None if no object or object does not match prop """ - def rayCastToEx(to,from,dist,prop): + def rayCast(to,from,dist,prop): """ Look from a point/object to another point/object and find first object hit within dist that matches prop. - Returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no object hit. + Returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit. Ex: # shoot along the axis gun-gunAim (gunAim should be collision-free) - ob,point,normal = gun.rayCastToEx(gunAim,None,50) + ob,point,normal = gun.rayCast(gunAim,None,50) if ob: # hit something