From 75baf20d5f2fc259fc46413667aa4e35a6182bcc Mon Sep 17 00:00:00 2001 From: Steven Saric Date: Sat, 6 Oct 2012 13:03:16 +0800 Subject: [PATCH 1/2] Send back RayInfo distance with ContainerRayCast Added an 8th word to ContainerRayCast's return, which is the distance. --- Engine/source/scene/sceneContainer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index 3643fa5db..b09e5be93 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -1633,9 +1633,9 @@ DefineEngineFunction( containerRayCast, const char*, char *returnBuffer = Con::getReturnBuffer(256); if(ret) { - dSprintf(returnBuffer, 256, "%d %g %g %g %g %g %g", + dSprintf(returnBuffer, 256, "%d %g %g %g %g %g %g %g", ret, rinfo.point.x, rinfo.point.y, rinfo.point.z, - rinfo.normal.x, rinfo.normal.y, rinfo.normal.z); + rinfo.normal.x, rinfo.normal.y, rinfo.normal.z, rinfo.distance); } else { From ac9d24deb4a65ea614b755e0a0eb66a5e99a6709 Mon Sep 17 00:00:00 2001 From: Steven Saric Date: Sat, 6 Oct 2012 13:15:09 +0800 Subject: [PATCH 2/2] Doc changes for RayInfo distance Doc changes for the containerRayCast DefineEngineFunction to include the distance. --- Engine/source/scene/sceneContainer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index b09e5be93..27eabbe6c 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -1612,7 +1612,8 @@ DefineEngineFunction( containerRayCast, const char*, "@returns A string containing either null, if nothing was struck, or these fields:\n" "" + "
  • The x, y, z of the normal of the face that was struck.
  • " + "
  • The distance between the start point and the position we hit.
  • " "@ingroup Game") {