Skip to content

Commit 928fa1c

Browse files
authored
Merge pull request #2 from mitm001/patch-1
added y position
2 parents e510a6f + 55a41d1 commit 928fa1c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

AI/src/com/jme3/ai/navmesh/NavMeshPathfinder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void setEntityRadius(float entityRadius) {
5959
* @return the new position in the nearest cell
6060
*/
6161
public Vector3f warp(Vector3f newPos) {
62-
Vector3f newPos2d = new Vector3f(newPos.x, 0, newPos.z);
62+
Vector3f newPos2d = new Vector3f(newPos.x, newPos.y, newPos.z);
6363
currentCell = navMesh.findClosestCell(newPos2d);
6464
currentPos3d.set(navMesh.snapPointToCell(currentCell, newPos2d));
6565
currentPos3d.setY(newPos.getY());
@@ -75,7 +75,7 @@ public Vector3f warp(Vector3f newPos) {
7575
* @return the position in the cell
7676
*/
7777
public Vector3f warpInside(Vector3f position) {
78-
Vector3f newPos2d = new Vector3f(position.x, 0, position.z);
78+
Vector3f newPos2d = new Vector3f(position.x, position.y, position.z);
7979
Cell cell = navMesh.findClosestCell(newPos2d);
8080
position.set(navMesh.snapPointToCell(cell, newPos2d));
8181
return position;

0 commit comments

Comments
 (0)