fix terrain ray trace bug when there is offset

This commit is contained in:
yangxiao 2015-11-24 15:13:52 +08:00
parent 378cfa35b6
commit 1ac82fa273
1 changed files with 1 additions and 1 deletions

View File

@ -548,7 +548,7 @@ bool Terrain::getIntersectionPoint(const Ray & ray_, Vec3 & intersectionPoint) c
getWorldToNodeTransform().transformPoint(&(ray._origin)); getWorldToNodeTransform().transformPoint(&(ray._origin));
std::set<Chunk *> closeList; std::set<Chunk *> 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); Vec2 dir = Vec2(ray._direction.x,ray._direction.z);
start = convertToTerrainSpace(start); start = convertToTerrainSpace(start);
start.x /=(_terrainData._chunkSize.width+1); start.x /=(_terrainData._chunkSize.width+1);