Skip to content

Commit

Permalink
fix terrain ray trace bug when there is offset
Browse files Browse the repository at this point in the history
  • Loading branch information
super626 committed Nov 24, 2015
1 parent 378cfa3 commit 1ac82fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cocos/3d/CCTerrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ bool Terrain::getIntersectionPoint(const Ray & ray_, Vec3 & intersectionPoint) c
getWorldToNodeTransform().transformPoint(&(ray._origin));

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);
start = convertToTerrainSpace(start);
start.x /=(_terrainData._chunkSize.width+1);
Expand Down

0 comments on commit 1ac82fa

Please sign in to comment.