From 1ac82fa273431688ccde506fb48fef79c92c84f8 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 24 Nov 2015 15:13:52 +0800 Subject: [PATCH] fix terrain ray trace bug when there is offset --- cocos/3d/CCTerrain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/3d/CCTerrain.cpp b/cocos/3d/CCTerrain.cpp index 80e9adba95..79b4731a5e 100644 --- a/cocos/3d/CCTerrain.cpp +++ b/cocos/3d/CCTerrain.cpp @@ -548,7 +548,7 @@ bool Terrain::getIntersectionPoint(const Ray & ray_, Vec3 & intersectionPoint) c getWorldToNodeTransform().transformPoint(&(ray._origin)); std::set closeList; - Vec2 start = Vec2(ray._origin.x,ray._origin.z); + Vec2 start = Vec2(ray_._origin.x,ray_._origin.z); Vec2 dir = Vec2(ray._direction.x,ray._direction.z); start = convertToTerrainSpace(start); start.x /=(_terrainData._chunkSize.width+1);