[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14952] trunk/blender/source/gameengine: BGE patch: rename rayCastToEx() to rayCast() - better name
Benoit Bolsee
benoit.bolsee at online.be
Sun May 25 00:50:32 CEST 2008
Revision: 14952
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14952
Author: ben2610
Date: 2008-05-25 00:50:31 +0200 (Sun, 25 May 2008)
Log Message:
-----------
BGE patch: rename rayCastToEx() to rayCast() - better name
Modified Paths:
--------------
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
trunk/blender/source/gameengine/Ketsji/KX_GameObject.h
trunk/blender/source/gameengine/PyDoc/KX_GameObject.py
Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp 2008-05-24 22:38:02 UTC (rev 14951)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp 2008-05-24 22:50:31 UTC (rev 14952)
@@ -743,7 +743,7 @@
{"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 @@
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"
Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.h
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.h 2008-05-24 22:38:02 UTC (rev 14951)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.h 2008-05-24 22:50:31 UTC (rev 14952)
@@ -665,7 +665,7 @@
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 :
Modified: trunk/blender/source/gameengine/PyDoc/KX_GameObject.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_GameObject.py 2008-05-24 22:38:02 UTC (rev 14951)
+++ trunk/blender/source/gameengine/PyDoc/KX_GameObject.py 2008-05-24 22:50:31 UTC (rev 14952)
@@ -174,7 +174,7 @@
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 @@
@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
More information about the Bf-blender-cvs
mailing list