├── manifest.mf ├── native_build └── jNavigationNative.so ├── src └── com │ └── jme3 │ └── ai │ └── navigation │ ├── crowd │ ├── CrowdBuilder.java │ ├── dtCrowdNeighbour.java │ ├── dtAllocHint.java │ ├── CrowdAgentState.java │ ├── ObstacleState.java │ ├── dtObstacleSegment.java │ ├── dtProximityGrid.java │ ├── dtLocalBoundary.java │ ├── UpdateFlags.java │ ├── dtCrowdAgentDebugInfo.java │ ├── dtPathQueue.java │ ├── MoveRequestState.java │ ├── dtObstacleCircle.java │ ├── dtCrowdAgentAnimation.java │ ├── dtObstacleAvoidanceDebugData.java │ ├── dtObstacleAvoidanceParams.java │ ├── dtCrowdAgentParams.java │ ├── dtObstacleAvoidanceQuery.java │ └── dtCrowd.java │ ├── tilecache │ ├── TileCacheBuilder.java │ ├── TileCacheAlloc.java │ ├── TileCacheMeshProcess.java │ ├── TileCacheContourSet.java │ ├── TileFlags.java │ ├── CompressedTileFlags.java │ ├── TileCacheCompressor.java │ ├── TileCacheContour.java │ ├── TileCacheLayer.java │ ├── CompressedTile.java │ ├── TileCacheParams.java │ ├── TileCacheObstacle.java │ ├── TileCachePolyMesh.java │ └── TileCacheLayerHeader.java │ ├── utils │ ├── SWIGTYPE_p_int.java │ ├── SWIGTYPE_p_bool.java │ ├── SWIGTYPE_p_long.java │ ├── SWIGTYPE_p_void.java │ ├── SWIGTYPE_p_float.java │ ├── SWIGTYPE_p_short.java │ ├── SWIGTYPE_p_double.java │ ├── SWIGTYPE_p_p_dtPoly.java │ ├── SWIGTYPE_p_f___float.java │ ├── SWIGTYPE_p_p_dtMeshTile.java │ ├── SWIGTYPE_p_p_rcPolyMesh.java │ ├── SWIGTYPE_p_unsigned_int.java │ ├── SWIGTYPE_p_unsigned_char.java │ ├── SWIGTYPE_p_p_dtCrowdAgent.java │ ├── SWIGTYPE_p_unsigned_short.java │ ├── SWIGTYPE_p_p_unsigned_char.java │ ├── SWIGTYPE_p_p_dtTileCacheLayer.java │ ├── SWIGTYPE_p_p_rcPolyMeshDetail.java │ ├── IntArray.java │ ├── LongArray.java │ ├── FloatArray.java │ ├── DoubleArray.java │ ├── UIntArray.java │ ├── UShortArray.java │ ├── BooleanArray.java │ └── UCharArray.java │ ├── detour │ ├── Status.java │ ├── NodeFlags.java │ ├── NodeQueue.java │ ├── PolyTypes.java │ ├── NodePool.java │ ├── BVNode.java │ ├── StraightPathOptions.java │ ├── PolyDetail.java │ ├── StraightPathFlags.java │ ├── Link.java │ ├── Node.java │ ├── NavMeshParams.java │ ├── OffMeshConnection.java │ ├── QueryFilter.java │ └── Poly.java │ └── recast │ ├── CompactCell.java │ ├── LogCategory.java │ ├── BuildContoursFlags.java │ ├── HeightfieldLayerSet.java │ ├── CompactSpan.java │ ├── Span.java │ ├── Context.java │ └── Contour.java ├── .gitignore ├── nbproject ├── genfiles.properties ├── project.xml └── project.properties ├── LICENSE └── README.md /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /native_build/jNavigationNative.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuietOne/jNavigation/HEAD/native_build/jNavigationNative.so -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/CrowdBuilder.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | /** 4 | * 5 | * @author Tihomir Radosavljevic 6 | * @version 0.3 7 | */ 8 | public class CrowdBuilder { 9 | } 10 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheBuilder.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | /** 4 | * 5 | * @author Tihomir Radosavljevic 6 | * @version 1.0 7 | */ 8 | public class TileCacheBuilder { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | /build/ 14 | /dist/ -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=e2636b3e 2 | build.xml.script.CRC32=776fa1ea 3 | build.xml.stylesheet.CRC32=28e38971@1.56.1.46 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=e2636b3e 7 | nbproject/build-impl.xml.script.CRC32=de0142fb 8 | nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46 9 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | jNavigation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_int.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_int { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_int(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_int() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_int obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_bool.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_bool { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_bool(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_bool() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_bool obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_long.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_long { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_long(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_long() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_long obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_void.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_void { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_void(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_void() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_void obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_float.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_float { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_float(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_float() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_float obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_short.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_short { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_short(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_short() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_short obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_double.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_double { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_double(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_double() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_double obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_p_dtPoly.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_p_dtPoly { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_p_dtPoly(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_p_dtPoly() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_p_dtPoly obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_f___float.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_f___float { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_f___float(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_f___float() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_f___float obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_p_dtMeshTile.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_p_dtMeshTile { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_p_dtMeshTile(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_p_dtMeshTile() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_p_dtMeshTile obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_p_rcPolyMesh.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_p_rcPolyMesh { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_p_rcPolyMesh(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_p_rcPolyMesh() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_p_rcPolyMesh obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_unsigned_int.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_unsigned_int { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_unsigned_int(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_unsigned_int() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_unsigned_int obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_unsigned_char.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_unsigned_char { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_unsigned_char(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_unsigned_char() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_unsigned_char obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_p_dtCrowdAgent.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_p_dtCrowdAgent { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_p_dtCrowdAgent(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_p_dtCrowdAgent() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_p_dtCrowdAgent obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_unsigned_short.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_unsigned_short { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_unsigned_short(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_unsigned_short() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_unsigned_short obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_p_unsigned_char.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_p_unsigned_char { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_p_unsigned_char(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_p_unsigned_char() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_p_unsigned_char obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_p_dtTileCacheLayer.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_p_dtTileCacheLayer { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_p_dtTileCacheLayer(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_p_dtTileCacheLayer() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_p_dtTileCacheLayer obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/SWIGTYPE_p_p_rcPolyMeshDetail.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public class SWIGTYPE_p_p_rcPolyMeshDetail { 13 | private long swigCPtr; 14 | 15 | public SWIGTYPE_p_p_rcPolyMeshDetail(long cPtr, boolean futureUse) { 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public SWIGTYPE_p_p_rcPolyMeshDetail() { 20 | swigCPtr = 0; 21 | } 22 | 23 | public static long getCPtr(SWIGTYPE_p_p_rcPolyMeshDetail obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/Status.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * 7 | * @author Tihomir Radosavljevic 8 | * @version 1.0 9 | */ 10 | public class Status { 11 | 12 | private long status; 13 | 14 | public Status(long status) { 15 | this.status = status; 16 | } 17 | 18 | public boolean isSucceed() { 19 | return RecastJNI.dtStatusSucceed(status); 20 | } 21 | 22 | public boolean isFailed() { 23 | return RecastJNI.dtStatusFailed(status); 24 | } 25 | 26 | public boolean isInProgress() { 27 | return RecastJNI.dtStatusInProgress(status); 28 | } 29 | 30 | public boolean isDetail(long detail) { 31 | return RecastJNI.dtStatusDetail(status, detail); 32 | } 33 | 34 | public long getStatus() { 35 | return status; 36 | } 37 | 38 | public void setStatus(long status) { 39 | this.status = status; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, QuietOne 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of 'jMonkeyEngine' nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheAlloc.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_void; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | 6 | /** 7 | * Note: all native functions are virtual. 8 | * 9 | * @author Tihomir Radosavljevic 10 | * @version 0.5 11 | */ 12 | public class TileCacheAlloc { 13 | 14 | private long swigCPtr; 15 | protected boolean swigCMemOwn; 16 | 17 | public TileCacheAlloc() { 18 | this(RecastJNI.new_dtTileCacheAlloc(), true); 19 | } 20 | 21 | public TileCacheAlloc(long cPtr, boolean cMemoryOwn) { 22 | swigCMemOwn = cMemoryOwn; 23 | swigCPtr = cPtr; 24 | } 25 | 26 | public static long getCPtr(TileCacheAlloc obj) { 27 | return (obj == null) ? 0 : obj.swigCPtr; 28 | } 29 | 30 | @Override 31 | protected void finalize() { 32 | delete(); 33 | } 34 | 35 | public synchronized void delete() { 36 | if (swigCPtr != 0) { 37 | if (swigCMemOwn) { 38 | swigCMemOwn = false; 39 | RecastJNI.delete_dtTileCacheAlloc(swigCPtr); 40 | } 41 | swigCPtr = 0; 42 | } 43 | } 44 | 45 | public void reset() { 46 | RecastJNI.dtTileCacheAlloc_reset(swigCPtr, this); 47 | } 48 | 49 | public SWIGTYPE_p_void alloc(int size) { 50 | long cPtr = RecastJNI.dtTileCacheAlloc_alloc(swigCPtr, this, size); 51 | return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false); 52 | } 53 | 54 | public void free(SWIGTYPE_p_void ptr) { 55 | RecastJNI.dtTileCacheAlloc_free(swigCPtr, this, SWIGTYPE_p_void.getCPtr(ptr)); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheMeshProcess.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.detour.NavMeshCreateParams; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char; 6 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_short; 7 | 8 | /** 9 | * 10 | * @author Tihomir Radosavljevic 11 | * @version 0.5 12 | */ 13 | public class TileCacheMeshProcess { 14 | 15 | private long swigCPtr; 16 | protected boolean swigCMemOwn; 17 | 18 | public TileCacheMeshProcess(long cPtr, boolean cMemoryOwn) { 19 | swigCMemOwn = cMemoryOwn; 20 | swigCPtr = cPtr; 21 | } 22 | 23 | public static long getCPtr(TileCacheMeshProcess obj) { 24 | return (obj == null) ? 0 : obj.swigCPtr; 25 | } 26 | 27 | @Override 28 | protected void finalize() { 29 | delete(); 30 | } 31 | 32 | public synchronized void delete() { 33 | if (swigCPtr != 0) { 34 | if (swigCMemOwn) { 35 | swigCMemOwn = false; 36 | RecastJNI.delete_dtTileCacheMeshProcess(swigCPtr); 37 | } 38 | swigCPtr = 0; 39 | } 40 | } 41 | 42 | /** 43 | * WARNING: virtual 44 | * 45 | * @param params 46 | * @param polyAreas 47 | * @param polyFlags 48 | */ 49 | public void process(NavMeshCreateParams params, SWIGTYPE_p_unsigned_char polyAreas, SWIGTYPE_p_unsigned_short polyFlags) { 50 | RecastJNI.dtTileCacheMeshProcess_process(swigCPtr, this, NavMeshCreateParams.getCPtr(params), params, SWIGTYPE_p_unsigned_char.getCPtr(polyAreas), SWIGTYPE_p_unsigned_short.getCPtr(polyFlags)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/IntArray.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /** 4 | * Helper class for extracting int arrays from native. 5 | * 6 | * @author Tihomir Radosavljevic 7 | * @version 1.0 8 | */ 9 | public class IntArray { 10 | 11 | private long swigCPtr; 12 | protected boolean swigCMemOwn; 13 | 14 | public IntArray(long cPtr, boolean cMemoryOwn) { 15 | swigCMemOwn = cMemoryOwn; 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public static long getCPtr(IntArray obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | @Override 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RecastJNI.delete_IntArray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public IntArray(int nelements) { 39 | this(RecastJNI.new_IntArray(nelements), true); 40 | } 41 | 42 | public int getItem(int index) { 43 | return RecastJNI.IntArray_getitem(swigCPtr, this, index); 44 | } 45 | 46 | public void setItem(int index, int value) { 47 | RecastJNI.IntArray_setitem(swigCPtr, this, index, value); 48 | } 49 | 50 | public SWIGTYPE_p_int cast() { 51 | long cPtr = RecastJNI.IntArray_cast(swigCPtr, this); 52 | return (cPtr == 0) ? null : new SWIGTYPE_p_int(cPtr, false); 53 | } 54 | 55 | public static IntArray frompointer(SWIGTYPE_p_int t) { 56 | long cPtr = RecastJNI.IntArray_frompointer(SWIGTYPE_p_int.getCPtr(t)); 57 | return (cPtr == 0) ? null : new IntArray(cPtr, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/LongArray.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /** 4 | * Helper class for extracting long arrays from native. 5 | * 6 | * @author Tihomir Radosavljevic 7 | * @version 1.0 8 | */ 9 | public class LongArray { 10 | 11 | private long swigCPtr; 12 | protected boolean swigCMemOwn; 13 | 14 | public LongArray(long cPtr, boolean cMemoryOwn) { 15 | swigCMemOwn = cMemoryOwn; 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public static long getCPtr(LongArray obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | @Override 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RecastJNI.delete_LongArray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public LongArray(int nelements) { 39 | this(RecastJNI.new_LongArray(nelements), true); 40 | } 41 | 42 | public int getItem(int index) { 43 | return RecastJNI.LongArray_getitem(swigCPtr, this, index); 44 | } 45 | 46 | public void setItem(int index, int value) { 47 | RecastJNI.LongArray_setitem(swigCPtr, this, index, value); 48 | } 49 | 50 | public SWIGTYPE_p_long cast() { 51 | long cPtr = RecastJNI.LongArray_cast(swigCPtr, this); 52 | return (cPtr == 0) ? null : new SWIGTYPE_p_long(cPtr, false); 53 | } 54 | 55 | public static LongArray fromPointer(SWIGTYPE_p_long t) { 56 | long cPtr = RecastJNI.LongArray_frompointer(SWIGTYPE_p_long.getCPtr(t)); 57 | return (cPtr == 0) ? null : new LongArray(cPtr, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtCrowdNeighbour.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | 6 | /* ---------------------------------------------------------------------------- 7 | * This file was automatically generated by SWIG (http://www.swig.org). 8 | * Version 2.0.4 9 | * 10 | * Do not make changes to this file unless you know what you are doing--modify 11 | * the SWIG interface file instead. 12 | * ----------------------------------------------------------------------------- */ 13 | 14 | 15 | public class dtCrowdNeighbour { 16 | private long swigCPtr; 17 | protected boolean swigCMemOwn; 18 | 19 | public dtCrowdNeighbour(long cPtr, boolean cMemoryOwn) { 20 | swigCMemOwn = cMemoryOwn; 21 | swigCPtr = cPtr; 22 | } 23 | 24 | public static long getCPtr(dtCrowdNeighbour obj) { 25 | return (obj == null) ? 0 : obj.swigCPtr; 26 | } 27 | 28 | protected void finalize() { 29 | delete(); 30 | } 31 | 32 | public synchronized void delete() { 33 | if (swigCPtr != 0) { 34 | if (swigCMemOwn) { 35 | swigCMemOwn = false; 36 | RecastJNI.delete_dtCrowdNeighbour(swigCPtr); 37 | } 38 | swigCPtr = 0; 39 | } 40 | } 41 | 42 | public void setIdx(int value) { 43 | RecastJNI.dtCrowdNeighbour_idx_set(swigCPtr, this, value); 44 | } 45 | 46 | public int getIdx() { 47 | return RecastJNI.dtCrowdNeighbour_idx_get(swigCPtr, this); 48 | } 49 | 50 | public void setDist(float value) { 51 | RecastJNI.dtCrowdNeighbour_dist_set(swigCPtr, this, value); 52 | } 53 | 54 | public float getDist() { 55 | return RecastJNI.dtCrowdNeighbour_dist_get(swigCPtr, this); 56 | } 57 | 58 | public dtCrowdNeighbour() { 59 | this(RecastJNI.new_dtCrowdNeighbour(), true); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/FloatArray.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /** 4 | * Helper class for extracting float arrays from native. 5 | * 6 | * @author Tihomir Radosavljevic 7 | * @version 1.0 8 | */ 9 | public class FloatArray { 10 | 11 | private long swigCPtr; 12 | protected boolean swigCMemOwn; 13 | 14 | public FloatArray(long cPtr, boolean cMemoryOwn) { 15 | swigCMemOwn = cMemoryOwn; 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public static long getCPtr(FloatArray obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | @Override 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RecastJNI.delete_FloatArray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public FloatArray(int nelements) { 39 | this(RecastJNI.new_FloatArray(nelements), true); 40 | } 41 | 42 | public float getItem(int index) { 43 | return RecastJNI.FloatArray_getitem(swigCPtr, this, index); 44 | } 45 | 46 | public void setItem(int index, float value) { 47 | RecastJNI.FloatArray_setitem(swigCPtr, this, index, value); 48 | } 49 | 50 | public SWIGTYPE_p_float cast() { 51 | long cPtr = RecastJNI.FloatArray_cast(swigCPtr, this); 52 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 53 | } 54 | 55 | public static FloatArray fromPointer(SWIGTYPE_p_float t) { 56 | long cPtr = RecastJNI.FloatArray_frompointer(SWIGTYPE_p_float.getCPtr(t)); 57 | return (cPtr == 0) ? null : new FloatArray(cPtr, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/DoubleArray.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /** 4 | * Helper class for extracting double arrays from native. 5 | * 6 | * @author Tihomir Radosavljevic 7 | * @version 1.0 8 | */ 9 | public class DoubleArray { 10 | 11 | private long swigCPtr; 12 | protected boolean swigCMemOwn; 13 | 14 | public DoubleArray(long cPtr, boolean cMemoryOwn) { 15 | swigCMemOwn = cMemoryOwn; 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public static long getCPtr(DoubleArray obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | @Override 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RecastJNI.delete_DoubleArray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public DoubleArray(int nelements) { 39 | this(RecastJNI.new_DoubleArray(nelements), true); 40 | } 41 | 42 | public double getItem(int index) { 43 | return RecastJNI.DoubleArray_getitem(swigCPtr, this, index); 44 | } 45 | 46 | public void setItem(int index, double value) { 47 | RecastJNI.DoubleArray_setitem(swigCPtr, this, index, value); 48 | } 49 | 50 | public SWIGTYPE_p_double cast() { 51 | long cPtr = RecastJNI.DoubleArray_cast(swigCPtr, this); 52 | return (cPtr == 0) ? null : new SWIGTYPE_p_double(cPtr, false); 53 | } 54 | 55 | public static DoubleArray fromPointer(SWIGTYPE_p_double t) { 56 | long cPtr = RecastJNI.DoubleArray_frompointer(SWIGTYPE_p_double.getCPtr(t)); 57 | return (cPtr == 0) ? null : new DoubleArray(cPtr, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/UIntArray.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /** 4 | * Helper class for extracting unsigned integer arrays from native. 5 | * 6 | * @author Tihomir Radosavljevic 7 | * @version 1.0 8 | */ 9 | public class UIntArray { 10 | 11 | private long swigCPtr; 12 | protected boolean swigCMemOwn; 13 | 14 | public UIntArray(long cPtr, boolean cMemoryOwn) { 15 | swigCMemOwn = cMemoryOwn; 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public static long getCPtr(UIntArray obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | @Override 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RecastJNI.delete_UIntArray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public UIntArray(int nelements) { 39 | this(RecastJNI.new_UIntArray(nelements), true); 40 | } 41 | 42 | public long getItem(int index) { 43 | return RecastJNI.UIntArray_getitem(swigCPtr, this, index); 44 | } 45 | 46 | public void setItem(int index, long value) { 47 | RecastJNI.UIntArray_setitem(swigCPtr, this, index, value); 48 | } 49 | 50 | public SWIGTYPE_p_unsigned_int cast() { 51 | long cPtr = RecastJNI.UIntArray_cast(swigCPtr, this); 52 | return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_int(cPtr, false); 53 | } 54 | 55 | public static UIntArray fromPointer(SWIGTYPE_p_unsigned_int t) { 56 | long cPtr = RecastJNI.UIntArray_frompointer(SWIGTYPE_p_unsigned_int.getCPtr(t)); 57 | return (cPtr == 0) ? null : new UIntArray(cPtr, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheContourSet.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * 7 | * @author Tihomir Radosavljevic 8 | * @version 0.5 9 | */ 10 | public class TileCacheContourSet { 11 | 12 | private long swigCPtr; 13 | protected boolean swigCMemOwn; 14 | 15 | public TileCacheContourSet() { 16 | this(RecastJNI.new_dtTileCacheContourSet(), true); 17 | } 18 | 19 | public TileCacheContourSet(long cPtr, boolean cMemoryOwn) { 20 | swigCMemOwn = cMemoryOwn; 21 | swigCPtr = cPtr; 22 | } 23 | 24 | public static long getCPtr(TileCacheContourSet obj) { 25 | return (obj == null) ? 0 : obj.swigCPtr; 26 | } 27 | 28 | @Override 29 | protected void finalize() { 30 | delete(); 31 | } 32 | 33 | public synchronized void delete() { 34 | if (swigCPtr != 0) { 35 | if (swigCMemOwn) { 36 | swigCMemOwn = false; 37 | RecastJNI.delete_dtTileCacheContourSet(swigCPtr); 38 | } 39 | swigCPtr = 0; 40 | } 41 | } 42 | 43 | public void setNumberOfContours(int value) { 44 | RecastJNI.dtTileCacheContourSet_nconts_set(swigCPtr, this, value); 45 | } 46 | 47 | public int getNumberOfContours() { 48 | return RecastJNI.dtTileCacheContourSet_nconts_get(swigCPtr, this); 49 | } 50 | 51 | public void setContours(TileCacheContour value) { 52 | RecastJNI.dtTileCacheContourSet_conts_set(swigCPtr, this, TileCacheContour.getCPtr(value), value); 53 | } 54 | 55 | public TileCacheContour getContours() { 56 | long cPtr = RecastJNI.dtTileCacheContourSet_conts_get(swigCPtr, this); 57 | return (cPtr == 0) ? null : new TileCacheContour(cPtr, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/UShortArray.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /** 4 | * Helper class for extracting unsigned short arrays from native. 5 | * 6 | * @author Tihomir Radosavljevic 7 | * @version 1.0 8 | */ 9 | public class UShortArray { 10 | 11 | private long swigCPtr; 12 | protected boolean swigCMemOwn; 13 | 14 | public UShortArray(long cPtr, boolean cMemoryOwn) { 15 | swigCMemOwn = cMemoryOwn; 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public static long getCPtr(UShortArray obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | @Override 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RecastJNI.delete_UShortArray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public UShortArray(int nelements) { 39 | this(RecastJNI.new_UShortArray(nelements), true); 40 | } 41 | 42 | public int getItem(int index) { 43 | return RecastJNI.UShortArray_getitem(swigCPtr, this, index); 44 | } 45 | 46 | public void setItem(int index, int value) { 47 | RecastJNI.UShortArray_setitem(swigCPtr, this, index, value); 48 | } 49 | 50 | public SWIGTYPE_p_unsigned_short cast() { 51 | long cPtr = RecastJNI.UShortArray_cast(swigCPtr, this); 52 | return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_short(cPtr, false); 53 | } 54 | 55 | public static UShortArray fromPointer(SWIGTYPE_p_unsigned_short t) { 56 | long cPtr = RecastJNI.UShortArray_frompointer(SWIGTYPE_p_unsigned_short.getCPtr(t)); 57 | return (cPtr == 0) ? null : new UShortArray(cPtr, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/recast/CompactCell.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.recast; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Provides information on the content of a cell column in a compact 7 | * heightfield. 8 | * 9 | * Useful instances of this type can only by obtained from a CompactHeightfield 10 | * object. 11 | * 12 | * @see CompactHeightfield 13 | * 14 | * @author Tihomir Radosavljevic 15 | * @version 1.0 16 | */ 17 | public class CompactCell { 18 | 19 | private long swigCPtr; 20 | protected boolean swigCMemOwn; 21 | 22 | /** 23 | * Internal use only. 24 | */ 25 | protected CompactCell(long cPtr, boolean cMemoryOwn) { 26 | swigCMemOwn = cMemoryOwn; 27 | swigCPtr = cPtr; 28 | } 29 | 30 | public static long getCPtr(CompactCell obj) { 31 | return (obj == null) ? 0 : obj.swigCPtr; 32 | } 33 | 34 | @Override 35 | protected void finalize() { 36 | delete(); 37 | } 38 | 39 | public synchronized void delete() { 40 | if (swigCPtr != 0) { 41 | if (swigCMemOwn) { 42 | swigCMemOwn = false; 43 | RecastJNI.delete_rcCompactCell(swigCPtr); 44 | } 45 | swigCPtr = 0; 46 | } 47 | } 48 | 49 | // public void setIndex(long value) { 50 | // RecastJNI.rcCompactCell_index_set(swigCPtr, this, value); 51 | // } 52 | /** 53 | * 54 | * @return Index to the first span in the column. 55 | */ 56 | public long getIndex() { 57 | return RecastJNI.rcCompactCell_index_get(swigCPtr, this); 58 | } 59 | 60 | // public void setCount(long value) { 61 | // RecastJNI.rcCompactCell_count_set(swigCPtr, this, value); 62 | // } 63 | /** 64 | * 65 | * @return Number of spans in the column. 66 | */ 67 | public long getCount() { 68 | return RecastJNI.rcCompactCell_count_get(swigCPtr, this); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/NodeFlags.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * 7 | * @author Tihomir Radosavljevic 8 | * @version 0.99 9 | */ 10 | public final class NodeFlags { 11 | 12 | public final static NodeFlags DT_NODE_OPEN = new NodeFlags("DT_NODE_OPEN", RecastJNI.DT_NODE_OPEN_get()); 13 | public final static NodeFlags DT_NODE_CLOSED = new NodeFlags("DT_NODE_CLOSED", RecastJNI.DT_NODE_CLOSED_get()); 14 | 15 | public final int swigValue() { 16 | return swigValue; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static NodeFlags swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) { 26 | return swigValues[swigValue]; 27 | } 28 | for (int i = 0; i < swigValues.length; i++) { 29 | if (swigValues[i].swigValue == swigValue) { 30 | return swigValues[i]; 31 | } 32 | } 33 | throw new IllegalArgumentException("No enum " + NodeFlags.class + " with value " + swigValue); 34 | } 35 | 36 | private NodeFlags(String swigName) { 37 | this.swigName = swigName; 38 | this.swigValue = swigNext++; 39 | } 40 | 41 | private NodeFlags(String swigName, int swigValue) { 42 | this.swigName = swigName; 43 | this.swigValue = swigValue; 44 | swigNext = swigValue + 1; 45 | } 46 | 47 | private NodeFlags(String swigName, NodeFlags swigEnum) { 48 | this.swigName = swigName; 49 | this.swigValue = swigEnum.swigValue; 50 | swigNext = this.swigValue + 1; 51 | } 52 | private static NodeFlags[] swigValues = {DT_NODE_OPEN, DT_NODE_CLOSED}; 53 | private static int swigNext = 0; 54 | private final int swigValue; 55 | private final String swigName; 56 | } 57 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtAllocHint.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public final class dtAllocHint { 13 | public final static dtAllocHint DT_ALLOC_PERM = new dtAllocHint("DT_ALLOC_PERM"); 14 | public final static dtAllocHint DT_ALLOC_TEMP = new dtAllocHint("DT_ALLOC_TEMP"); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static dtAllocHint swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + dtAllocHint.class + " with value " + swigValue); 31 | } 32 | 33 | private dtAllocHint(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private dtAllocHint(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private dtAllocHint(String swigName, dtAllocHint swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static dtAllocHint[] swigValues = { DT_ALLOC_PERM, DT_ALLOC_TEMP }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileFlags.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Tile flags used for various functions and fields. 7 | * 8 | * @author Tihomir Radosavljevic 9 | * @version 1.0 10 | */ 11 | public final class TileFlags { 12 | 13 | /** 14 | * The navigation mesh owns the tile memory and is responsible for freeing 15 | * it. 16 | */ 17 | public final static TileFlags DT_TILE_FREE_DATA = new TileFlags("DT_TILE_FREE_DATA", RecastJNI.DT_TILE_FREE_DATA_get()); 18 | 19 | public final int value() { 20 | return swigValue; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return swigName; 26 | } 27 | 28 | public static TileFlags swigToEnum(int swigValue) { 29 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) { 30 | return swigValues[swigValue]; 31 | } 32 | for (int i = 0; i < swigValues.length; i++) { 33 | if (swigValues[i].swigValue == swigValue) { 34 | return swigValues[i]; 35 | } 36 | } 37 | throw new IllegalArgumentException("No enum " + TileFlags.class + " with value " + swigValue); 38 | } 39 | 40 | private TileFlags(String swigName) { 41 | this.swigName = swigName; 42 | this.swigValue = swigNext++; 43 | } 44 | 45 | private TileFlags(String swigName, int swigValue) { 46 | this.swigName = swigName; 47 | this.swigValue = swigValue; 48 | swigNext = swigValue + 1; 49 | } 50 | 51 | private TileFlags(String swigName, TileFlags swigEnum) { 52 | this.swigName = swigName; 53 | this.swigValue = swigEnum.swigValue; 54 | swigNext = this.swigValue + 1; 55 | } 56 | private static TileFlags[] swigValues = {DT_TILE_FREE_DATA}; 57 | private static int swigNext = 0; 58 | private final int swigValue; 59 | private final String swigName; 60 | } 61 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/BooleanArray.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | public class BooleanArray { 11 | 12 | private long swigCPtr; 13 | protected boolean swigCMemOwn; 14 | 15 | public BooleanArray(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | public static long getCPtr(BooleanArray obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RecastJNI.delete_BooleanArray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public BooleanArray(int nelements) { 39 | this(RecastJNI.new_BooleanArray(nelements), true); 40 | } 41 | 42 | public boolean getitem(int index) { 43 | return RecastJNI.BooleanArray_getitem(swigCPtr, this, index); 44 | } 45 | 46 | public void setitem(int index, boolean value) { 47 | RecastJNI.BooleanArray_setitem(swigCPtr, this, index, value); 48 | } 49 | 50 | public SWIGTYPE_p_bool cast() { 51 | long cPtr = RecastJNI.BooleanArray_cast(swigCPtr, this); 52 | return (cPtr == 0) ? null : new SWIGTYPE_p_bool(cPtr, false); 53 | } 54 | 55 | public static BooleanArray frompointer(SWIGTYPE_p_bool t) { 56 | long cPtr = RecastJNI.BooleanArray_frompointer(SWIGTYPE_p_bool.getCPtr(t)); 57 | return (cPtr == 0) ? null : new BooleanArray(cPtr, false); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/utils/UCharArray.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.utils; 2 | 3 | /** 4 | * Helper class for extracting unsigned char arrays from native. 5 | * 6 | * @author Tihomir Radosavljevic 7 | * @version 1.0 8 | */ 9 | public class UCharArray { 10 | 11 | private long swigCPtr; 12 | protected boolean swigCMemOwn; 13 | 14 | public UCharArray(long cPtr, boolean cMemoryOwn) { 15 | swigCMemOwn = cMemoryOwn; 16 | swigCPtr = cPtr; 17 | } 18 | 19 | public static long getCPtr(UCharArray obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | @Override 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | RecastJNI.delete_UCharArray(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public UCharArray(int nelements) { 39 | this(RecastJNI.new_UCharArray(nelements), true); 40 | } 41 | 42 | public short getItem(int index) { 43 | return RecastJNI.UCharArray_getitem(swigCPtr, this, index); 44 | } 45 | 46 | public void setItem(int index, short value) { 47 | RecastJNI.UCharArray_setitem(swigCPtr, this, index, value); 48 | } 49 | 50 | public SWIGTYPE_p_unsigned_char cast() { 51 | long cPtr = RecastJNI.UCharArray_cast(swigCPtr, this); 52 | return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); 53 | } 54 | 55 | public SWIGTYPE_p_p_unsigned_char castDoublePointer() { 56 | long cPtr = RecastJNI.UCharArray_cast(swigCPtr, this); 57 | return (cPtr == 0) ? null : new SWIGTYPE_p_p_unsigned_char(cPtr, false); 58 | } 59 | 60 | public static UCharArray fromPointer(SWIGTYPE_p_unsigned_char t) { 61 | long cPtr = RecastJNI.UCharArray_frompointer(SWIGTYPE_p_unsigned_char.getCPtr(t)); 62 | return (cPtr == 0) ? null : new UCharArray(cPtr, false); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/CompressedTileFlags.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Flags for addTile. 7 | * 8 | * @author Tihomir Radosavljevic 9 | * @version 1.0 10 | */ 11 | public final class CompressedTileFlags { 12 | 13 | /** 14 | * Navmesh owns the tile memory and should free it. 15 | */ 16 | public final static CompressedTileFlags DT_COMPRESSEDTILE_FREE_DATA = new CompressedTileFlags("DT_COMPRESSEDTILE_FREE_DATA", RecastJNI.DT_COMPRESSEDTILE_FREE_DATA_get()); 17 | 18 | public final int value() { 19 | return swigValue; 20 | } 21 | 22 | @Override 23 | public String toString() { 24 | return swigName; 25 | } 26 | 27 | public static CompressedTileFlags swigToEnum(int swigValue) { 28 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) { 29 | return swigValues[swigValue]; 30 | } 31 | for (int i = 0; i < swigValues.length; i++) { 32 | if (swigValues[i].swigValue == swigValue) { 33 | return swigValues[i]; 34 | } 35 | } 36 | throw new IllegalArgumentException("No enum " + CompressedTileFlags.class + " with value " + swigValue); 37 | } 38 | 39 | private CompressedTileFlags(String swigName) { 40 | this.swigName = swigName; 41 | this.swigValue = swigNext++; 42 | } 43 | 44 | private CompressedTileFlags(String swigName, int swigValue) { 45 | this.swigName = swigName; 46 | this.swigValue = swigValue; 47 | swigNext = swigValue + 1; 48 | } 49 | 50 | private CompressedTileFlags(String swigName, CompressedTileFlags swigEnum) { 51 | this.swigName = swigName; 52 | this.swigValue = swigEnum.swigValue; 53 | swigNext = this.swigValue + 1; 54 | } 55 | private static CompressedTileFlags[] swigValues = {DT_COMPRESSEDTILE_FREE_DATA}; 56 | private static int swigNext = 0; 57 | private final int swigValue; 58 | private final String swigName; 59 | } 60 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheCompressor.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_int; 6 | 7 | /** 8 | * 9 | * @author Tihomir Radosavljevic 10 | * @version 0.5 11 | */ 12 | public class TileCacheCompressor { 13 | 14 | private long swigCPtr; 15 | protected boolean swigCMemOwn; 16 | 17 | public TileCacheCompressor(long cPtr, boolean cMemoryOwn) { 18 | swigCMemOwn = cMemoryOwn; 19 | swigCPtr = cPtr; 20 | } 21 | 22 | public static long getCPtr(TileCacheCompressor obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | 26 | @Override 27 | protected void finalize() { 28 | delete(); 29 | } 30 | 31 | public synchronized void delete() { 32 | if (swigCPtr != 0) { 33 | if (swigCMemOwn) { 34 | swigCMemOwn = false; 35 | RecastJNI.delete_dtTileCacheCompressor(swigCPtr); 36 | } 37 | swigCPtr = 0; 38 | } 39 | } 40 | 41 | public int maxCompressedSize(int bufferSize) { 42 | return RecastJNI.dtTileCacheCompressor_maxCompressedSize(swigCPtr, this, bufferSize); 43 | } 44 | 45 | public long compress(SWIGTYPE_p_unsigned_char buffer, int bufferSize, SWIGTYPE_p_unsigned_char compressed, int maxCompressedSize, SWIGTYPE_p_int compressedSize) { 46 | return RecastJNI.dtTileCacheCompressor_compress(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(buffer), bufferSize, SWIGTYPE_p_unsigned_char.getCPtr(compressed), maxCompressedSize, SWIGTYPE_p_int.getCPtr(compressedSize)); 47 | } 48 | 49 | public long decompress(SWIGTYPE_p_unsigned_char compressed, int compressedSize, SWIGTYPE_p_unsigned_char buffer, int maxBufferSize, SWIGTYPE_p_int bufferSize) { 50 | return RecastJNI.dtTileCacheCompressor_decompress(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(compressed), compressedSize, SWIGTYPE_p_unsigned_char.getCPtr(buffer), maxBufferSize, SWIGTYPE_p_int.getCPtr(bufferSize)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/NodeQueue.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * 7 | * @author Tihomir Radosavljevic 8 | * @version 0.5 9 | */ 10 | public class NodeQueue { 11 | 12 | private long swigCPtr; 13 | protected boolean swigCMemOwn; 14 | 15 | public NodeQueue(int n) { 16 | this(RecastJNI.new_dtNodeQueue(n), true); 17 | } 18 | 19 | public NodeQueue(long cPtr, boolean cMemoryOwn) { 20 | swigCMemOwn = cMemoryOwn; 21 | swigCPtr = cPtr; 22 | } 23 | 24 | public static long getCPtr(NodeQueue obj) { 25 | return (obj == null) ? 0 : obj.swigCPtr; 26 | } 27 | 28 | @Override 29 | protected void finalize() { 30 | delete(); 31 | } 32 | 33 | public synchronized void delete() { 34 | if (swigCPtr != 0) { 35 | if (swigCMemOwn) { 36 | swigCMemOwn = false; 37 | RecastJNI.delete_dtNodeQueue(swigCPtr); 38 | } 39 | swigCPtr = 0; 40 | } 41 | } 42 | 43 | public void clear() { 44 | RecastJNI.dtNodeQueue_clear(swigCPtr, this); 45 | } 46 | 47 | public Node top() { 48 | long cPtr = RecastJNI.dtNodeQueue_top(swigCPtr, this); 49 | return (cPtr == 0) ? null : new Node(cPtr, false); 50 | } 51 | 52 | public Node pop() { 53 | long cPtr = RecastJNI.dtNodeQueue_pop(swigCPtr, this); 54 | return (cPtr == 0) ? null : new Node(cPtr, false); 55 | } 56 | 57 | public void push(Node node) { 58 | RecastJNI.dtNodeQueue_push(swigCPtr, this, Node.getCPtr(node), node); 59 | } 60 | 61 | public void modify(Node node) { 62 | RecastJNI.dtNodeQueue_modify(swigCPtr, this, Node.getCPtr(node), node); 63 | } 64 | 65 | public boolean empty() { 66 | return RecastJNI.dtNodeQueue_empty(swigCPtr, this); 67 | } 68 | 69 | public int getMemoryUsed() { 70 | return RecastJNI.dtNodeQueue_getMemUsed(swigCPtr, this); 71 | } 72 | 73 | public int getCapacity() { 74 | return RecastJNI.dtNodeQueue_getCapacity(swigCPtr, this); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/recast/LogCategory.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.recast; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Recast log categories. 7 | * 8 | * @author Tihomir Radosavljevic 9 | * @version 1.0 10 | */ 11 | public final class LogCategory { 12 | 13 | /** 14 | * A progress log entry. 15 | */ 16 | public final static LogCategory RC_LOG_PROGRESS = new LogCategory("RC_LOG_PROGRESS", RecastJNI.RC_LOG_PROGRESS_get()); 17 | /** 18 | * A warning log entry. 19 | */ 20 | public final static LogCategory RC_LOG_WARNING = new LogCategory("RC_LOG_WARNING"); 21 | /** 22 | * An error log entry. 23 | */ 24 | public final static LogCategory RC_LOG_ERROR = new LogCategory("RC_LOG_ERROR"); 25 | 26 | public final int swigValue() { 27 | return swigValue; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return swigName; 33 | } 34 | 35 | public static LogCategory swigToEnum(int swigValue) { 36 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) { 37 | return swigValues[swigValue]; 38 | } 39 | for (int i = 0; i < swigValues.length; i++) { 40 | if (swigValues[i].swigValue == swigValue) { 41 | return swigValues[i]; 42 | } 43 | } 44 | throw new IllegalArgumentException("No enum " + LogCategory.class + " with value " + swigValue); 45 | } 46 | 47 | private LogCategory(String swigName) { 48 | this.swigName = swigName; 49 | this.swigValue = swigNext++; 50 | } 51 | 52 | private LogCategory(String swigName, int swigValue) { 53 | this.swigName = swigName; 54 | this.swigValue = swigValue; 55 | swigNext = swigValue + 1; 56 | } 57 | 58 | private LogCategory(String swigName, LogCategory swigEnum) { 59 | this.swigName = swigName; 60 | this.swigValue = swigEnum.swigValue; 61 | swigNext = this.swigValue + 1; 62 | } 63 | private static LogCategory[] swigValues = {RC_LOG_PROGRESS, RC_LOG_WARNING, RC_LOG_ERROR}; 64 | private static int swigNext = 0; 65 | private final int swigValue; 66 | private final String swigName; 67 | } 68 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/CrowdAgentState.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public final class CrowdAgentState { 13 | public final static CrowdAgentState DT_CROWDAGENT_STATE_INVALID = new CrowdAgentState("DT_CROWDAGENT_STATE_INVALID"); 14 | public final static CrowdAgentState DT_CROWDAGENT_STATE_WALKING = new CrowdAgentState("DT_CROWDAGENT_STATE_WALKING"); 15 | public final static CrowdAgentState DT_CROWDAGENT_STATE_OFFMESH = new CrowdAgentState("DT_CROWDAGENT_STATE_OFFMESH"); 16 | 17 | public final int swigValue() { 18 | return swigValue; 19 | } 20 | 21 | public String toString() { 22 | return swigName; 23 | } 24 | 25 | public static CrowdAgentState swigToEnum(int swigValue) { 26 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 27 | return swigValues[swigValue]; 28 | for (int i = 0; i < swigValues.length; i++) 29 | if (swigValues[i].swigValue == swigValue) 30 | return swigValues[i]; 31 | throw new IllegalArgumentException("No enum " + CrowdAgentState.class + " with value " + swigValue); 32 | } 33 | 34 | private CrowdAgentState(String swigName) { 35 | this.swigName = swigName; 36 | this.swigValue = swigNext++; 37 | } 38 | 39 | private CrowdAgentState(String swigName, int swigValue) { 40 | this.swigName = swigName; 41 | this.swigValue = swigValue; 42 | swigNext = swigValue+1; 43 | } 44 | 45 | private CrowdAgentState(String swigName, CrowdAgentState swigEnum) { 46 | this.swigName = swigName; 47 | this.swigValue = swigEnum.swigValue; 48 | swigNext = this.swigValue+1; 49 | } 50 | 51 | private static CrowdAgentState[] swigValues = { DT_CROWDAGENT_STATE_INVALID, DT_CROWDAGENT_STATE_WALKING, DT_CROWDAGENT_STATE_OFFMESH }; 52 | private static int swigNext = 0; 53 | private final int swigValue; 54 | private final String swigName; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/ObstacleState.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | /* ---------------------------------------------------------------------------- 4 | * This file was automatically generated by SWIG (http://www.swig.org). 5 | * Version 2.0.4 6 | * 7 | * Do not make changes to this file unless you know what you are doing--modify 8 | * the SWIG interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | 12 | public final class ObstacleState { 13 | public final static ObstacleState DT_OBSTACLE_EMPTY = new ObstacleState("DT_OBSTACLE_EMPTY"); 14 | public final static ObstacleState DT_OBSTACLE_PROCESSING = new ObstacleState("DT_OBSTACLE_PROCESSING"); 15 | public final static ObstacleState DT_OBSTACLE_PROCESSED = new ObstacleState("DT_OBSTACLE_PROCESSED"); 16 | public final static ObstacleState DT_OBSTACLE_REMOVING = new ObstacleState("DT_OBSTACLE_REMOVING"); 17 | 18 | public final int swigValue() { 19 | return swigValue; 20 | } 21 | 22 | public String toString() { 23 | return swigName; 24 | } 25 | 26 | public static ObstacleState swigToEnum(int swigValue) { 27 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 28 | return swigValues[swigValue]; 29 | for (int i = 0; i < swigValues.length; i++) 30 | if (swigValues[i].swigValue == swigValue) 31 | return swigValues[i]; 32 | throw new IllegalArgumentException("No enum " + ObstacleState.class + " with value " + swigValue); 33 | } 34 | 35 | private ObstacleState(String swigName) { 36 | this.swigName = swigName; 37 | this.swigValue = swigNext++; 38 | } 39 | 40 | private ObstacleState(String swigName, int swigValue) { 41 | this.swigName = swigName; 42 | this.swigValue = swigValue; 43 | swigNext = swigValue+1; 44 | } 45 | 46 | private ObstacleState(String swigName, ObstacleState swigEnum) { 47 | this.swigName = swigName; 48 | this.swigValue = swigEnum.swigValue; 49 | swigNext = this.swigValue+1; 50 | } 51 | 52 | private static ObstacleState[] swigValues = { DT_OBSTACLE_EMPTY, DT_OBSTACLE_PROCESSING, DT_OBSTACLE_PROCESSED, DT_OBSTACLE_REMOVING }; 53 | private static int swigNext = 0; 54 | private final int swigValue; 55 | private final String swigName; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/PolyTypes.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Flags representing the type of a navigation mesh polygon. 7 | * 8 | * @author Tihomir Radosavljevic 9 | * @version 1.0 10 | */ 11 | public final class PolyTypes { 12 | 13 | /** 14 | * The polygon is a standard convex polygon that is part of the surface of 15 | * the mesh. 16 | */ 17 | public final static PolyTypes DT_POLYTYPE_GROUND = new PolyTypes("DT_POLYTYPE_GROUND", RecastJNI.DT_POLYTYPE_GROUND_get()); 18 | /** 19 | * The polygon is an off-mesh connection consisting of two vertices. 20 | */ 21 | public final static PolyTypes DT_POLYTYPE_OFFMESH_CONNECTION = new PolyTypes("DT_POLYTYPE_OFFMESH_CONNECTION", RecastJNI.DT_POLYTYPE_OFFMESH_CONNECTION_get()); 22 | 23 | public final int value() { 24 | return swigValue; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return swigName; 30 | } 31 | 32 | public static PolyTypes swigToEnum(int swigValue) { 33 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) { 34 | return swigValues[swigValue]; 35 | } 36 | for (int i = 0; i < swigValues.length; i++) { 37 | if (swigValues[i].swigValue == swigValue) { 38 | return swigValues[i]; 39 | } 40 | } 41 | throw new IllegalArgumentException("No enum " + PolyTypes.class + " with value " + swigValue); 42 | } 43 | 44 | private PolyTypes(String swigName) { 45 | this.swigName = swigName; 46 | this.swigValue = swigNext++; 47 | } 48 | 49 | private PolyTypes(String swigName, int swigValue) { 50 | this.swigName = swigName; 51 | this.swigValue = swigValue; 52 | swigNext = swigValue + 1; 53 | } 54 | 55 | private PolyTypes(String swigName, PolyTypes swigEnum) { 56 | this.swigName = swigName; 57 | this.swigValue = swigEnum.swigValue; 58 | swigNext = this.swigValue + 1; 59 | } 60 | private static PolyTypes[] swigValues = {DT_POLYTYPE_GROUND, DT_POLYTYPE_OFFMESH_CONNECTION}; 61 | private static int swigNext = 0; 62 | private final int swigValue; 63 | private final String swigName; 64 | } 65 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtObstacleSegment.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | 7 | /* ---------------------------------------------------------------------------- 8 | * This file was automatically generated by SWIG (http://www.swig.org). 9 | * Version 2.0.4 10 | * 11 | * Do not make changes to this file unless you know what you are doing--modify 12 | * the SWIG interface file instead. 13 | * ----------------------------------------------------------------------------- */ 14 | 15 | 16 | public class dtObstacleSegment { 17 | private long swigCPtr; 18 | protected boolean swigCMemOwn; 19 | 20 | public dtObstacleSegment(long cPtr, boolean cMemoryOwn) { 21 | swigCMemOwn = cMemoryOwn; 22 | swigCPtr = cPtr; 23 | } 24 | 25 | public static long getCPtr(dtObstacleSegment obj) { 26 | return (obj == null) ? 0 : obj.swigCPtr; 27 | } 28 | 29 | protected void finalize() { 30 | delete(); 31 | } 32 | 33 | public synchronized void delete() { 34 | if (swigCPtr != 0) { 35 | if (swigCMemOwn) { 36 | swigCMemOwn = false; 37 | RecastJNI.delete_dtObstacleSegment(swigCPtr); 38 | } 39 | swigCPtr = 0; 40 | } 41 | } 42 | 43 | public void setP(SWIGTYPE_p_float value) { 44 | RecastJNI.dtObstacleSegment_p_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 45 | } 46 | 47 | public SWIGTYPE_p_float getP() { 48 | long cPtr = RecastJNI.dtObstacleSegment_p_get(swigCPtr, this); 49 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 50 | } 51 | 52 | public void setQ(SWIGTYPE_p_float value) { 53 | RecastJNI.dtObstacleSegment_q_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 54 | } 55 | 56 | public SWIGTYPE_p_float getQ() { 57 | long cPtr = RecastJNI.dtObstacleSegment_q_get(swigCPtr, this); 58 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 59 | } 60 | 61 | public void setTouch(boolean value) { 62 | RecastJNI.dtObstacleSegment_touch_set(swigCPtr, this, value); 63 | } 64 | 65 | public boolean getTouch() { 66 | return RecastJNI.dtObstacleSegment_touch_get(swigCPtr, this); 67 | } 68 | 69 | public dtObstacleSegment() { 70 | this(RecastJNI.new_dtObstacleSegment(), true); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/recast/BuildContoursFlags.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.recast; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Contour build flags. 7 | * 8 | * @author Tihomir Radosavljevic 9 | * @version 1.0 10 | */ 11 | public final class BuildContoursFlags { 12 | 13 | /** 14 | * Tessellate solid (impassable) edges during contour simplification. 15 | */ 16 | public final static BuildContoursFlags RC_CONTOUR_TESS_WALL_EDGES = new BuildContoursFlags("RC_CONTOUR_TESS_WALL_EDGES", RecastJNI.RC_CONTOUR_TESS_WALL_EDGES_get()); 17 | /** 18 | * Tessellate edges between areas during contour simplification. 19 | */ 20 | public final static BuildContoursFlags RC_CONTOUR_TESS_AREA_EDGES = new BuildContoursFlags("RC_CONTOUR_TESS_AREA_EDGES", RecastJNI.RC_CONTOUR_TESS_AREA_EDGES_get()); 21 | 22 | public final int value() { 23 | return swigValue; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return swigName; 29 | } 30 | 31 | public static BuildContoursFlags swigToEnum(int swigValue) { 32 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) { 33 | return swigValues[swigValue]; 34 | } 35 | for (int i = 0; i < swigValues.length; i++) { 36 | if (swigValues[i].swigValue == swigValue) { 37 | return swigValues[i]; 38 | } 39 | } 40 | throw new IllegalArgumentException("No enum " + BuildContoursFlags.class + " with value " + swigValue); 41 | } 42 | 43 | private BuildContoursFlags(String swigName) { 44 | this.swigName = swigName; 45 | this.swigValue = swigNext++; 46 | } 47 | 48 | private BuildContoursFlags(String swigName, int swigValue) { 49 | this.swigName = swigName; 50 | this.swigValue = swigValue; 51 | swigNext = swigValue + 1; 52 | } 53 | 54 | private BuildContoursFlags(String swigName, BuildContoursFlags swigEnum) { 55 | this.swigName = swigName; 56 | this.swigValue = swigEnum.swigValue; 57 | swigNext = this.swigValue + 1; 58 | } 59 | private static BuildContoursFlags[] swigValues = {RC_CONTOUR_TESS_WALL_EDGES, RC_CONTOUR_TESS_AREA_EDGES}; 60 | private static int swigNext = 0; 61 | private final int swigValue; 62 | private final String swigName; 63 | } 64 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/NodePool.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * 7 | * @author Tihomir Radosavljevic 8 | * @version 0.5 9 | */ 10 | public class NodePool { 11 | 12 | private long swigCPtr; 13 | protected boolean swigCMemOwn; 14 | 15 | public NodePool(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | public static long getCPtr(NodePool obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | @Override 25 | protected void finalize() { 26 | delete(); 27 | } 28 | 29 | public synchronized void delete() { 30 | if (swigCPtr != 0) { 31 | if (swigCMemOwn) { 32 | swigCMemOwn = false; 33 | RecastJNI.delete_dtNodePool(swigCPtr); 34 | } 35 | swigCPtr = 0; 36 | } 37 | } 38 | 39 | public NodePool(int maxNodes, int hashSize) { 40 | this(RecastJNI.new_dtNodePool(maxNodes, hashSize), true); 41 | } 42 | 43 | public void clear() { 44 | RecastJNI.dtNodePool_clear(swigCPtr, this); 45 | } 46 | 47 | public Node getNode(long id) { 48 | long cPtr = RecastJNI.dtNodePool_getNode(swigCPtr, this, id); 49 | return (cPtr == 0) ? null : new Node(cPtr, false); 50 | } 51 | 52 | public Node findNode(long id) { 53 | long cPtr = RecastJNI.dtNodePool_findNode(swigCPtr, this, id); 54 | return (cPtr == 0) ? null : new Node(cPtr, false); 55 | } 56 | 57 | public long getNodeIdx(Node node) { 58 | return RecastJNI.dtNodePool_getNodeIdx(swigCPtr, this, Node.getCPtr(node), node); 59 | } 60 | 61 | public Node getNodeAtIdx(long idx) { 62 | long cPtr = RecastJNI.dtNodePool_getNodeAtIdx__SWIG_0(swigCPtr, this, idx); 63 | return (cPtr == 0) ? null : new Node(cPtr, false); 64 | } 65 | 66 | public int getMemUsed() { 67 | return RecastJNI.dtNodePool_getMemUsed(swigCPtr, this); 68 | } 69 | 70 | public int getMaxNodes() { 71 | return RecastJNI.dtNodePool_getMaxNodes(swigCPtr, this); 72 | } 73 | 74 | public int getHashSize() { 75 | return RecastJNI.dtNodePool_getHashSize(swigCPtr, this); 76 | } 77 | 78 | public int getFirst(int bucket) { 79 | return RecastJNI.dtNodePool_getFirst(swigCPtr, this, bucket); 80 | } 81 | 82 | public int getNext(int i) { 83 | return RecastJNI.dtNodePool_getNext(swigCPtr, this, i); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheContour.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char; 6 | 7 | /** 8 | * 9 | * @author Tihomir Radosavljevic 10 | * @version 1.0 11 | */ 12 | public class TileCacheContour { 13 | 14 | private long swigCPtr; 15 | protected boolean swigCMemOwn; 16 | 17 | public TileCacheContour() { 18 | this(RecastJNI.new_dtTileCacheContour(), true); 19 | } 20 | 21 | public TileCacheContour(long cPtr, boolean cMemoryOwn) { 22 | swigCMemOwn = cMemoryOwn; 23 | swigCPtr = cPtr; 24 | } 25 | 26 | public static long getCPtr(TileCacheContour obj) { 27 | return (obj == null) ? 0 : obj.swigCPtr; 28 | } 29 | 30 | @Override 31 | protected void finalize() { 32 | delete(); 33 | } 34 | 35 | public synchronized void delete() { 36 | if (swigCPtr != 0) { 37 | if (swigCMemOwn) { 38 | swigCMemOwn = false; 39 | RecastJNI.delete_dtTileCacheContour(swigCPtr); 40 | } 41 | swigCPtr = 0; 42 | } 43 | } 44 | 45 | public void setNumberOfVertices(int value) { 46 | RecastJNI.dtTileCacheContour_nverts_set(swigCPtr, this, value); 47 | } 48 | 49 | public int getNumberOfVertices() { 50 | return RecastJNI.dtTileCacheContour_nverts_get(swigCPtr, this); 51 | } 52 | 53 | public void setVertices(char[] vertices) { 54 | SWIGTYPE_p_unsigned_char value = Converter.convertToSWIGTYPE_p_unsigned_char(vertices); 55 | RecastJNI.dtTileCacheContour_verts_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 56 | } 57 | 58 | public char[] getVertices() { 59 | long cPtr = RecastJNI.dtTileCacheContour_verts_get(swigCPtr, this); 60 | if (cPtr == 0) { 61 | return null; 62 | } 63 | return Converter.convertToChars(cPtr, getNumberOfVertices()); 64 | } 65 | 66 | public void setRegionID(short value) { 67 | RecastJNI.dtTileCacheContour_reg_set(swigCPtr, this, value); 68 | } 69 | 70 | public short getRegionID() { 71 | return RecastJNI.dtTileCacheContour_reg_get(swigCPtr, this); 72 | } 73 | 74 | public void setArea(short value) { 75 | RecastJNI.dtTileCacheContour_area_set(swigCPtr, this, value); 76 | } 77 | 78 | public short getArea() { 79 | return RecastJNI.dtTileCacheContour_area_get(swigCPtr, this); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtProximityGrid.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_short; 6 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_int; 7 | 8 | /* ---------------------------------------------------------------------------- 9 | * This file was automatically generated by SWIG (http://www.swig.org). 10 | * Version 2.0.4 11 | * 12 | * Do not make changes to this file unless you know what you are doing--modify 13 | * the SWIG interface file instead. 14 | * ----------------------------------------------------------------------------- */ 15 | 16 | 17 | public class dtProximityGrid { 18 | private long swigCPtr; 19 | protected boolean swigCMemOwn; 20 | 21 | public dtProximityGrid(long cPtr, boolean cMemoryOwn) { 22 | swigCMemOwn = cMemoryOwn; 23 | swigCPtr = cPtr; 24 | } 25 | 26 | public static long getCPtr(dtProximityGrid obj) { 27 | return (obj == null) ? 0 : obj.swigCPtr; 28 | } 29 | 30 | protected void finalize() { 31 | delete(); 32 | } 33 | 34 | public synchronized void delete() { 35 | if (swigCPtr != 0) { 36 | if (swigCMemOwn) { 37 | swigCMemOwn = false; 38 | RecastJNI.delete_dtProximityGrid(swigCPtr); 39 | } 40 | swigCPtr = 0; 41 | } 42 | } 43 | 44 | public dtProximityGrid() { 45 | this(RecastJNI.new_dtProximityGrid(), true); 46 | } 47 | 48 | public boolean init(int maxItems, float cellSize) { 49 | return RecastJNI.dtProximityGrid_init(swigCPtr, this, maxItems, cellSize); 50 | } 51 | 52 | public void clear() { 53 | RecastJNI.dtProximityGrid_clear(swigCPtr, this); 54 | } 55 | 56 | public void addItem(int id, float minx, float miny, float maxx, float maxy) { 57 | RecastJNI.dtProximityGrid_addItem(swigCPtr, this, id, minx, miny, maxx, maxy); 58 | } 59 | 60 | public int queryItems(float minx, float miny, float maxx, float maxy, SWIGTYPE_p_unsigned_short ids, int maxIds) { 61 | return RecastJNI.dtProximityGrid_queryItems(swigCPtr, this, minx, miny, maxx, maxy, SWIGTYPE_p_unsigned_short.getCPtr(ids), maxIds); 62 | } 63 | 64 | public int getItemCountAt(int x, int y) { 65 | return RecastJNI.dtProximityGrid_getItemCountAt(swigCPtr, this, x, y); 66 | } 67 | 68 | public SWIGTYPE_p_int getBounds() { 69 | long cPtr = RecastJNI.dtProximityGrid_getBounds(swigCPtr, this); 70 | return (cPtr == 0) ? null : new SWIGTYPE_p_int(cPtr, false); 71 | } 72 | 73 | public float getCellSize() { 74 | return RecastJNI.dtProximityGrid_getCellSize(swigCPtr, this); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #jNavigation 2 | 3 | Navigation for jMonkey Engine. It will be port for Recast Navigation by Mikko Mononen memon@inside.org. You can find original source code at https://github.com/memononen/recastnavigation . 4 | 5 | ##Description 6 | 7 | ###Recast module 8 | Members in this module are used to create mesh data that is then used to create Detour navigation meshes. 9 | 10 | The are a large number of possible ways to building navigation mesh data. One of the simple piplines is as follows: 11 |
    12 |
  1. Prepare the input triangle mesh.
  2. 13 |
  3. Build a Heightfield.
  4. 14 |
  5. Build a CompactHeightfield.
  6. 15 |
  7. Build a ContourSet.
  8. 16 |
  9. Build a PolyMesh.
  10. 17 |
  11. Build a PolyMeshDetail.
  12. 18 |
  13. Use the PolyMesh and PolyMeshDetail to build a Detour navigation mesh tile.
  14. 19 |
20 | The general life-cycle of the main classes is as follows: 21 |
    22 |
  1. initialize structure
  2. 23 |
  3. build or create structure
  4. 24 |
  5. Update the object as needed. (E.g. rasterizeTriangles)
  6. 25 |
  7. Use the object as part of the pipeline.
  8. 26 |
27 | 28 | ###Detour module 29 | Members in this module are used to create, manipulate, and query navigation meshes. 30 | 31 | A navigation mesh based on tiles of convex polygons. 32 | 33 | The navigation mesh consists of one or more tiles defining three primary types of structural data: 34 | 39 | 40 | The general build process is as follows: 41 |
    42 |
  1. Create PolyMesh and PolyMeshDetail data using the Recast build pipeline.
  2. 43 |
  3. Combine the source data into a NavMeshCreateParams structure.
  4. 44 |
  5. Create a tile data array using CreateNavMeshData().
  6. 45 |
  7. Allocate at NavMesh object and initialize it. (For single tile navigation meshes, the tile data is loaded during this step.)
  8. 46 |
  9. For multi-tile navigation meshes, load the tile data using NavMesh#addTile().
  10. 47 |
48 | 49 | ####Notes: 50 | This class is usually used in conjunction with the NavMeshQuery class for pathfinding. 51 | Technically, all navigation meshes are tiled. A 'solo' mesh is simply a navigation mesh initialized to have only a single tile. 52 | This class does not implement any asynchronous methods. So the Status result of all methods will always contain either a success or failure flag. 53 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtLocalBoundary.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.detour.NavMeshQuery; 5 | import com.jme3.ai.navigation.detour.QueryFilter; 6 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 7 | import com.jme3.ai.navigation.utils.RecastJNI; 8 | 9 | /* ---------------------------------------------------------------------------- 10 | * This file was automatically generated by SWIG (http://www.swig.org). 11 | * Version 2.0.4 12 | * 13 | * Do not make changes to this file unless you know what you are doing--modify 14 | * the SWIG interface file instead. 15 | * ----------------------------------------------------------------------------- */ 16 | 17 | 18 | public class dtLocalBoundary { 19 | private long swigCPtr; 20 | protected boolean swigCMemOwn; 21 | 22 | public dtLocalBoundary(long cPtr, boolean cMemoryOwn) { 23 | swigCMemOwn = cMemoryOwn; 24 | swigCPtr = cPtr; 25 | } 26 | 27 | public static long getCPtr(dtLocalBoundary obj) { 28 | return (obj == null) ? 0 : obj.swigCPtr; 29 | } 30 | 31 | protected void finalize() { 32 | delete(); 33 | } 34 | 35 | public synchronized void delete() { 36 | if (swigCPtr != 0) { 37 | if (swigCMemOwn) { 38 | swigCMemOwn = false; 39 | RecastJNI.delete_dtLocalBoundary(swigCPtr); 40 | } 41 | swigCPtr = 0; 42 | } 43 | } 44 | 45 | public dtLocalBoundary() { 46 | this(RecastJNI.new_dtLocalBoundary(), true); 47 | } 48 | 49 | public void reset() { 50 | RecastJNI.dtLocalBoundary_reset(swigCPtr, this); 51 | } 52 | 53 | public void update(long ref, SWIGTYPE_p_float pos, float collisionQueryRange, NavMeshQuery navquery, QueryFilter filter) { 54 | RecastJNI.dtLocalBoundary_update(swigCPtr, this, ref, SWIGTYPE_p_float.getCPtr(pos), collisionQueryRange, NavMeshQuery.getCPtr(navquery), navquery, QueryFilter.getCPtr(filter), filter); 55 | } 56 | 57 | public boolean isValid(NavMeshQuery navquery, QueryFilter filter) { 58 | return RecastJNI.dtLocalBoundary_isValid(swigCPtr, this, NavMeshQuery.getCPtr(navquery), navquery, QueryFilter.getCPtr(filter), filter); 59 | } 60 | 61 | public SWIGTYPE_p_float getCenter() { 62 | long cPtr = RecastJNI.dtLocalBoundary_getCenter(swigCPtr, this); 63 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 64 | } 65 | 66 | public int getSegmentCount() { 67 | return RecastJNI.dtLocalBoundary_getSegmentCount(swigCPtr, this); 68 | } 69 | 70 | public SWIGTYPE_p_float getSegment(int i) { 71 | long cPtr = RecastJNI.dtLocalBoundary_getSegment(swigCPtr, this, i); 72 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=jNavigation 7 | application.vendor=Tihomir Radosavljevic 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.test.classpath=\ 23 | ${run.test.classpath} 24 | # This directory is removed when the project is cleaned: 25 | dist.dir=dist 26 | dist.jar=${dist.dir}/jNavigation.jar 27 | dist.javadoc.dir=${dist.dir}/javadoc 28 | endorsed.classpath= 29 | excludes= 30 | includes=** 31 | jar.compress=false 32 | javac.classpath=\ 33 | ${libs.jme3.classpath}:\ 34 | ${libs.jme3-libraries.classpath} 35 | # Space-separated list of extra javac options 36 | javac.compilerargs= 37 | javac.deprecation=false 38 | javac.processorpath=\ 39 | ${javac.classpath} 40 | javac.source=1.7 41 | javac.target=1.7 42 | javac.test.classpath=\ 43 | ${javac.classpath}:\ 44 | ${build.classes.dir} 45 | javac.test.processorpath=\ 46 | ${javac.test.classpath} 47 | javadoc.additionalparam= 48 | javadoc.author=false 49 | javadoc.encoding=${source.encoding} 50 | javadoc.noindex=false 51 | javadoc.nonavbar=false 52 | javadoc.notree=false 53 | javadoc.private=false 54 | javadoc.splitindex=true 55 | javadoc.use=true 56 | javadoc.version=false 57 | javadoc.windowtitle= 58 | main.class=jnavigation.JNavigation 59 | manifest.file=manifest.mf 60 | meta.inf.dir=${src.dir}/META-INF 61 | mkdist.disabled=false 62 | platform.active=default_platform 63 | run.classpath=\ 64 | ${javac.classpath}:\ 65 | ${build.classes.dir} 66 | # Space-separated list of JVM arguments used when running the project. 67 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 68 | # To set system properties for unit tests define test-sys-prop.name=value: 69 | run.jvmargs= 70 | run.test.classpath=\ 71 | ${javac.test.classpath}:\ 72 | ${build.test.classes.dir} 73 | source.encoding=UTF-8 74 | src.dir=src 75 | test.src.dir=test 76 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/recast/HeightfieldLayerSet.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.recast; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Represents a set of heightfield layers. 7 | * 8 | * @author Tihomir Radosavljevic 9 | * @version 1.0 10 | */ 11 | public class HeightfieldLayerSet { 12 | 13 | private long swigCPtr; 14 | protected boolean swigCMemOwn; 15 | 16 | /** 17 | * Allocates a heightfield layer set using the Recast allocator. 18 | */ 19 | public HeightfieldLayerSet() { 20 | swigCPtr = RecastJNI.rcAllocHeightfieldLayerSet(); 21 | swigCMemOwn = (swigCPtr == 0) ? false : true; 22 | } 23 | 24 | protected HeightfieldLayerSet(long cPtr, boolean cMemoryOwn) { 25 | swigCMemOwn = cMemoryOwn; 26 | swigCPtr = cPtr; 27 | } 28 | 29 | public static long getCPtr(HeightfieldLayerSet obj) { 30 | return (obj == null) ? 0 : obj.swigCPtr; 31 | } 32 | 33 | @Override 34 | protected void finalize() { 35 | delete(); 36 | } 37 | 38 | public synchronized void delete() { 39 | if (swigCPtr != 0) { 40 | if (swigCMemOwn) { 41 | swigCMemOwn = false; 42 | RecastJNI.rcFreeHeightfieldLayerSet(swigCPtr, this); 43 | } 44 | swigCPtr = 0; 45 | } 46 | } 47 | 48 | // /** 49 | // * -not done yet 50 | // * 51 | // * @param value The layers in the set. 52 | // */ 53 | // public void setLayers(HeightfieldLayer value) { 54 | // RecastJNI.rcHeightfieldLayerSet_layers_set(swigCPtr, this, HeightfieldLayer.getCPtr(value), value); 55 | // } 56 | /** 57 | * 58 | * @return The layers in the set. 59 | */ 60 | public HeightfieldLayer[] getLayers() { 61 | long cPtr = RecastJNI.rcHeightfieldLayerSet_layers_get(swigCPtr, this); 62 | if (cPtr == 0) { 63 | return null; 64 | } 65 | HeightfieldLayer[] heightfieldLayers = new HeightfieldLayer[getNumberOfLayers()]; 66 | for (int i = 0; i < heightfieldLayers.length; i++) { 67 | heightfieldLayers[i] = new HeightfieldLayer(cPtr + i, false); 68 | } 69 | return heightfieldLayers; 70 | } 71 | 72 | // /** 73 | // * 74 | // * @param value The number of layers in the set. 75 | // */ 76 | // public void setNumberOfLayers(int value) { 77 | // RecastJNI.rcHeightfieldLayerSet_nlayers_set(swigCPtr, this, value); 78 | // } 79 | /** 80 | * 81 | * @return The number of layers in the set. 82 | */ 83 | protected int getNumberOfLayers() { 84 | return RecastJNI.rcHeightfieldLayerSet_nlayers_get(swigCPtr, this); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/UpdateFlags.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | 6 | /* ---------------------------------------------------------------------------- 7 | * This file was automatically generated by SWIG (http://www.swig.org). 8 | * Version 2.0.4 9 | * 10 | * Do not make changes to this file unless you know what you are doing--modify 11 | * the SWIG interface file instead. 12 | * ----------------------------------------------------------------------------- */ 13 | 14 | 15 | public final class UpdateFlags { 16 | public final static UpdateFlags DT_CROWD_ANTICIPATE_TURNS = new UpdateFlags("DT_CROWD_ANTICIPATE_TURNS", RecastJNI.DT_CROWD_ANTICIPATE_TURNS_get()); 17 | public final static UpdateFlags DT_CROWD_OBSTACLE_AVOIDANCE = new UpdateFlags("DT_CROWD_OBSTACLE_AVOIDANCE", RecastJNI.DT_CROWD_OBSTACLE_AVOIDANCE_get()); 18 | public final static UpdateFlags DT_CROWD_SEPARATION = new UpdateFlags("DT_CROWD_SEPARATION", RecastJNI.DT_CROWD_SEPARATION_get()); 19 | public final static UpdateFlags DT_CROWD_OPTIMIZE_VIS = new UpdateFlags("DT_CROWD_OPTIMIZE_VIS", RecastJNI.DT_CROWD_OPTIMIZE_VIS_get()); 20 | public final static UpdateFlags DT_CROWD_OPTIMIZE_TOPO = new UpdateFlags("DT_CROWD_OPTIMIZE_TOPO", RecastJNI.DT_CROWD_OPTIMIZE_TOPO_get()); 21 | 22 | public final int swigValue() { 23 | return swigValue; 24 | } 25 | 26 | public String toString() { 27 | return swigName; 28 | } 29 | 30 | public static UpdateFlags swigToEnum(int swigValue) { 31 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 32 | return swigValues[swigValue]; 33 | for (int i = 0; i < swigValues.length; i++) 34 | if (swigValues[i].swigValue == swigValue) 35 | return swigValues[i]; 36 | throw new IllegalArgumentException("No enum " + UpdateFlags.class + " with value " + swigValue); 37 | } 38 | 39 | private UpdateFlags(String swigName) { 40 | this.swigName = swigName; 41 | this.swigValue = swigNext++; 42 | } 43 | 44 | private UpdateFlags(String swigName, int swigValue) { 45 | this.swigName = swigName; 46 | this.swigValue = swigValue; 47 | swigNext = swigValue+1; 48 | } 49 | 50 | private UpdateFlags(String swigName, UpdateFlags swigEnum) { 51 | this.swigName = swigName; 52 | this.swigValue = swigEnum.swigValue; 53 | swigNext = this.swigValue+1; 54 | } 55 | 56 | private static UpdateFlags[] swigValues = { DT_CROWD_ANTICIPATE_TURNS, DT_CROWD_OBSTACLE_AVOIDANCE, DT_CROWD_SEPARATION, DT_CROWD_OPTIMIZE_VIS, DT_CROWD_OPTIMIZE_TOPO }; 57 | private static int swigNext = 0; 58 | private final int swigValue; 59 | private final String swigName; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtCrowdAgentDebugInfo.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | 7 | /* ---------------------------------------------------------------------------- 8 | * This file was automatically generated by SWIG (http://www.swig.org). 9 | * Version 2.0.4 10 | * 11 | * Do not make changes to this file unless you know what you are doing--modify 12 | * the SWIG interface file instead. 13 | * ----------------------------------------------------------------------------- */ 14 | 15 | 16 | public class dtCrowdAgentDebugInfo { 17 | private long swigCPtr; 18 | protected boolean swigCMemOwn; 19 | 20 | public dtCrowdAgentDebugInfo(long cPtr, boolean cMemoryOwn) { 21 | swigCMemOwn = cMemoryOwn; 22 | swigCPtr = cPtr; 23 | } 24 | 25 | public static long getCPtr(dtCrowdAgentDebugInfo obj) { 26 | return (obj == null) ? 0 : obj.swigCPtr; 27 | } 28 | 29 | protected void finalize() { 30 | delete(); 31 | } 32 | 33 | public synchronized void delete() { 34 | if (swigCPtr != 0) { 35 | if (swigCMemOwn) { 36 | swigCMemOwn = false; 37 | RecastJNI.delete_dtCrowdAgentDebugInfo(swigCPtr); 38 | } 39 | swigCPtr = 0; 40 | } 41 | } 42 | 43 | public void setIdx(int value) { 44 | RecastJNI.dtCrowdAgentDebugInfo_idx_set(swigCPtr, this, value); 45 | } 46 | 47 | public int getIdx() { 48 | return RecastJNI.dtCrowdAgentDebugInfo_idx_get(swigCPtr, this); 49 | } 50 | 51 | public void setOptStart(SWIGTYPE_p_float value) { 52 | RecastJNI.dtCrowdAgentDebugInfo_optStart_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 53 | } 54 | 55 | public SWIGTYPE_p_float getOptStart() { 56 | long cPtr = RecastJNI.dtCrowdAgentDebugInfo_optStart_get(swigCPtr, this); 57 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 58 | } 59 | 60 | public void setOptEnd(SWIGTYPE_p_float value) { 61 | RecastJNI.dtCrowdAgentDebugInfo_optEnd_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 62 | } 63 | 64 | public SWIGTYPE_p_float getOptEnd() { 65 | long cPtr = RecastJNI.dtCrowdAgentDebugInfo_optEnd_get(swigCPtr, this); 66 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 67 | } 68 | 69 | public void setVod(dtObstacleAvoidanceDebugData value) { 70 | RecastJNI.dtCrowdAgentDebugInfo_vod_set(swigCPtr, this, dtObstacleAvoidanceDebugData.getCPtr(value), value); 71 | } 72 | 73 | public dtObstacleAvoidanceDebugData getVod() { 74 | long cPtr = RecastJNI.dtCrowdAgentDebugInfo_vod_get(swigCPtr, this); 75 | return (cPtr == 0) ? null : new dtObstacleAvoidanceDebugData(cPtr, false); 76 | } 77 | 78 | public dtCrowdAgentDebugInfo() { 79 | this(RecastJNI.new_dtCrowdAgentDebugInfo(), true); 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtPathQueue.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.detour.NavMesh; 5 | import com.jme3.ai.navigation.detour.NavMesh; 6 | import com.jme3.ai.navigation.detour.NavMeshQuery; 7 | import com.jme3.ai.navigation.detour.QueryFilter; 8 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 9 | import com.jme3.ai.navigation.utils.RecastJNI; 10 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int; 11 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_int; 12 | 13 | /* ---------------------------------------------------------------------------- 14 | * This file was automatically generated by SWIG (http://www.swig.org). 15 | * Version 2.0.4 16 | * 17 | * Do not make changes to this file unless you know what you are doing--modify 18 | * the SWIG interface file instead. 19 | * ----------------------------------------------------------------------------- */ 20 | 21 | 22 | public class dtPathQueue { 23 | private long swigCPtr; 24 | protected boolean swigCMemOwn; 25 | 26 | public dtPathQueue(long cPtr, boolean cMemoryOwn) { 27 | swigCMemOwn = cMemoryOwn; 28 | swigCPtr = cPtr; 29 | } 30 | 31 | public static long getCPtr(dtPathQueue obj) { 32 | return (obj == null) ? 0 : obj.swigCPtr; 33 | } 34 | 35 | protected void finalize() { 36 | delete(); 37 | } 38 | 39 | public synchronized void delete() { 40 | if (swigCPtr != 0) { 41 | if (swigCMemOwn) { 42 | swigCMemOwn = false; 43 | RecastJNI.delete_dtPathQueue(swigCPtr); 44 | } 45 | swigCPtr = 0; 46 | } 47 | } 48 | 49 | public dtPathQueue() { 50 | this(RecastJNI.new_dtPathQueue(), true); 51 | } 52 | 53 | public boolean init(int maxPathSize, int maxSearchNodeCount, NavMesh nav) { 54 | return RecastJNI.dtPathQueue_init(swigCPtr, this, maxPathSize, maxSearchNodeCount, NavMesh.getCPtr(nav), nav); 55 | } 56 | 57 | public void update(int maxIters) { 58 | RecastJNI.dtPathQueue_update(swigCPtr, this, maxIters); 59 | } 60 | 61 | public long request(long startRef, long endRef, SWIGTYPE_p_float startPos, SWIGTYPE_p_float endPos, QueryFilter filter) { 62 | return RecastJNI.dtPathQueue_request(swigCPtr, this, startRef, endRef, SWIGTYPE_p_float.getCPtr(startPos), SWIGTYPE_p_float.getCPtr(endPos), QueryFilter.getCPtr(filter), filter); 63 | } 64 | 65 | public long getRequestStatus(long ref) { 66 | return RecastJNI.dtPathQueue_getRequestStatus(swigCPtr, this, ref); 67 | } 68 | 69 | public long getPathResult(long ref, SWIGTYPE_p_unsigned_int path, SWIGTYPE_p_int pathSize, int maxPath) { 70 | return RecastJNI.dtPathQueue_getPathResult(swigCPtr, this, ref, SWIGTYPE_p_unsigned_int.getCPtr(path), SWIGTYPE_p_int.getCPtr(pathSize), maxPath); 71 | } 72 | 73 | public NavMeshQuery getNavQuery() { 74 | long cPtr = RecastJNI.dtPathQueue_getNavQuery(swigCPtr, this); 75 | return (cPtr == 0) ? null : new NavMeshQuery(cPtr, false); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/MoveRequestState.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | 6 | /* ---------------------------------------------------------------------------- 7 | * This file was automatically generated by SWIG (http://www.swig.org). 8 | * Version 2.0.4 9 | * 10 | * Do not make changes to this file unless you know what you are doing--modify 11 | * the SWIG interface file instead. 12 | * ----------------------------------------------------------------------------- */ 13 | 14 | 15 | public final class MoveRequestState { 16 | public final static MoveRequestState DT_CROWDAGENT_TARGET_NONE = new MoveRequestState("DT_CROWDAGENT_TARGET_NONE", RecastJNI.DT_CROWDAGENT_TARGET_NONE_get()); 17 | public final static MoveRequestState DT_CROWDAGENT_TARGET_FAILED = new MoveRequestState("DT_CROWDAGENT_TARGET_FAILED"); 18 | public final static MoveRequestState DT_CROWDAGENT_TARGET_VALID = new MoveRequestState("DT_CROWDAGENT_TARGET_VALID"); 19 | public final static MoveRequestState DT_CROWDAGENT_TARGET_REQUESTING = new MoveRequestState("DT_CROWDAGENT_TARGET_REQUESTING"); 20 | public final static MoveRequestState DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE = new MoveRequestState("DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE"); 21 | public final static MoveRequestState DT_CROWDAGENT_TARGET_WAITING_FOR_PATH = new MoveRequestState("DT_CROWDAGENT_TARGET_WAITING_FOR_PATH"); 22 | public final static MoveRequestState DT_CROWDAGENT_TARGET_VELOCITY = new MoveRequestState("DT_CROWDAGENT_TARGET_VELOCITY"); 23 | 24 | public final int swigValue() { 25 | return swigValue; 26 | } 27 | 28 | public String toString() { 29 | return swigName; 30 | } 31 | 32 | public static MoveRequestState swigToEnum(int swigValue) { 33 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 34 | return swigValues[swigValue]; 35 | for (int i = 0; i < swigValues.length; i++) 36 | if (swigValues[i].swigValue == swigValue) 37 | return swigValues[i]; 38 | throw new IllegalArgumentException("No enum " + MoveRequestState.class + " with value " + swigValue); 39 | } 40 | 41 | private MoveRequestState(String swigName) { 42 | this.swigName = swigName; 43 | this.swigValue = swigNext++; 44 | } 45 | 46 | private MoveRequestState(String swigName, int swigValue) { 47 | this.swigName = swigName; 48 | this.swigValue = swigValue; 49 | swigNext = swigValue+1; 50 | } 51 | 52 | private MoveRequestState(String swigName, MoveRequestState swigEnum) { 53 | this.swigName = swigName; 54 | this.swigValue = swigEnum.swigValue; 55 | swigNext = this.swigValue+1; 56 | } 57 | 58 | private static MoveRequestState[] swigValues = { DT_CROWDAGENT_TARGET_NONE, DT_CROWDAGENT_TARGET_FAILED, DT_CROWDAGENT_TARGET_VALID, DT_CROWDAGENT_TARGET_REQUESTING, DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE, DT_CROWDAGENT_TARGET_WAITING_FOR_PATH, DT_CROWDAGENT_TARGET_VELOCITY }; 59 | private static int swigNext = 0; 60 | private final int swigValue; 61 | private final String swigName; 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/BVNode.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_short; 6 | import com.jme3.math.Vector3f; 7 | 8 | /** 9 | * Bounding volume node. 10 | * 11 | * Note This structure is rarely if ever used by the end user. 12 | * 13 | * @author Tihomir Radosavljevic 14 | * @version 1.0 15 | */ 16 | public class BVNode { 17 | 18 | private long swigCPtr; 19 | protected boolean swigCMemOwn; 20 | 21 | public BVNode() { 22 | this(RecastJNI.new_dtBVNode(), true); 23 | } 24 | 25 | public BVNode(long cPtr, boolean cMemoryOwn) { 26 | swigCMemOwn = cMemoryOwn; 27 | swigCPtr = cPtr; 28 | } 29 | 30 | public static long getCPtr(BVNode obj) { 31 | return (obj == null) ? 0 : obj.swigCPtr; 32 | } 33 | 34 | @Override 35 | protected void finalize() { 36 | delete(); 37 | } 38 | 39 | public synchronized void delete() { 40 | if (swigCPtr != 0) { 41 | if (swigCMemOwn) { 42 | swigCMemOwn = false; 43 | RecastJNI.delete_dtBVNode(swigCPtr); 44 | } 45 | swigCPtr = 0; 46 | } 47 | } 48 | 49 | /** 50 | * 51 | * @param minBounds Minimum bounds of the node's AABB. 52 | */ 53 | public void setMinBounds(Vector3f minBounds) { 54 | SWIGTYPE_p_unsigned_short value = Converter.convertToSWIGTYPE_p_unsigned_short(minBounds); 55 | RecastJNI.dtBVNode_bmin_set(swigCPtr, this, SWIGTYPE_p_unsigned_short.getCPtr(value)); 56 | } 57 | 58 | /** 59 | * 60 | * @return Minimum bounds of the node's AABB. 61 | */ 62 | public Vector3f getMinBounds() { 63 | long cPtr = RecastJNI.dtBVNode_bmin_get(swigCPtr, this); 64 | if (cPtr == 0) { 65 | return null; 66 | } 67 | return Converter.convertToVector3f(cPtr); 68 | } 69 | 70 | /** 71 | * 72 | * @param maxBounds Maximum bounds of the node's AABB. 73 | */ 74 | public void setMaxBounds(Vector3f maxBounds) { 75 | SWIGTYPE_p_unsigned_short value = Converter.convertToSWIGTYPE_p_unsigned_short(maxBounds); 76 | RecastJNI.dtBVNode_bmax_set(swigCPtr, this, SWIGTYPE_p_unsigned_short.getCPtr(value)); 77 | } 78 | 79 | /** 80 | * 81 | * @return Maximum bounds of the node's AABB. 82 | */ 83 | public Vector3f getMaxBounds() { 84 | long cPtr = RecastJNI.dtBVNode_bmax_get(swigCPtr, this); 85 | if (cPtr == 0) { 86 | return null; 87 | } 88 | return Converter.convertToVector3f(cPtr); 89 | } 90 | 91 | /** 92 | * 93 | * @param index The node's index. (Negative for escape sequence.) 94 | */ 95 | public void setNodeIndex(int index) { 96 | RecastJNI.dtBVNode_i_set(swigCPtr, this, index); 97 | } 98 | 99 | /** 100 | * 101 | * @return The node's index. (Negative for escape sequence.) 102 | */ 103 | public int getNodeIndex() { 104 | return RecastJNI.dtBVNode_i_get(swigCPtr, this); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/StraightPathOptions.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Options for NavMeshQuery.findStraightPath. 7 | * 8 | * @see 9 | * NavMeshQuery#findStraightPath(com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 10 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 11 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int, int, 12 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 13 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char, 14 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int, 15 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_int, int) 16 | * @see 17 | * NavMeshQuery#findStraightPath(com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 18 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 19 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int, int, 20 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 21 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char, 22 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int, 23 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_int, int, int) 24 | * @author Tihomir Radosavljevic 25 | * @version 1.0 26 | */ 27 | public final class StraightPathOptions { 28 | 29 | /** 30 | * Add a vertex at every polygon edge crossing where area changes. 31 | */ 32 | public final static StraightPathOptions DT_STRAIGHTPATH_AREA_CROSSINGS = new StraightPathOptions("DT_STRAIGHTPATH_AREA_CROSSINGS", RecastJNI.DT_STRAIGHTPATH_AREA_CROSSINGS_get()); 33 | /** 34 | * Add a vertex at every polygon edge crossing. 35 | */ 36 | public final static StraightPathOptions DT_STRAIGHTPATH_ALL_CROSSINGS = new StraightPathOptions("DT_STRAIGHTPATH_ALL_CROSSINGS", RecastJNI.DT_STRAIGHTPATH_ALL_CROSSINGS_get()); 37 | 38 | public final int swigValue() { 39 | return swigValue; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return swigName; 45 | } 46 | 47 | public static StraightPathOptions swigToEnum(int swigValue) { 48 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) { 49 | return swigValues[swigValue]; 50 | } 51 | for (int i = 0; i < swigValues.length; i++) { 52 | if (swigValues[i].swigValue == swigValue) { 53 | return swigValues[i]; 54 | } 55 | } 56 | throw new IllegalArgumentException("No enum " + StraightPathOptions.class + " with value " + swigValue); 57 | } 58 | 59 | private StraightPathOptions(String swigName) { 60 | this.swigName = swigName; 61 | this.swigValue = swigNext++; 62 | } 63 | 64 | private StraightPathOptions(String swigName, int swigValue) { 65 | this.swigName = swigName; 66 | this.swigValue = swigValue; 67 | swigNext = swigValue + 1; 68 | } 69 | 70 | private StraightPathOptions(String swigName, StraightPathOptions swigEnum) { 71 | this.swigName = swigName; 72 | this.swigValue = swigEnum.swigValue; 73 | swigNext = this.swigValue + 1; 74 | } 75 | private static StraightPathOptions[] swigValues = {DT_STRAIGHTPATH_AREA_CROSSINGS, DT_STRAIGHTPATH_ALL_CROSSINGS}; 76 | private static int swigNext = 0; 77 | private final int swigValue; 78 | private final String swigName; 79 | } 80 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/recast/CompactSpan.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.recast; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Represents a span of unobstructed space within a compact heightfield. 7 | * 8 | * The span represents open, unobstructed space within a compact heightfield 9 | * column. 10 | * 11 | * Useful instances of this type can only by obtained from a CompactHeightfield 12 | * object. 13 | * 14 | * @see CompactHeightfield 15 | * 16 | * @author Tihomir Radosavljevic 17 | * @version 1.0 18 | */ 19 | public class CompactSpan { 20 | 21 | private long swigCPtr; 22 | protected boolean swigCMemOwn; 23 | 24 | /** 25 | * Internal use only. 26 | */ 27 | protected CompactSpan(long cPtr, boolean cMemoryOwn) { 28 | swigCMemOwn = cMemoryOwn; 29 | swigCPtr = cPtr; 30 | } 31 | 32 | public static long getCPtr(CompactSpan obj) { 33 | return (obj == null) ? 0 : obj.swigCPtr; 34 | } 35 | 36 | @Override 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | RecastJNI.delete_rcCompactSpan(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | /** 52 | * 53 | * @param value The lower extent of the span. (Measured from the 54 | * heightfield's base.) 55 | */ 56 | public void setY(int value) { 57 | RecastJNI.rcCompactSpan_y_set(swigCPtr, this, value); 58 | } 59 | 60 | /** 61 | * 62 | * @return The lower extent of the span. (Measured from the heightfield's 63 | * base.) 64 | */ 65 | public int getY() { 66 | return RecastJNI.rcCompactSpan_y_get(swigCPtr, this); 67 | } 68 | 69 | /** 70 | * 71 | * @param value The id of the region the span belongs to. (Or zero if not in 72 | * a region.) 73 | */ 74 | public void setRegionID(int value) { 75 | RecastJNI.rcCompactSpan_reg_set(swigCPtr, this, value); 76 | } 77 | 78 | /** 79 | * 80 | * @return The id of the region the span belongs to. (Or zero if not in a 81 | * region.) 82 | */ 83 | public int getRegionID() { 84 | return RecastJNI.rcCompactSpan_reg_get(swigCPtr, this); 85 | } 86 | 87 | /** 88 | * 89 | * @param value Packed neighbor connection data. 90 | */ 91 | public void setConnnection(long value) { 92 | RecastJNI.rcCompactSpan_con_set(swigCPtr, this, value); 93 | } 94 | 95 | /** 96 | * 97 | * @return Packed neighbor connection data. 98 | */ 99 | public long getConnection() { 100 | return RecastJNI.rcCompactSpan_con_get(swigCPtr, this); 101 | } 102 | 103 | /** 104 | * @param value The height of the span. (Measured from y.) 105 | */ 106 | public void setHeight(long value) { 107 | RecastJNI.rcCompactSpan_h_set(swigCPtr, this, value); 108 | } 109 | 110 | /** 111 | * 112 | * @return The height of the span. (Measured from y.) 113 | */ 114 | public long getHeight() { 115 | return RecastJNI.rcCompactSpan_h_get(swigCPtr, this); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/PolyDetail.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Defines the location of detail sub-mesh data within a MeshTile. 7 | * 8 | * @see MeshTile 9 | * @author Tihomir Radosavljevic 10 | * @version 0.5 11 | */ 12 | public class PolyDetail { 13 | 14 | private long swigCPtr; 15 | protected boolean swigCMemOwn; 16 | 17 | public PolyDetail() { 18 | this(RecastJNI.new_dtPolyDetail(), true); 19 | } 20 | 21 | public PolyDetail(long cPtr, boolean cMemoryOwn) { 22 | swigCMemOwn = cMemoryOwn; 23 | swigCPtr = cPtr; 24 | } 25 | 26 | public static long getCPtr(PolyDetail obj) { 27 | return (obj == null) ? 0 : obj.swigCPtr; 28 | } 29 | 30 | @Override 31 | protected void finalize() { 32 | delete(); 33 | } 34 | 35 | public synchronized void delete() { 36 | if (swigCPtr != 0) { 37 | if (swigCMemOwn) { 38 | swigCMemOwn = false; 39 | RecastJNI.delete_dtPolyDetail(swigCPtr); 40 | } 41 | swigCPtr = 0; 42 | } 43 | } 44 | 45 | /** 46 | * 47 | * @param value The offset of the vertices in the MeshTile.detailVertices 48 | * array. 49 | * @see MeshTile#getDetailVertices() 50 | */ 51 | public void setVertBase(long value) { 52 | RecastJNI.dtPolyDetail_vertBase_set(swigCPtr, this, value); 53 | } 54 | 55 | /** 56 | * 57 | * @return The offset of the vertices in the MeshTile.detailVertices array. 58 | * @see MeshTile#getDetailVertices() 59 | */ 60 | public long getVertBase() { 61 | return RecastJNI.dtPolyDetail_vertBase_get(swigCPtr, this); 62 | } 63 | 64 | /** 65 | * 66 | * @param value he offset of the triangles in the MeshTile.detailTriangles 67 | * array. 68 | * @see MeshTile#getDetailTriangles() 69 | */ 70 | public void setTriangleBase(long value) { 71 | RecastJNI.dtPolyDetail_triBase_set(swigCPtr, this, value); 72 | } 73 | 74 | /** 75 | * 76 | * @return The offset of the triangles in the MeshTile.detailTriangles 77 | * array. 78 | * @see MeshTile#getDetailTriangles() 79 | */ 80 | public long getTriangleBase() { 81 | return RecastJNI.dtPolyDetail_triBase_get(swigCPtr, this); 82 | } 83 | 84 | /** 85 | * 86 | * @param value The number of vertices in the sub-mesh. 87 | */ 88 | public void setVerticesCount(short value) { 89 | RecastJNI.dtPolyDetail_vertCount_set(swigCPtr, this, value); 90 | } 91 | 92 | /** 93 | * 94 | * @return The number of vertices in the sub-mesh. 95 | */ 96 | public short getVerticesCount() { 97 | return RecastJNI.dtPolyDetail_vertCount_get(swigCPtr, this); 98 | } 99 | 100 | /** 101 | * 102 | * @param value The number of triangles in the sub-mesh. 103 | */ 104 | public void setTriangleCount(short value) { 105 | RecastJNI.dtPolyDetail_triCount_set(swigCPtr, this, value); 106 | } 107 | 108 | /** 109 | * 110 | * @return The number of triangles in the sub-mesh. 111 | */ 112 | public short getTriangleCount() { 113 | return RecastJNI.dtPolyDetail_triCount_get(swigCPtr, this); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtObstacleCircle.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | 7 | /* ---------------------------------------------------------------------------- 8 | * This file was automatically generated by SWIG (http://www.swig.org). 9 | * Version 2.0.4 10 | * 11 | * Do not make changes to this file unless you know what you are doing--modify 12 | * the SWIG interface file instead. 13 | * ----------------------------------------------------------------------------- */ 14 | 15 | 16 | public class dtObstacleCircle { 17 | private long swigCPtr; 18 | protected boolean swigCMemOwn; 19 | 20 | public dtObstacleCircle(long cPtr, boolean cMemoryOwn) { 21 | swigCMemOwn = cMemoryOwn; 22 | swigCPtr = cPtr; 23 | } 24 | 25 | public static long getCPtr(dtObstacleCircle obj) { 26 | return (obj == null) ? 0 : obj.swigCPtr; 27 | } 28 | 29 | protected void finalize() { 30 | delete(); 31 | } 32 | 33 | public synchronized void delete() { 34 | if (swigCPtr != 0) { 35 | if (swigCMemOwn) { 36 | swigCMemOwn = false; 37 | RecastJNI.delete_dtObstacleCircle(swigCPtr); 38 | } 39 | swigCPtr = 0; 40 | } 41 | } 42 | 43 | public void setP(SWIGTYPE_p_float value) { 44 | RecastJNI.dtObstacleCircle_p_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 45 | } 46 | 47 | public SWIGTYPE_p_float getP() { 48 | long cPtr = RecastJNI.dtObstacleCircle_p_get(swigCPtr, this); 49 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 50 | } 51 | 52 | public void setVel(SWIGTYPE_p_float value) { 53 | RecastJNI.dtObstacleCircle_vel_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 54 | } 55 | 56 | public SWIGTYPE_p_float getVel() { 57 | long cPtr = RecastJNI.dtObstacleCircle_vel_get(swigCPtr, this); 58 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 59 | } 60 | 61 | public void setDvel(SWIGTYPE_p_float value) { 62 | RecastJNI.dtObstacleCircle_dvel_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 63 | } 64 | 65 | public SWIGTYPE_p_float getDvel() { 66 | long cPtr = RecastJNI.dtObstacleCircle_dvel_get(swigCPtr, this); 67 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 68 | } 69 | 70 | public void setRad(float value) { 71 | RecastJNI.dtObstacleCircle_rad_set(swigCPtr, this, value); 72 | } 73 | 74 | public float getRad() { 75 | return RecastJNI.dtObstacleCircle_rad_get(swigCPtr, this); 76 | } 77 | 78 | public void setDp(SWIGTYPE_p_float value) { 79 | RecastJNI.dtObstacleCircle_dp_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 80 | } 81 | 82 | public SWIGTYPE_p_float getDp() { 83 | long cPtr = RecastJNI.dtObstacleCircle_dp_get(swigCPtr, this); 84 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 85 | } 86 | 87 | public void setNp(SWIGTYPE_p_float value) { 88 | RecastJNI.dtObstacleCircle_np_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 89 | } 90 | 91 | public SWIGTYPE_p_float getNp() { 92 | long cPtr = RecastJNI.dtObstacleCircle_np_get(swigCPtr, this); 93 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 94 | } 95 | 96 | public dtObstacleCircle() { 97 | this(RecastJNI.new_dtObstacleCircle(), true); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/recast/Span.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.recast; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Represents a span in a heightfield. 7 | * 8 | * @author Tihomir Radosavljevic 9 | * @version 1.0 10 | */ 11 | public class Span { 12 | 13 | private long swigCPtr; 14 | protected boolean swigCMemOwn; 15 | 16 | /** 17 | * Internal use only. 18 | */ 19 | protected Span(long cPtr, boolean cMemoryOwn) { 20 | swigCMemOwn = cMemoryOwn; 21 | swigCPtr = cPtr; 22 | } 23 | 24 | public static long getCPtr(Span obj) { 25 | return (obj == null) ? 0 : obj.swigCPtr; 26 | } 27 | 28 | @Override 29 | protected void finalize() { 30 | delete(); 31 | } 32 | 33 | public synchronized void delete() { 34 | if (swigCPtr != 0) { 35 | if (swigCMemOwn) { 36 | swigCMemOwn = false; 37 | RecastJNI.delete_rcSpan(swigCPtr); 38 | } 39 | swigCPtr = 0; 40 | } 41 | } 42 | 43 | /** 44 | * 45 | * @param value The lower limit of the span. [Limit: smaller than 46 | * maxSpanLimit]. 47 | * @see Span#getMaxSpanLimit() 48 | */ 49 | public void setMinSpanLimit(long value) { 50 | RecastJNI.rcSpan_smin_set(swigCPtr, this, value); 51 | } 52 | 53 | /** 54 | * 55 | * @return The lower limit of the span. [Limit: smaller than maxSpanLimit]. 56 | * @see Span#getMaxSpanLimit() 57 | */ 58 | public long getMinSpanLimit() { 59 | return RecastJNI.rcSpan_smin_get(swigCPtr, this); 60 | } 61 | 62 | /** 63 | * 64 | * @param value The upper limit of the span. [Limit: smaller than 65 | * RC_SPAN_MAX_HEIGHT]. 66 | * @see RecastBuilder#RC_SPAN_MAX_HEIGHT() 67 | */ 68 | public void setMaxSpanLimit(long value) { 69 | RecastJNI.rcSpan_smax_set(swigCPtr, this, value); 70 | } 71 | 72 | /** 73 | * 74 | * @return The upper limit of the span. [Limit: smaller than 75 | * RC_SPAN_MAX_HEIGHT]. 76 | * @see RecastBuilder#RC_SPAN_MAX_HEIGHT() 77 | */ 78 | public long getMaxSpanLimit() { 79 | return RecastJNI.rcSpan_smax_get(swigCPtr, this); 80 | } 81 | 82 | /** 83 | * 84 | * @param value The area id assigned to the span. 85 | */ 86 | public void setArea(long value) { 87 | RecastJNI.rcSpan_area_set(swigCPtr, this, value); 88 | } 89 | 90 | /** 91 | * 92 | * @return The area id assigned to the span. 93 | */ 94 | public long getArea() { 95 | return RecastJNI.rcSpan_area_get(swigCPtr, this); 96 | } 97 | 98 | /** 99 | * 100 | * @param value The next span higher up in column. 101 | */ 102 | public void setNext(Span value) { 103 | RecastJNI.rcSpan_next_set(swigCPtr, this, Span.getCPtr(value), value); 104 | } 105 | 106 | /** 107 | * 108 | * @return The next span higher up in column. 109 | */ 110 | public Span getNext() { 111 | long cPtr = RecastJNI.rcSpan_next_get(swigCPtr, this); 112 | return (cPtr == 0) ? null : new Span(cPtr, false); 113 | } 114 | 115 | @Override 116 | public String toString() { 117 | return "Span{ area=" + getArea() + "; minSpanLimit=" + getMinSpanLimit() + "; maxSpanLimit=" + getMaxSpanLimit() + '}'; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/StraightPathFlags.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Vertex flags returned by NavMeshQuery.findStraightPath 7 | * 8 | * @see 9 | * NavMeshQuery#findStraightPath(com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 10 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 11 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int, int, 12 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 13 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char, 14 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int, 15 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_int, int) 16 | * @see 17 | * NavMeshQuery#findStraightPath(com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 18 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 19 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int, int, 20 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_float, 21 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char, 22 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int, 23 | * com.jme3.ai.navigation.utils.SWIGTYPE_p_int, int, int) 24 | * @author Tihomir Radosavljvic 25 | * @version 1.0 26 | */ 27 | public final class StraightPathFlags { 28 | 29 | /** 30 | * The vertex is the start position in the path. 31 | */ 32 | public final static StraightPathFlags DT_STRAIGHTPATH_START = new StraightPathFlags("DT_STRAIGHTPATH_START", RecastJNI.DT_STRAIGHTPATH_START_get()); 33 | /** 34 | * The vertex is the end position in the path. 35 | */ 36 | public final static StraightPathFlags DT_STRAIGHTPATH_END = new StraightPathFlags("DT_STRAIGHTPATH_END", RecastJNI.DT_STRAIGHTPATH_END_get()); 37 | /** 38 | * The vertex is the start of an off-mesh connection. 39 | */ 40 | public final static StraightPathFlags DT_STRAIGHTPATH_OFFMESH_CONNECTION = new StraightPathFlags("DT_STRAIGHTPATH_OFFMESH_CONNECTION", RecastJNI.DT_STRAIGHTPATH_OFFMESH_CONNECTION_get()); 41 | 42 | public final int value() { 43 | return swigValue; 44 | } 45 | 46 | @Override 47 | public String toString() { 48 | return swigName; 49 | } 50 | 51 | public static StraightPathFlags swigToEnum(int swigValue) { 52 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) { 53 | return swigValues[swigValue]; 54 | } 55 | for (int i = 0; i < swigValues.length; i++) { 56 | if (swigValues[i].swigValue == swigValue) { 57 | return swigValues[i]; 58 | } 59 | } 60 | throw new IllegalArgumentException("No enum " + StraightPathFlags.class + " with value " + swigValue); 61 | } 62 | 63 | private StraightPathFlags(String swigName) { 64 | this.swigName = swigName; 65 | this.swigValue = swigNext++; 66 | } 67 | 68 | private StraightPathFlags(String swigName, int swigValue) { 69 | this.swigName = swigName; 70 | this.swigValue = swigValue; 71 | swigNext = swigValue + 1; 72 | } 73 | 74 | private StraightPathFlags(String swigName, StraightPathFlags swigEnum) { 75 | this.swigName = swigName; 76 | this.swigValue = swigEnum.swigValue; 77 | swigNext = this.swigValue + 1; 78 | } 79 | private static StraightPathFlags[] swigValues = {DT_STRAIGHTPATH_START, DT_STRAIGHTPATH_END, DT_STRAIGHTPATH_OFFMESH_CONNECTION}; 80 | private static int swigNext = 0; 81 | private final int swigValue; 82 | private final String swigName; 83 | } 84 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtCrowdAgentAnimation.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | 7 | /* ---------------------------------------------------------------------------- 8 | * This file was automatically generated by SWIG (http://www.swig.org). 9 | * Version 2.0.4 10 | * 11 | * Do not make changes to this file unless you know what you are doing--modify 12 | * the SWIG interface file instead. 13 | * ----------------------------------------------------------------------------- */ 14 | 15 | 16 | public class dtCrowdAgentAnimation { 17 | private long swigCPtr; 18 | protected boolean swigCMemOwn; 19 | 20 | public dtCrowdAgentAnimation(long cPtr, boolean cMemoryOwn) { 21 | swigCMemOwn = cMemoryOwn; 22 | swigCPtr = cPtr; 23 | } 24 | 25 | public static long getCPtr(dtCrowdAgentAnimation obj) { 26 | return (obj == null) ? 0 : obj.swigCPtr; 27 | } 28 | 29 | protected void finalize() { 30 | delete(); 31 | } 32 | 33 | public synchronized void delete() { 34 | if (swigCPtr != 0) { 35 | if (swigCMemOwn) { 36 | swigCMemOwn = false; 37 | RecastJNI.delete_dtCrowdAgentAnimation(swigCPtr); 38 | } 39 | swigCPtr = 0; 40 | } 41 | } 42 | 43 | public void setActive(boolean value) { 44 | RecastJNI.dtCrowdAgentAnimation_active_set(swigCPtr, this, value); 45 | } 46 | 47 | public boolean getActive() { 48 | return RecastJNI.dtCrowdAgentAnimation_active_get(swigCPtr, this); 49 | } 50 | 51 | public void setInitPos(SWIGTYPE_p_float value) { 52 | RecastJNI.dtCrowdAgentAnimation_initPos_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 53 | } 54 | 55 | public SWIGTYPE_p_float getInitPos() { 56 | long cPtr = RecastJNI.dtCrowdAgentAnimation_initPos_get(swigCPtr, this); 57 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 58 | } 59 | 60 | public void setStartPos(SWIGTYPE_p_float value) { 61 | RecastJNI.dtCrowdAgentAnimation_startPos_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 62 | } 63 | 64 | public SWIGTYPE_p_float getStartPos() { 65 | long cPtr = RecastJNI.dtCrowdAgentAnimation_startPos_get(swigCPtr, this); 66 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 67 | } 68 | 69 | public void setEndPos(SWIGTYPE_p_float value) { 70 | RecastJNI.dtCrowdAgentAnimation_endPos_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 71 | } 72 | 73 | public SWIGTYPE_p_float getEndPos() { 74 | long cPtr = RecastJNI.dtCrowdAgentAnimation_endPos_get(swigCPtr, this); 75 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 76 | } 77 | 78 | public void setPolyRef(long value) { 79 | RecastJNI.dtCrowdAgentAnimation_polyRef_set(swigCPtr, this, value); 80 | } 81 | 82 | public long getPolyRef() { 83 | return RecastJNI.dtCrowdAgentAnimation_polyRef_get(swigCPtr, this); 84 | } 85 | 86 | public void setT(float value) { 87 | RecastJNI.dtCrowdAgentAnimation_t_set(swigCPtr, this, value); 88 | } 89 | 90 | public float getT() { 91 | return RecastJNI.dtCrowdAgentAnimation_t_get(swigCPtr, this); 92 | } 93 | 94 | public void setTmax(float value) { 95 | RecastJNI.dtCrowdAgentAnimation_tmax_set(swigCPtr, this, value); 96 | } 97 | 98 | public float getTmax() { 99 | return RecastJNI.dtCrowdAgentAnimation_tmax_get(swigCPtr, this); 100 | } 101 | 102 | public dtCrowdAgentAnimation() { 103 | this(RecastJNI.new_dtCrowdAgentAnimation(), true); 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtObstacleAvoidanceDebugData.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | 6 | /* ---------------------------------------------------------------------------- 7 | * This file was automatically generated by SWIG (http://www.swig.org). 8 | * Version 2.0.4 9 | * 10 | * Do not make changes to this file unless you know what you are doing--modify 11 | * the SWIG interface file instead. 12 | * ----------------------------------------------------------------------------- */ 13 | public class dtObstacleAvoidanceDebugData { 14 | 15 | private long swigCPtr; 16 | protected boolean swigCMemOwn; 17 | 18 | public dtObstacleAvoidanceDebugData() { 19 | swigCPtr = RecastJNI.dtAllocObstacleAvoidanceDebugData(); 20 | swigCMemOwn = (swigCPtr == 0) ? false : true; 21 | } 22 | 23 | public dtObstacleAvoidanceDebugData(long cPtr, boolean cMemoryOwn) { 24 | swigCMemOwn = cMemoryOwn; 25 | swigCPtr = cPtr; 26 | } 27 | 28 | public static long getCPtr(dtObstacleAvoidanceDebugData obj) { 29 | return (obj == null) ? 0 : obj.swigCPtr; 30 | } 31 | 32 | protected void finalize() { 33 | delete(); 34 | } 35 | 36 | public synchronized void delete() { 37 | if (swigCPtr != 0) { 38 | if (swigCMemOwn) { 39 | swigCMemOwn = false; 40 | RecastJNI.dtFreeObstacleAvoidanceDebugData(swigCPtr, this); 41 | } 42 | swigCPtr = 0; 43 | } 44 | } 45 | 46 | 47 | 48 | public boolean init(int maxSamples) { 49 | return RecastJNI.dtObstacleAvoidanceDebugData_init(swigCPtr, this, maxSamples); 50 | } 51 | 52 | public void reset() { 53 | RecastJNI.dtObstacleAvoidanceDebugData_reset(swigCPtr, this); 54 | } 55 | 56 | public void addSample(SWIGTYPE_p_float vel, float ssize, float pen, float vpen, float vcpen, float spen, float tpen) { 57 | RecastJNI.dtObstacleAvoidanceDebugData_addSample(swigCPtr, this, SWIGTYPE_p_float.getCPtr(vel), ssize, pen, vpen, vcpen, spen, tpen); 58 | } 59 | 60 | public void normalizeSamples() { 61 | RecastJNI.dtObstacleAvoidanceDebugData_normalizeSamples(swigCPtr, this); 62 | } 63 | 64 | public int getSampleCount() { 65 | return RecastJNI.dtObstacleAvoidanceDebugData_getSampleCount(swigCPtr, this); 66 | } 67 | 68 | public SWIGTYPE_p_float getSampleVelocity(int i) { 69 | long cPtr = RecastJNI.dtObstacleAvoidanceDebugData_getSampleVelocity(swigCPtr, this, i); 70 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 71 | } 72 | 73 | public float getSampleSize(int i) { 74 | return RecastJNI.dtObstacleAvoidanceDebugData_getSampleSize(swigCPtr, this, i); 75 | } 76 | 77 | public float getSamplePenalty(int i) { 78 | return RecastJNI.dtObstacleAvoidanceDebugData_getSamplePenalty(swigCPtr, this, i); 79 | } 80 | 81 | public float getSampleDesiredVelocityPenalty(int i) { 82 | return RecastJNI.dtObstacleAvoidanceDebugData_getSampleDesiredVelocityPenalty(swigCPtr, this, i); 83 | } 84 | 85 | public float getSampleCurrentVelocityPenalty(int i) { 86 | return RecastJNI.dtObstacleAvoidanceDebugData_getSampleCurrentVelocityPenalty(swigCPtr, this, i); 87 | } 88 | 89 | public float getSamplePreferredSidePenalty(int i) { 90 | return RecastJNI.dtObstacleAvoidanceDebugData_getSamplePreferredSidePenalty(swigCPtr, this, i); 91 | } 92 | 93 | public float getSampleCollisionTimePenalty(int i) { 94 | return RecastJNI.dtObstacleAvoidanceDebugData_getSampleCollisionTimePenalty(swigCPtr, this, i); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/Link.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Defines a link between polygons. 7 | * 8 | * Note This structure is rarely if ever used by the end user. 9 | * 10 | * @author Tihomir Radosavljevic 11 | * @version 1.0 12 | */ 13 | public class Link { 14 | 15 | private long swigCPtr; 16 | protected boolean swigCMemOwn; 17 | 18 | public Link() { 19 | this(RecastJNI.new_dtLink(), true); 20 | } 21 | 22 | public Link(long cPtr, boolean cMemoryOwn) { 23 | swigCMemOwn = cMemoryOwn; 24 | swigCPtr = cPtr; 25 | } 26 | 27 | public static long getCPtr(Link obj) { 28 | return (obj == null) ? 0 : obj.swigCPtr; 29 | } 30 | 31 | @Override 32 | protected void finalize() { 33 | delete(); 34 | } 35 | 36 | public synchronized void delete() { 37 | if (swigCPtr != 0) { 38 | if (swigCMemOwn) { 39 | swigCMemOwn = false; 40 | RecastJNI.delete_dtLink(swigCPtr); 41 | } 42 | swigCPtr = 0; 43 | } 44 | } 45 | 46 | /** 47 | * 48 | * @param value Neighbour reference. (The neighbor that is linked to.) 49 | */ 50 | public void setReference(long value) { 51 | RecastJNI.dtLink_ref_set(swigCPtr, this, value); 52 | } 53 | 54 | /** 55 | * 56 | * @return Neighbour reference. (The neighbor that is linked to.) 57 | */ 58 | public long getReference() { 59 | return RecastJNI.dtLink_ref_get(swigCPtr, this); 60 | } 61 | 62 | /** 63 | * 64 | * @param value Index of the next link. 65 | */ 66 | public void setNext(long value) { 67 | RecastJNI.dtLink_next_set(swigCPtr, this, value); 68 | } 69 | 70 | /** 71 | * 72 | * @return Index of the next link. 73 | */ 74 | public long getNext() { 75 | return RecastJNI.dtLink_next_get(swigCPtr, this); 76 | } 77 | 78 | /** 79 | * 80 | * @param value Index of the polygon edge that owns this link. 81 | */ 82 | public void setEdge(short value) { 83 | RecastJNI.dtLink_edge_set(swigCPtr, this, value); 84 | } 85 | 86 | /** 87 | * 88 | * @return Index of the polygon edge that owns this link. 89 | */ 90 | public short getEdge() { 91 | return RecastJNI.dtLink_edge_get(swigCPtr, this); 92 | } 93 | 94 | /** 95 | * 96 | * @param value If a boundary link, defines on which side the link is. 97 | */ 98 | public void setSide(short value) { 99 | RecastJNI.dtLink_side_set(swigCPtr, this, value); 100 | } 101 | 102 | /** 103 | * 104 | * @return If a boundary link, defines on which side the link is. 105 | */ 106 | public short getSide() { 107 | return RecastJNI.dtLink_side_get(swigCPtr, this); 108 | } 109 | 110 | /** 111 | * 112 | * @param value If a boundary link, defines the minimum sub-edge area. 113 | */ 114 | public void setMinBoundary(short value) { 115 | RecastJNI.dtLink_bmin_set(swigCPtr, this, value); 116 | } 117 | 118 | /** 119 | * 120 | * @return If a boundary link, defines the minimum sub-edge area. 121 | */ 122 | public short getMinBoundary() { 123 | return RecastJNI.dtLink_bmin_get(swigCPtr, this); 124 | } 125 | 126 | /** 127 | * 128 | * @param value If a boundary link, defines the maximum sub-edge area. 129 | */ 130 | public void setMaxBoundary(short value) { 131 | RecastJNI.dtLink_bmax_set(swigCPtr, this, value); 132 | } 133 | 134 | /** 135 | * 136 | * @return If a boundary link, defines the maximum sub-edge area. 137 | */ 138 | public short getMaxBoundary() { 139 | return RecastJNI.dtLink_bmax_get(swigCPtr, this); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/Node.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | import com.jme3.math.Vector3f; 7 | 8 | /** 9 | * 10 | * @author Tihomir Radosavljevic 11 | * @version 1.0 12 | */ 13 | public class Node { 14 | 15 | private long swigCPtr; 16 | protected boolean swigCMemOwn; 17 | 18 | public Node() { 19 | this(RecastJNI.new_dtNode(), true); 20 | } 21 | 22 | public Node(long cPtr, boolean cMemoryOwn) { 23 | swigCMemOwn = cMemoryOwn; 24 | swigCPtr = cPtr; 25 | } 26 | 27 | public static long getCPtr(Node obj) { 28 | return (obj == null) ? 0 : obj.swigCPtr; 29 | } 30 | 31 | @Override 32 | protected void finalize() { 33 | delete(); 34 | } 35 | 36 | public synchronized void delete() { 37 | if (swigCPtr != 0) { 38 | if (swigCMemOwn) { 39 | swigCMemOwn = false; 40 | RecastJNI.delete_dtNode(swigCPtr); 41 | } 42 | swigCPtr = 0; 43 | } 44 | } 45 | 46 | /** 47 | * 48 | * @param position Position of the node. 49 | */ 50 | public void setPosition(Vector3f position) { 51 | SWIGTYPE_p_float value = Converter.convertToSWIGTYPE_p_float(position); 52 | RecastJNI.dtNode_pos_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 53 | } 54 | 55 | /** 56 | * 57 | * @return Position of the node. 58 | */ 59 | public Vector3f getPosition() { 60 | long cPtr = RecastJNI.dtNode_pos_get(swigCPtr, this); 61 | return (cPtr == 0) ? null : Converter.convertToVector3f(cPtr); 62 | } 63 | 64 | /** 65 | * 66 | * @param value Cost from previous node to current node. 67 | */ 68 | public void setCost(float value) { 69 | RecastJNI.dtNode_cost_set(swigCPtr, this, value); 70 | } 71 | 72 | /** 73 | * 74 | * @return Cost from previous node to current node. 75 | */ 76 | public float getCost() { 77 | return RecastJNI.dtNode_cost_get(swigCPtr, this); 78 | } 79 | 80 | /** 81 | * 82 | * @param value Cost up to the node. 83 | */ 84 | public void setTotal(float value) { 85 | RecastJNI.dtNode_total_set(swigCPtr, this, value); 86 | } 87 | 88 | /** 89 | * 90 | * @return Cost up to the node. 91 | */ 92 | public float getTotal() { 93 | return RecastJNI.dtNode_total_get(swigCPtr, this); 94 | } 95 | 96 | /** 97 | * 98 | * @param value Index to parent node. 99 | */ 100 | public void setParentIndex(long value) { 101 | RecastJNI.dtNode_pidx_set(swigCPtr, this, value); 102 | } 103 | 104 | /** 105 | * 106 | * @return Index to parent node. 107 | */ 108 | public long getParenIndex() { 109 | return RecastJNI.dtNode_pidx_get(swigCPtr, this); 110 | } 111 | 112 | /** 113 | * 114 | * @param value Node flags 0/open/closed. 115 | */ 116 | public void setFlags(long value) { 117 | RecastJNI.dtNode_flags_set(swigCPtr, this, value); 118 | } 119 | 120 | /** 121 | * 122 | * @return Node flags 0/open/closed. 123 | */ 124 | public long getFlags() { 125 | return RecastJNI.dtNode_flags_get(swigCPtr, this); 126 | } 127 | 128 | /** 129 | * 130 | * @param value Polygon ref the node corresponds to. 131 | */ 132 | public void setId(Poly poly) { 133 | long value = Poly.getCPtr(poly); 134 | RecastJNI.dtNode_id_set(swigCPtr, this, value); 135 | } 136 | 137 | /** 138 | * 139 | * @return Polygon ref the node corresponds to. 140 | */ 141 | public Poly getId() { 142 | long pointer = RecastJNI.dtNode_id_get(swigCPtr, this); 143 | return (pointer == 0) ? null : new Poly(pointer, false); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/NavMeshParams.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | import com.jme3.math.Vector3f; 7 | 8 | /** 9 | * Configuration parameters used to define multi-tile navigation meshes. 10 | * 11 | * The values are used to allocate space during the initialization of a 12 | * navigation mesh. 13 | * 14 | * @see NavMesh#init(com.jme3.ai.navigation.detour.NavMeshParams) 15 | * 16 | * @author Tihomir Radosavljevic 17 | * @version 1.0 18 | */ 19 | public class NavMeshParams { 20 | 21 | private long swigCPtr; 22 | protected boolean swigCMemOwn; 23 | 24 | public NavMeshParams() { 25 | this(RecastJNI.new_dtNavMeshParams(), true); 26 | } 27 | 28 | protected NavMeshParams(long cPtr, boolean cMemoryOwn) { 29 | swigCMemOwn = cMemoryOwn; 30 | swigCPtr = cPtr; 31 | } 32 | 33 | public static long getCPtr(NavMeshParams obj) { 34 | return (obj == null) ? 0 : obj.swigCPtr; 35 | } 36 | 37 | @Override 38 | protected void finalize() { 39 | delete(); 40 | } 41 | 42 | public synchronized void delete() { 43 | if (swigCPtr != 0) { 44 | if (swigCMemOwn) { 45 | swigCMemOwn = false; 46 | RecastJNI.delete_dtNavMeshParams(swigCPtr); 47 | } 48 | swigCPtr = 0; 49 | } 50 | } 51 | 52 | /** 53 | * 54 | * @param origin The world space origin of the navigation mesh's tile space. 55 | */ 56 | public void setOrigin(Vector3f origin) { 57 | SWIGTYPE_p_float value = Converter.convertToSWIGTYPE_p_float(origin); 58 | RecastJNI.dtNavMeshParams_orig_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 59 | } 60 | 61 | /** 62 | * 63 | * @return The world space origin of the navigation mesh's tile space. 64 | */ 65 | public Vector3f getOrigin() { 66 | long cPtr = RecastJNI.dtNavMeshParams_orig_get(swigCPtr, this); 67 | return (cPtr == 0) ? null : Converter.convertToVector3f(cPtr); 68 | } 69 | 70 | /** 71 | * 72 | * @param value The width of each tile. (Along the x-axis.) 73 | */ 74 | public void setTileWidth(float value) { 75 | RecastJNI.dtNavMeshParams_tileWidth_set(swigCPtr, this, value); 76 | } 77 | 78 | /** 79 | * 80 | * @return The width of each tile. (Along the x-axis.) 81 | */ 82 | public float getTileWidth() { 83 | return RecastJNI.dtNavMeshParams_tileWidth_get(swigCPtr, this); 84 | } 85 | 86 | /** 87 | * 88 | * @param value The height of each tile. (Along the z-axis.) 89 | */ 90 | public void setTileHeight(float value) { 91 | RecastJNI.dtNavMeshParams_tileHeight_set(swigCPtr, this, value); 92 | } 93 | 94 | /** 95 | * 96 | * @return The height of each tile. (Along the z-axis.) 97 | */ 98 | public float getTileHeight() { 99 | return RecastJNI.dtNavMeshParams_tileHeight_get(swigCPtr, this); 100 | } 101 | 102 | /** 103 | * 104 | * @param value The maximum number of tiles the navigation mesh can contain. 105 | */ 106 | public void setMaxTiles(int value) { 107 | RecastJNI.dtNavMeshParams_maxTiles_set(swigCPtr, this, value); 108 | } 109 | 110 | /** 111 | * 112 | * @return The maximum number of tiles the navigation mesh can contain. 113 | */ 114 | public int getMaxTiles() { 115 | return RecastJNI.dtNavMeshParams_maxTiles_get(swigCPtr, this); 116 | } 117 | 118 | /** 119 | * 120 | * @param value The maximum number of polygons each tile can contain. 121 | */ 122 | public void setMaxPolygons(int value) { 123 | RecastJNI.dtNavMeshParams_maxPolys_set(swigCPtr, this, value); 124 | } 125 | 126 | /** 127 | * 128 | * @return The maximum number of polygons each tile can contain. 129 | */ 130 | public int getMaxPolygons() { 131 | return RecastJNI.dtNavMeshParams_maxPolys_get(swigCPtr, this); 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtObstacleAvoidanceParams.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | 6 | /* ---------------------------------------------------------------------------- 7 | * This file was automatically generated by SWIG (http://www.swig.org). 8 | * Version 2.0.4 9 | * 10 | * Do not make changes to this file unless you know what you are doing--modify 11 | * the SWIG interface file instead. 12 | * ----------------------------------------------------------------------------- */ 13 | 14 | 15 | public class dtObstacleAvoidanceParams { 16 | private long swigCPtr; 17 | protected boolean swigCMemOwn; 18 | 19 | public dtObstacleAvoidanceParams(long cPtr, boolean cMemoryOwn) { 20 | swigCMemOwn = cMemoryOwn; 21 | swigCPtr = cPtr; 22 | } 23 | 24 | public static long getCPtr(dtObstacleAvoidanceParams obj) { 25 | return (obj == null) ? 0 : obj.swigCPtr; 26 | } 27 | 28 | protected void finalize() { 29 | delete(); 30 | } 31 | 32 | public synchronized void delete() { 33 | if (swigCPtr != 0) { 34 | if (swigCMemOwn) { 35 | swigCMemOwn = false; 36 | RecastJNI.delete_dtObstacleAvoidanceParams(swigCPtr); 37 | } 38 | swigCPtr = 0; 39 | } 40 | } 41 | 42 | public void setVelBias(float value) { 43 | RecastJNI.dtObstacleAvoidanceParams_velBias_set(swigCPtr, this, value); 44 | } 45 | 46 | public float getVelBias() { 47 | return RecastJNI.dtObstacleAvoidanceParams_velBias_get(swigCPtr, this); 48 | } 49 | 50 | public void setWeightDesVel(float value) { 51 | RecastJNI.dtObstacleAvoidanceParams_weightDesVel_set(swigCPtr, this, value); 52 | } 53 | 54 | public float getWeightDesVel() { 55 | return RecastJNI.dtObstacleAvoidanceParams_weightDesVel_get(swigCPtr, this); 56 | } 57 | 58 | public void setWeightCurVel(float value) { 59 | RecastJNI.dtObstacleAvoidanceParams_weightCurVel_set(swigCPtr, this, value); 60 | } 61 | 62 | public float getWeightCurVel() { 63 | return RecastJNI.dtObstacleAvoidanceParams_weightCurVel_get(swigCPtr, this); 64 | } 65 | 66 | public void setWeightSide(float value) { 67 | RecastJNI.dtObstacleAvoidanceParams_weightSide_set(swigCPtr, this, value); 68 | } 69 | 70 | public float getWeightSide() { 71 | return RecastJNI.dtObstacleAvoidanceParams_weightSide_get(swigCPtr, this); 72 | } 73 | 74 | public void setWeightToi(float value) { 75 | RecastJNI.dtObstacleAvoidanceParams_weightToi_set(swigCPtr, this, value); 76 | } 77 | 78 | public float getWeightToi() { 79 | return RecastJNI.dtObstacleAvoidanceParams_weightToi_get(swigCPtr, this); 80 | } 81 | 82 | public void setHorizTime(float value) { 83 | RecastJNI.dtObstacleAvoidanceParams_horizTime_set(swigCPtr, this, value); 84 | } 85 | 86 | public float getHorizTime() { 87 | return RecastJNI.dtObstacleAvoidanceParams_horizTime_get(swigCPtr, this); 88 | } 89 | 90 | public void setGridSize(short value) { 91 | RecastJNI.dtObstacleAvoidanceParams_gridSize_set(swigCPtr, this, value); 92 | } 93 | 94 | public short getGridSize() { 95 | return RecastJNI.dtObstacleAvoidanceParams_gridSize_get(swigCPtr, this); 96 | } 97 | 98 | public void setAdaptiveDivs(short value) { 99 | RecastJNI.dtObstacleAvoidanceParams_adaptiveDivs_set(swigCPtr, this, value); 100 | } 101 | 102 | public short getAdaptiveDivs() { 103 | return RecastJNI.dtObstacleAvoidanceParams_adaptiveDivs_get(swigCPtr, this); 104 | } 105 | 106 | public void setAdaptiveRings(short value) { 107 | RecastJNI.dtObstacleAvoidanceParams_adaptiveRings_set(swigCPtr, this, value); 108 | } 109 | 110 | public short getAdaptiveRings() { 111 | return RecastJNI.dtObstacleAvoidanceParams_adaptiveRings_get(swigCPtr, this); 112 | } 113 | 114 | public void setAdaptiveDepth(short value) { 115 | RecastJNI.dtObstacleAvoidanceParams_adaptiveDepth_set(swigCPtr, this, value); 116 | } 117 | 118 | public short getAdaptiveDepth() { 119 | return RecastJNI.dtObstacleAvoidanceParams_adaptiveDepth_get(swigCPtr, this); 120 | } 121 | 122 | public dtObstacleAvoidanceParams() { 123 | this(RecastJNI.new_dtObstacleAvoidanceParams(), true); 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheLayer.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char; 6 | 7 | /** 8 | * 9 | * @author Tihomir Radosavljevic 10 | * @version 0.5 11 | */ 12 | public class TileCacheLayer { 13 | 14 | private long swigCPtr; 15 | protected boolean swigCMemOwn; 16 | 17 | public TileCacheLayer() { 18 | this(RecastJNI.new_dtTileCacheLayer(), true); 19 | } 20 | 21 | public TileCacheLayer(long cPtr, boolean cMemoryOwn) { 22 | swigCMemOwn = cMemoryOwn; 23 | swigCPtr = cPtr; 24 | } 25 | 26 | public static long getCPtr(TileCacheLayer obj) { 27 | return (obj == null) ? 0 : obj.swigCPtr; 28 | } 29 | 30 | @Override 31 | protected void finalize() { 32 | delete(); 33 | } 34 | 35 | public synchronized void delete() { 36 | if (swigCPtr != 0) { 37 | if (swigCMemOwn) { 38 | swigCMemOwn = false; 39 | RecastJNI.delete_dtTileCacheLayer(swigCPtr); 40 | } 41 | swigCPtr = 0; 42 | } 43 | } 44 | 45 | public void setHeader(TileCacheLayerHeader value) { 46 | RecastJNI.dtTileCacheLayer_header_set(swigCPtr, this, TileCacheLayerHeader.getCPtr(value), value); 47 | } 48 | 49 | public TileCacheLayerHeader getHeader() { 50 | long cPtr = RecastJNI.dtTileCacheLayer_header_get(swigCPtr, this); 51 | return (cPtr == 0) ? null : new TileCacheLayerHeader(cPtr, false); 52 | } 53 | 54 | public void setRegionCount(short value) { 55 | RecastJNI.dtTileCacheLayer_regCount_set(swigCPtr, this, value); 56 | } 57 | 58 | public short getRegionCount() { 59 | return RecastJNI.dtTileCacheLayer_regCount_get(swigCPtr, this); 60 | } 61 | 62 | public void setHeights(char[] heights) { 63 | SWIGTYPE_p_unsigned_char value = Converter.convertToSWIGTYPE_p_unsigned_char(heights); 64 | RecastJNI.dtTileCacheLayer_heights_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 65 | } 66 | 67 | public char[] getHeights() { 68 | long cPtr = RecastJNI.dtTileCacheLayer_heights_get(swigCPtr, this); 69 | if (cPtr == 0) { 70 | return null; 71 | } 72 | //not sure if this is correct lenght of array 73 | return Converter.convertToChars(cPtr, getRegionCount()); 74 | } 75 | 76 | public void setAreas(char[] areas) { 77 | SWIGTYPE_p_unsigned_char value = Converter.convertToSWIGTYPE_p_unsigned_char(areas); 78 | RecastJNI.dtTileCacheLayer_areas_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 79 | } 80 | 81 | public char[] getAreas() { 82 | long cPtr = RecastJNI.dtTileCacheLayer_areas_get(swigCPtr, this); 83 | if (cPtr == 0) { 84 | return null; 85 | } 86 | //not sure if this is correct lenght of array 87 | return Converter.convertToChars(cPtr, getRegionCount()); 88 | } 89 | 90 | public void setConnections(char[] connections) { 91 | SWIGTYPE_p_unsigned_char value = Converter.convertToSWIGTYPE_p_unsigned_char(connections); 92 | RecastJNI.dtTileCacheLayer_cons_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 93 | } 94 | 95 | public char[] getConnections() { 96 | long cPtr = RecastJNI.dtTileCacheLayer_cons_get(swigCPtr, this); 97 | if (cPtr == 0) { 98 | return null; 99 | } 100 | //not sure if this is correct lenght of array 101 | return Converter.convertToChars(cPtr, getRegionCount()); 102 | } 103 | 104 | public void setRegions(char[] regions) { 105 | SWIGTYPE_p_unsigned_char value = Converter.convertToSWIGTYPE_p_unsigned_char(regions); 106 | RecastJNI.dtTileCacheLayer_regs_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 107 | } 108 | 109 | public char[] getRegions() { 110 | long cPtr = RecastJNI.dtTileCacheLayer_regs_get(swigCPtr, this); 111 | if (cPtr == 0) { 112 | return null; 113 | } 114 | return Converter.convertToChars(cPtr, getRegionCount()); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/recast/Context.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.recast; 2 | 3 | import com.jme3.ai.navigation.utils.RecastJNI; 4 | 5 | /** 6 | * Provides an interface for optional logging and performance tracking of the 7 | * Recast build process. 8 | * 9 | * This class does not provide logging or timer functionality on its own. Both 10 | * must be provided by a concrete implementation by overriding the protected 11 | * member functions. Also, this class does not provide an interface for 12 | * extracting log messages. (Only adding them.) So concrete implementations must 13 | * provide one. 14 | * 15 | * If no logging or timers are required, just pass an instance of this class 16 | * through the Recast build process. 17 | * 18 | * NOTE: For now Context is not implemented in Recast native library and does 19 | * not provide any functionality. 20 | * 21 | * @author Tihomir Radosavljavic 22 | * @version 1.0 23 | */ 24 | public class Context { 25 | 26 | private long swigCPtr; 27 | protected boolean swigCMemOwn; 28 | 29 | public Context() { 30 | this(RecastJNI.new_rcContext__SWIG_1(), true); 31 | } 32 | 33 | /** 34 | * Contructor. 35 | * 36 | * @param state TRUE if the logging and performance timers should be 37 | * enabled. [Default: true] 38 | */ 39 | public Context(boolean state) { 40 | this(RecastJNI.new_rcContext__SWIG_0(state), true); 41 | } 42 | 43 | protected Context(long cPtr, boolean cMemoryOwn) { 44 | swigCMemOwn = cMemoryOwn; 45 | swigCPtr = cPtr; 46 | } 47 | 48 | public static long getCPtr(Context obj) { 49 | return (obj == null) ? 0 : obj.swigCPtr; 50 | } 51 | 52 | @Override 53 | protected void finalize() { 54 | delete(); 55 | } 56 | 57 | public synchronized void delete() { 58 | if (swigCPtr != 0) { 59 | if (swigCMemOwn) { 60 | swigCMemOwn = false; 61 | RecastJNI.delete_rcContext(swigCPtr); 62 | } 63 | swigCPtr = 0; 64 | } 65 | } 66 | /** 67 | * Enables or disables logging. 68 | * @param state TRUE if logging should be enabled. 69 | 70 | */ 71 | public void enableLog(boolean state) { 72 | RecastJNI.rcContext_enableLog(swigCPtr, this, state); 73 | } 74 | 75 | /** 76 | * Clears all log entries. 77 | */ 78 | public void resetLog() { 79 | RecastJNI.rcContext_resetLog(swigCPtr, this); 80 | } 81 | 82 | /** 83 | * Logs a message. 84 | * 85 | * @param category The category of the message. 86 | * @param message The formatted message. 87 | */ 88 | public void log(LogCategory category, String message) { 89 | RecastJNI.rcContext_log(swigCPtr, this, category.swigValue(), message); 90 | } 91 | /** 92 | * Enables or disables the performance timers. 93 | * @param state TRUE if timers should be enabled. 94 | */ 95 | public void enableTimer(boolean state) { 96 | RecastJNI.rcContext_enableTimer(swigCPtr, this, state); 97 | } 98 | 99 | /** 100 | * Clears all timers. (Resets all to unused.) 101 | */ 102 | public void resetTimers() { 103 | RecastJNI.rcContext_resetTimers(swigCPtr, this); 104 | } 105 | 106 | /** 107 | * Starts the specified performance timer. 108 | * 109 | * @param label The category of timer. 110 | */ 111 | public void startTimer(TimerLabel label) { 112 | RecastJNI.rcContext_startTimer(swigCPtr, this, label.value()); 113 | } 114 | 115 | /** 116 | * Stops the specified performance timer. 117 | * 118 | * @param label The category of the timer. 119 | */ 120 | public void stopTimer(TimerLabel label) { 121 | RecastJNI.rcContext_stopTimer(swigCPtr, this, label.value()); 122 | } 123 | 124 | /** 125 | * Returns the total accumulated time of the specified performance timer. 126 | * 127 | * @param label The category of the timer. 128 | * @return The accumulated time of the timer, or -1 if timers are disabled 129 | * or the timer has never been started. 130 | */ 131 | public int getAccumulatedTime(TimerLabel label) { 132 | return RecastJNI.rcContext_getAccumulatedTime(swigCPtr, this, label.value()); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/CompressedTile.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char; 6 | 7 | /** 8 | * 9 | * @author Tihomir Radosavljevic 10 | * @version 1.0 11 | */ 12 | public class CompressedTile { 13 | 14 | private long swigCPtr; 15 | protected boolean swigCMemOwn; 16 | 17 | public CompressedTile() { 18 | this(RecastJNI.new_dtCompressedTile(), true); 19 | } 20 | 21 | public CompressedTile(long cPtr, boolean cMemoryOwn) { 22 | swigCMemOwn = cMemoryOwn; 23 | swigCPtr = cPtr; 24 | } 25 | 26 | public static long getCPtr(CompressedTile obj) { 27 | return (obj == null) ? 0 : obj.swigCPtr; 28 | } 29 | 30 | @Override 31 | protected void finalize() { 32 | delete(); 33 | } 34 | 35 | public synchronized void delete() { 36 | if (swigCPtr != 0) { 37 | if (swigCMemOwn) { 38 | swigCMemOwn = false; 39 | RecastJNI.delete_dtCompressedTile(swigCPtr); 40 | } 41 | swigCPtr = 0; 42 | } 43 | } 44 | 45 | /** 46 | * 47 | * @param value Counter describing modifications to the tile. 48 | */ 49 | public void setSalt(long value) { 50 | RecastJNI.dtCompressedTile_salt_set(swigCPtr, this, value); 51 | } 52 | 53 | /** 54 | * 55 | * @return Counter describing modifications to the tile. F 56 | */ 57 | public long getSalt() { 58 | return RecastJNI.dtCompressedTile_salt_get(swigCPtr, this); 59 | } 60 | 61 | public void setHeader(TileCacheLayerHeader value) { 62 | RecastJNI.dtCompressedTile_header_set(swigCPtr, this, TileCacheLayerHeader.getCPtr(value), value); 63 | } 64 | 65 | public TileCacheLayerHeader getHeader() { 66 | long cPtr = RecastJNI.dtCompressedTile_header_get(swigCPtr, this); 67 | return (cPtr == 0) ? null : new TileCacheLayerHeader(cPtr, false); 68 | } 69 | 70 | public void setCompressed(char[] compressed) { 71 | SWIGTYPE_p_unsigned_char value = Converter.convertToSWIGTYPE_p_unsigned_char(compressed); 72 | RecastJNI.dtCompressedTile_compressed_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 73 | } 74 | 75 | public char[] getCompressed() { 76 | long cPtr = RecastJNI.dtCompressedTile_compressed_get(swigCPtr, this); 77 | if (cPtr == 0) { 78 | return null; 79 | } 80 | return Converter.convertToChars(cPtr, getCompressedSize()); 81 | } 82 | 83 | public void setCompressedSize(int value) { 84 | RecastJNI.dtCompressedTile_compressedSize_set(swigCPtr, this, value); 85 | } 86 | 87 | public int getCompressedSize() { 88 | return RecastJNI.dtCompressedTile_compressedSize_get(swigCPtr, this); 89 | } 90 | 91 | public void setData(char[] data) { 92 | SWIGTYPE_p_unsigned_char value = Converter.convertToSWIGTYPE_p_unsigned_char(data); 93 | RecastJNI.dtCompressedTile_data_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 94 | } 95 | 96 | public char[] getData() { 97 | long cPtr = RecastJNI.dtCompressedTile_data_get(swigCPtr, this); 98 | if (cPtr == 0) { 99 | return null; 100 | } 101 | return Converter.convertToChars(cPtr, getDataSize()); 102 | } 103 | 104 | public void setDataSize(int value) { 105 | RecastJNI.dtCompressedTile_dataSize_set(swigCPtr, this, value); 106 | } 107 | 108 | public int getDataSize() { 109 | return RecastJNI.dtCompressedTile_dataSize_get(swigCPtr, this); 110 | } 111 | 112 | public void setFlags(long value) { 113 | RecastJNI.dtCompressedTile_flags_set(swigCPtr, this, value); 114 | } 115 | 116 | public long getFlags() { 117 | return RecastJNI.dtCompressedTile_flags_get(swigCPtr, this); 118 | } 119 | 120 | public void setNext(CompressedTile value) { 121 | RecastJNI.dtCompressedTile_next_set(swigCPtr, this, CompressedTile.getCPtr(value), value); 122 | } 123 | 124 | public CompressedTile getNext() { 125 | long cPtr = RecastJNI.dtCompressedTile_next_get(swigCPtr, this); 126 | return (cPtr == 0) ? null : new CompressedTile(cPtr, false); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheParams.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | import com.jme3.math.Vector3f; 7 | 8 | /** 9 | * 10 | * @author Tihomir Radosavljevic 11 | * @version 1.0 12 | */ 13 | public class TileCacheParams { 14 | 15 | private long swigCPtr; 16 | protected boolean swigCMemOwn; 17 | 18 | public TileCacheParams() { 19 | this(RecastJNI.new_dtTileCacheParams(), true); 20 | } 21 | 22 | public TileCacheParams(long cPtr, boolean cMemoryOwn) { 23 | swigCMemOwn = cMemoryOwn; 24 | swigCPtr = cPtr; 25 | } 26 | 27 | public static long getCPtr(TileCacheParams obj) { 28 | return (obj == null) ? 0 : obj.swigCPtr; 29 | } 30 | 31 | @Override 32 | protected void finalize() { 33 | delete(); 34 | } 35 | 36 | public synchronized void delete() { 37 | if (swigCPtr != 0) { 38 | if (swigCMemOwn) { 39 | swigCMemOwn = false; 40 | RecastJNI.delete_dtTileCacheParams(swigCPtr); 41 | } 42 | swigCPtr = 0; 43 | } 44 | } 45 | 46 | public void setOrigin(Vector3f position) { 47 | SWIGTYPE_p_float value = Converter.convertToSWIGTYPE_p_float(position); 48 | RecastJNI.dtTileCacheParams_orig_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 49 | } 50 | 51 | public Vector3f getOrigin() { 52 | long cPtr = RecastJNI.dtTileCacheParams_orig_get(swigCPtr, this); 53 | return (cPtr == 0) ? null : Converter.convertToVector3f(cPtr); 54 | } 55 | 56 | public void setCellSize(float value) { 57 | RecastJNI.dtTileCacheParams_cs_set(swigCPtr, this, value); 58 | } 59 | 60 | public float getCellSize() { 61 | return RecastJNI.dtTileCacheParams_cs_get(swigCPtr, this); 62 | } 63 | 64 | public void setCellHeight(float value) { 65 | RecastJNI.dtTileCacheParams_ch_set(swigCPtr, this, value); 66 | } 67 | 68 | public float getCellHeight() { 69 | return RecastJNI.dtTileCacheParams_ch_get(swigCPtr, this); 70 | } 71 | 72 | public void setWidth(int value) { 73 | RecastJNI.dtTileCacheParams_width_set(swigCPtr, this, value); 74 | } 75 | 76 | public int getWidth() { 77 | return RecastJNI.dtTileCacheParams_width_get(swigCPtr, this); 78 | } 79 | 80 | public void setHeight(int value) { 81 | RecastJNI.dtTileCacheParams_height_set(swigCPtr, this, value); 82 | } 83 | 84 | public int getHeight() { 85 | return RecastJNI.dtTileCacheParams_height_get(swigCPtr, this); 86 | } 87 | 88 | public void setWalkableHeight(float value) { 89 | RecastJNI.dtTileCacheParams_walkableHeight_set(swigCPtr, this, value); 90 | } 91 | 92 | public float getWalkableHeight() { 93 | return RecastJNI.dtTileCacheParams_walkableHeight_get(swigCPtr, this); 94 | } 95 | 96 | public void setWalkableRadius(float value) { 97 | RecastJNI.dtTileCacheParams_walkableRadius_set(swigCPtr, this, value); 98 | } 99 | 100 | public float getWalkableRadius() { 101 | return RecastJNI.dtTileCacheParams_walkableRadius_get(swigCPtr, this); 102 | } 103 | 104 | public void setWalkableClimb(float value) { 105 | RecastJNI.dtTileCacheParams_walkableClimb_set(swigCPtr, this, value); 106 | } 107 | 108 | public float getWalkableClimb() { 109 | return RecastJNI.dtTileCacheParams_walkableClimb_get(swigCPtr, this); 110 | } 111 | 112 | public void setMaxSimplificationError(float value) { 113 | RecastJNI.dtTileCacheParams_maxSimplificationError_set(swigCPtr, this, value); 114 | } 115 | 116 | public float getMaxSimplificationError() { 117 | return RecastJNI.dtTileCacheParams_maxSimplificationError_get(swigCPtr, this); 118 | } 119 | 120 | public void setMaxTiles(int value) { 121 | RecastJNI.dtTileCacheParams_maxTiles_set(swigCPtr, this, value); 122 | } 123 | 124 | public int getMaxTiles() { 125 | return RecastJNI.dtTileCacheParams_maxTiles_get(swigCPtr, this); 126 | } 127 | 128 | public void setMaxObstacles(int value) { 129 | RecastJNI.dtTileCacheParams_maxObstacles_set(swigCPtr, this, value); 130 | } 131 | 132 | public int getMaxObstacles() { 133 | return RecastJNI.dtTileCacheParams_maxObstacles_get(swigCPtr, this); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtCrowdAgentParams.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_void; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | 7 | /* ---------------------------------------------------------------------------- 8 | * This file was automatically generated by SWIG (http://www.swig.org). 9 | * Version 2.0.4 10 | * 11 | * Do not make changes to this file unless you know what you are doing--modify 12 | * the SWIG interface file instead. 13 | * ----------------------------------------------------------------------------- */ 14 | 15 | 16 | public class dtCrowdAgentParams { 17 | private long swigCPtr; 18 | protected boolean swigCMemOwn; 19 | 20 | public dtCrowdAgentParams(long cPtr, boolean cMemoryOwn) { 21 | swigCMemOwn = cMemoryOwn; 22 | swigCPtr = cPtr; 23 | } 24 | 25 | public static long getCPtr(dtCrowdAgentParams obj) { 26 | return (obj == null) ? 0 : obj.swigCPtr; 27 | } 28 | 29 | protected void finalize() { 30 | delete(); 31 | } 32 | 33 | public synchronized void delete() { 34 | if (swigCPtr != 0) { 35 | if (swigCMemOwn) { 36 | swigCMemOwn = false; 37 | RecastJNI.delete_dtCrowdAgentParams(swigCPtr); 38 | } 39 | swigCPtr = 0; 40 | } 41 | } 42 | 43 | public void setRadius(float value) { 44 | RecastJNI.dtCrowdAgentParams_radius_set(swigCPtr, this, value); 45 | } 46 | 47 | public float getRadius() { 48 | return RecastJNI.dtCrowdAgentParams_radius_get(swigCPtr, this); 49 | } 50 | 51 | public void setHeight(float value) { 52 | RecastJNI.dtCrowdAgentParams_height_set(swigCPtr, this, value); 53 | } 54 | 55 | public float getHeight() { 56 | return RecastJNI.dtCrowdAgentParams_height_get(swigCPtr, this); 57 | } 58 | 59 | public void setMaxAcceleration(float value) { 60 | RecastJNI.dtCrowdAgentParams_maxAcceleration_set(swigCPtr, this, value); 61 | } 62 | 63 | public float getMaxAcceleration() { 64 | return RecastJNI.dtCrowdAgentParams_maxAcceleration_get(swigCPtr, this); 65 | } 66 | 67 | public void setMaxSpeed(float value) { 68 | RecastJNI.dtCrowdAgentParams_maxSpeed_set(swigCPtr, this, value); 69 | } 70 | 71 | public float getMaxSpeed() { 72 | return RecastJNI.dtCrowdAgentParams_maxSpeed_get(swigCPtr, this); 73 | } 74 | 75 | public void setCollisionQueryRange(float value) { 76 | RecastJNI.dtCrowdAgentParams_collisionQueryRange_set(swigCPtr, this, value); 77 | } 78 | 79 | public float getCollisionQueryRange() { 80 | return RecastJNI.dtCrowdAgentParams_collisionQueryRange_get(swigCPtr, this); 81 | } 82 | 83 | public void setPathOptimizationRange(float value) { 84 | RecastJNI.dtCrowdAgentParams_pathOptimizationRange_set(swigCPtr, this, value); 85 | } 86 | 87 | public float getPathOptimizationRange() { 88 | return RecastJNI.dtCrowdAgentParams_pathOptimizationRange_get(swigCPtr, this); 89 | } 90 | 91 | public void setSeparationWeight(float value) { 92 | RecastJNI.dtCrowdAgentParams_separationWeight_set(swigCPtr, this, value); 93 | } 94 | 95 | public float getSeparationWeight() { 96 | return RecastJNI.dtCrowdAgentParams_separationWeight_get(swigCPtr, this); 97 | } 98 | 99 | public void setUpdateFlags(short value) { 100 | RecastJNI.dtCrowdAgentParams_updateFlags_set(swigCPtr, this, value); 101 | } 102 | 103 | public short getUpdateFlags() { 104 | return RecastJNI.dtCrowdAgentParams_updateFlags_get(swigCPtr, this); 105 | } 106 | 107 | public void setObstacleAvoidanceType(short value) { 108 | RecastJNI.dtCrowdAgentParams_obstacleAvoidanceType_set(swigCPtr, this, value); 109 | } 110 | 111 | public short getObstacleAvoidanceType() { 112 | return RecastJNI.dtCrowdAgentParams_obstacleAvoidanceType_get(swigCPtr, this); 113 | } 114 | 115 | public void setQueryFilterType(short value) { 116 | RecastJNI.dtCrowdAgentParams_queryFilterType_set(swigCPtr, this, value); 117 | } 118 | 119 | public short getQueryFilterType() { 120 | return RecastJNI.dtCrowdAgentParams_queryFilterType_get(swigCPtr, this); 121 | } 122 | 123 | public void setUserData(SWIGTYPE_p_void value) { 124 | RecastJNI.dtCrowdAgentParams_userData_set(swigCPtr, this, SWIGTYPE_p_void.getCPtr(value)); 125 | } 126 | 127 | public SWIGTYPE_p_void getUserData() { 128 | long cPtr = RecastJNI.dtCrowdAgentParams_userData_get(swigCPtr, this); 129 | return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false); 130 | } 131 | 132 | public dtCrowdAgentParams() { 133 | this(RecastJNI.new_dtCrowdAgentParams(), true); 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheObstacle.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_int; 7 | import com.jme3.math.Vector3f; 8 | 9 | /** 10 | * 11 | * @author Tihomir Radosavljevic 12 | * @version 0.5 13 | */ 14 | public class TileCacheObstacle { 15 | 16 | private long swigCPtr; 17 | protected boolean swigCMemOwn; 18 | 19 | public TileCacheObstacle() { 20 | this(RecastJNI.new_dtTileCacheObstacle(), true); 21 | } 22 | 23 | public TileCacheObstacle(long cPtr, boolean cMemoryOwn) { 24 | swigCMemOwn = cMemoryOwn; 25 | swigCPtr = cPtr; 26 | } 27 | 28 | public static long getCPtr(TileCacheObstacle obj) { 29 | return (obj == null) ? 0 : obj.swigCPtr; 30 | } 31 | 32 | @Override 33 | protected void finalize() { 34 | delete(); 35 | } 36 | 37 | public synchronized void delete() { 38 | if (swigCPtr != 0) { 39 | if (swigCMemOwn) { 40 | swigCMemOwn = false; 41 | RecastJNI.delete_dtTileCacheObstacle(swigCPtr); 42 | } 43 | swigCPtr = 0; 44 | } 45 | } 46 | 47 | public void setPosition(Vector3f position) { 48 | SWIGTYPE_p_float value = Converter.convertToSWIGTYPE_p_float(position); 49 | RecastJNI.dtTileCacheObstacle_pos_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 50 | } 51 | 52 | public Vector3f getPosition() { 53 | long cPtr = RecastJNI.dtTileCacheObstacle_pos_get(swigCPtr, this); 54 | if (cPtr == 0) { 55 | return null; 56 | } 57 | return Converter.convertToVector3f(cPtr); 58 | } 59 | 60 | public void setRadius(float value) { 61 | RecastJNI.dtTileCacheObstacle_radius_set(swigCPtr, this, value); 62 | } 63 | 64 | public float getRadius() { 65 | return RecastJNI.dtTileCacheObstacle_radius_get(swigCPtr, this); 66 | } 67 | 68 | public void setHeight(float value) { 69 | RecastJNI.dtTileCacheObstacle_height_set(swigCPtr, this, value); 70 | } 71 | 72 | public float getHeight() { 73 | return RecastJNI.dtTileCacheObstacle_height_get(swigCPtr, this); 74 | } 75 | 76 | public void setTouched(int[] touched) { 77 | SWIGTYPE_p_unsigned_int value = Converter.convertToSWIGTYPE_p_unsigned_int(touched); 78 | RecastJNI.dtTileCacheObstacle_touched_set(swigCPtr, this, SWIGTYPE_p_unsigned_int.getCPtr(value)); 79 | } 80 | 81 | public int[] getTouched() { 82 | long cPtr = RecastJNI.dtTileCacheObstacle_touched_get(swigCPtr, this); 83 | if (cPtr == 0) return null; 84 | return Converter.convertToInts(cPtr, getNumberOfTouched()); 85 | } 86 | 87 | public void setPending(int[] pending) { 88 | SWIGTYPE_p_unsigned_int value = Converter.convertToSWIGTYPE_p_unsigned_int(pending); 89 | RecastJNI.dtTileCacheObstacle_pending_set(swigCPtr, this, SWIGTYPE_p_unsigned_int.getCPtr(value)); 90 | } 91 | 92 | public int[] getPending() { 93 | long cPtr = RecastJNI.dtTileCacheObstacle_pending_get(swigCPtr, this); 94 | if (cPtr == 0) return null; 95 | return Converter.convertToInts(cPtr, getNumberOfPending()); 96 | } 97 | 98 | public void setSalt(int value) { 99 | RecastJNI.dtTileCacheObstacle_salt_set(swigCPtr, this, value); 100 | } 101 | 102 | public int getSalt() { 103 | return RecastJNI.dtTileCacheObstacle_salt_get(swigCPtr, this); 104 | } 105 | 106 | public void setState(short value) { 107 | RecastJNI.dtTileCacheObstacle_state_set(swigCPtr, this, value); 108 | } 109 | 110 | public short getState() { 111 | return RecastJNI.dtTileCacheObstacle_state_get(swigCPtr, this); 112 | } 113 | 114 | public void setNumberOfTouched(short value) { 115 | RecastJNI.dtTileCacheObstacle_ntouched_set(swigCPtr, this, value); 116 | } 117 | 118 | public short getNumberOfTouched() { 119 | return RecastJNI.dtTileCacheObstacle_ntouched_get(swigCPtr, this); 120 | } 121 | 122 | public void setNumberOfPending(short value) { 123 | RecastJNI.dtTileCacheObstacle_npending_set(swigCPtr, this, value); 124 | } 125 | 126 | public short getNumberOfPending() { 127 | return RecastJNI.dtTileCacheObstacle_npending_get(swigCPtr, this); 128 | } 129 | 130 | public void setNext(TileCacheObstacle value) { 131 | RecastJNI.dtTileCacheObstacle_next_set(swigCPtr, this, TileCacheObstacle.getCPtr(value), value); 132 | } 133 | 134 | public TileCacheObstacle getNext() { 135 | long cPtr = RecastJNI.dtTileCacheObstacle_next_get(swigCPtr, this); 136 | return (cPtr == 0) ? null : new TileCacheObstacle(cPtr, false); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtObstacleAvoidanceQuery.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | 6 | /* ---------------------------------------------------------------------------- 7 | * This file was automatically generated by SWIG (http://www.swig.org). 8 | * Version 2.0.4 9 | * 10 | * Do not make changes to this file unless you know what you are doing--modify 11 | * the SWIG interface file instead. 12 | * ----------------------------------------------------------------------------- */ 13 | public class dtObstacleAvoidanceQuery { 14 | 15 | private long swigCPtr; 16 | protected boolean swigCMemOwn; 17 | 18 | public dtObstacleAvoidanceQuery() { 19 | swigCPtr = RecastJNI.dtAllocObstacleAvoidanceQuery(); 20 | swigCMemOwn = (swigCPtr == 0) ? false : true; 21 | } 22 | 23 | public dtObstacleAvoidanceQuery(long cPtr, boolean cMemoryOwn) { 24 | swigCMemOwn = cMemoryOwn; 25 | swigCPtr = cPtr; 26 | } 27 | 28 | public static long getCPtr(dtObstacleAvoidanceQuery obj) { 29 | return (obj == null) ? 0 : obj.swigCPtr; 30 | } 31 | 32 | protected void finalize() { 33 | delete(); 34 | } 35 | 36 | public synchronized void delete() { 37 | if (swigCPtr != 0) { 38 | if (swigCMemOwn) { 39 | swigCMemOwn = false; 40 | RecastJNI.dtFreeObstacleAvoidanceQuery(swigCPtr, this); 41 | } 42 | swigCPtr = 0; 43 | } 44 | } 45 | 46 | public boolean init(int maxCircles, int maxSegments) { 47 | return RecastJNI.dtObstacleAvoidanceQuery_init(swigCPtr, this, maxCircles, maxSegments); 48 | } 49 | 50 | public void reset() { 51 | RecastJNI.dtObstacleAvoidanceQuery_reset(swigCPtr, this); 52 | } 53 | 54 | public void addCircle(SWIGTYPE_p_float pos, float rad, SWIGTYPE_p_float vel, SWIGTYPE_p_float dvel) { 55 | RecastJNI.dtObstacleAvoidanceQuery_addCircle(swigCPtr, this, SWIGTYPE_p_float.getCPtr(pos), rad, SWIGTYPE_p_float.getCPtr(vel), SWIGTYPE_p_float.getCPtr(dvel)); 56 | } 57 | 58 | public void addSegment(SWIGTYPE_p_float p, SWIGTYPE_p_float q) { 59 | RecastJNI.dtObstacleAvoidanceQuery_addSegment(swigCPtr, this, SWIGTYPE_p_float.getCPtr(p), SWIGTYPE_p_float.getCPtr(q)); 60 | } 61 | 62 | public int sampleVelocityGrid(SWIGTYPE_p_float pos, float rad, float vmax, SWIGTYPE_p_float vel, SWIGTYPE_p_float dvel, SWIGTYPE_p_float nvel, dtObstacleAvoidanceParams params, dtObstacleAvoidanceDebugData debug) { 63 | return RecastJNI.dtObstacleAvoidanceQuery_sampleVelocityGrid__SWIG_0(swigCPtr, this, SWIGTYPE_p_float.getCPtr(pos), rad, vmax, SWIGTYPE_p_float.getCPtr(vel), SWIGTYPE_p_float.getCPtr(dvel), SWIGTYPE_p_float.getCPtr(nvel), dtObstacleAvoidanceParams.getCPtr(params), params, dtObstacleAvoidanceDebugData.getCPtr(debug), debug); 64 | } 65 | 66 | public int sampleVelocityGrid(SWIGTYPE_p_float pos, float rad, float vmax, SWIGTYPE_p_float vel, SWIGTYPE_p_float dvel, SWIGTYPE_p_float nvel, dtObstacleAvoidanceParams params) { 67 | return RecastJNI.dtObstacleAvoidanceQuery_sampleVelocityGrid__SWIG_1(swigCPtr, this, SWIGTYPE_p_float.getCPtr(pos), rad, vmax, SWIGTYPE_p_float.getCPtr(vel), SWIGTYPE_p_float.getCPtr(dvel), SWIGTYPE_p_float.getCPtr(nvel), dtObstacleAvoidanceParams.getCPtr(params), params); 68 | } 69 | 70 | public int sampleVelocityAdaptive(SWIGTYPE_p_float pos, float rad, float vmax, SWIGTYPE_p_float vel, SWIGTYPE_p_float dvel, SWIGTYPE_p_float nvel, dtObstacleAvoidanceParams params, dtObstacleAvoidanceDebugData debug) { 71 | return RecastJNI.dtObstacleAvoidanceQuery_sampleVelocityAdaptive__SWIG_0(swigCPtr, this, SWIGTYPE_p_float.getCPtr(pos), rad, vmax, SWIGTYPE_p_float.getCPtr(vel), SWIGTYPE_p_float.getCPtr(dvel), SWIGTYPE_p_float.getCPtr(nvel), dtObstacleAvoidanceParams.getCPtr(params), params, dtObstacleAvoidanceDebugData.getCPtr(debug), debug); 72 | } 73 | 74 | public int sampleVelocityAdaptive(SWIGTYPE_p_float pos, float rad, float vmax, SWIGTYPE_p_float vel, SWIGTYPE_p_float dvel, SWIGTYPE_p_float nvel, dtObstacleAvoidanceParams params) { 75 | return RecastJNI.dtObstacleAvoidanceQuery_sampleVelocityAdaptive__SWIG_1(swigCPtr, this, SWIGTYPE_p_float.getCPtr(pos), rad, vmax, SWIGTYPE_p_float.getCPtr(vel), SWIGTYPE_p_float.getCPtr(dvel), SWIGTYPE_p_float.getCPtr(nvel), dtObstacleAvoidanceParams.getCPtr(params), params); 76 | } 77 | 78 | public int getObstacleCircleCount() { 79 | return RecastJNI.dtObstacleAvoidanceQuery_getObstacleCircleCount(swigCPtr, this); 80 | } 81 | 82 | public dtObstacleCircle getObstacleCircle(int i) { 83 | long cPtr = RecastJNI.dtObstacleAvoidanceQuery_getObstacleCircle(swigCPtr, this, i); 84 | return (cPtr == 0) ? null : new dtObstacleCircle(cPtr, false); 85 | } 86 | 87 | public int getObstacleSegmentCount() { 88 | return RecastJNI.dtObstacleAvoidanceQuery_getObstacleSegmentCount(swigCPtr, this); 89 | } 90 | 91 | public dtObstacleSegment getObstacleSegment(int i) { 92 | long cPtr = RecastJNI.dtObstacleAvoidanceQuery_getObstacleSegment(swigCPtr, this, i); 93 | return (cPtr == 0) ? null : new dtObstacleSegment(cPtr, false); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCachePolyMesh.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_char; 6 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_short; 7 | 8 | /** 9 | * 10 | * @author Tihomir Radosavljevic 11 | * @version 1.0 12 | */ 13 | public class TileCachePolyMesh { 14 | 15 | private long swigCPtr; 16 | protected boolean swigCMemOwn; 17 | 18 | public TileCachePolyMesh() { 19 | this(RecastJNI.new_dtTileCachePolyMesh(), true); 20 | } 21 | 22 | public TileCachePolyMesh(long cPtr, boolean cMemoryOwn) { 23 | swigCMemOwn = cMemoryOwn; 24 | swigCPtr = cPtr; 25 | } 26 | 27 | public static long getCPtr(TileCachePolyMesh obj) { 28 | return (obj == null) ? 0 : obj.swigCPtr; 29 | } 30 | 31 | @Override 32 | protected void finalize() { 33 | delete(); 34 | } 35 | 36 | public synchronized void delete() { 37 | if (swigCPtr != 0) { 38 | if (swigCMemOwn) { 39 | swigCMemOwn = false; 40 | RecastJNI.delete_dtTileCachePolyMesh(swigCPtr); 41 | } 42 | swigCPtr = 0; 43 | } 44 | } 45 | 46 | public void setNumberOfVerticesPerPolygons(int value) { 47 | RecastJNI.dtTileCachePolyMesh_nvp_set(swigCPtr, this, value); 48 | } 49 | 50 | public int getNumberOfVerticesPerPolygons() { 51 | return RecastJNI.dtTileCachePolyMesh_nvp_get(swigCPtr, this); 52 | } 53 | 54 | /** 55 | * 56 | * @param value Number of vertices. 57 | */ 58 | public void setNumberOfVertices(int value) { 59 | RecastJNI.dtTileCachePolyMesh_nverts_set(swigCPtr, this, value); 60 | } 61 | 62 | /** 63 | * 64 | * @return Number of vertices. 65 | */ 66 | public int getNumberOfVertices() { 67 | return RecastJNI.dtTileCachePolyMesh_nverts_get(swigCPtr, this); 68 | } 69 | 70 | /** 71 | * 72 | * @param value Number of polygons. 73 | */ 74 | public void setNumberOfPolygons(int value) { 75 | RecastJNI.dtTileCachePolyMesh_npolys_set(swigCPtr, this, value); 76 | } 77 | 78 | /** 79 | * 80 | * @return Number of polygons. 81 | */ 82 | public int getNumberOfPolygons() { 83 | return RecastJNI.dtTileCachePolyMesh_npolys_get(swigCPtr, this); 84 | } 85 | 86 | /** 87 | * 88 | * @param vertices Vertices of the mesh, 3 elements per vertex. 89 | */ 90 | public void setVertices(short[] vertices) { 91 | SWIGTYPE_p_unsigned_short value = Converter.convertToSWIGTYPE_p_unsigned_short(vertices); 92 | RecastJNI.dtTileCachePolyMesh_verts_set(swigCPtr, this, SWIGTYPE_p_unsigned_short.getCPtr(value)); 93 | } 94 | 95 | /** 96 | * 97 | * @return Vertices of the mesh, 3 elements per vertex. 98 | */ 99 | public short[] getVertices() { 100 | long cPtr = RecastJNI.dtTileCachePolyMesh_verts_get(swigCPtr, this); 101 | if (cPtr == 0) { 102 | return null; 103 | } 104 | return Converter.convertToShorts(cPtr, getNumberOfVertices()); 105 | } 106 | 107 | /** 108 | * 109 | * @param polygons Polygons of the mesh, nvp*2 elements per polygon. 110 | */ 111 | public void setPolygons(short[] polygons) { 112 | SWIGTYPE_p_unsigned_short value = Converter.convertToSWIGTYPE_p_unsigned_short(polygons); 113 | RecastJNI.dtTileCachePolyMesh_polys_set(swigCPtr, this, SWIGTYPE_p_unsigned_short.getCPtr(value)); 114 | } 115 | 116 | /** 117 | * 118 | * @return Polygons of the mesh, nvp*2 elements per polygon. 119 | */ 120 | public short[] getPolygons() { 121 | long cPtr = RecastJNI.dtTileCachePolyMesh_polys_get(swigCPtr, this); 122 | return (cPtr == 0) ? null : Converter.convertToShorts(cPtr, getNumberOfPolygons()); 123 | } 124 | 125 | /** 126 | * 127 | * @param flags Per polygon flags. 128 | */ 129 | public void setFlags(short[] flags) { 130 | SWIGTYPE_p_unsigned_short value = Converter.convertToSWIGTYPE_p_unsigned_short(flags); 131 | RecastJNI.dtTileCachePolyMesh_flags_set(swigCPtr, this, SWIGTYPE_p_unsigned_short.getCPtr(value)); 132 | } 133 | 134 | /** 135 | * 136 | * @return Per polygon flags. 137 | */ 138 | public short[] getFlags() { 139 | long cPtr = RecastJNI.dtTileCachePolyMesh_flags_get(swigCPtr, this); 140 | //check count 141 | return (cPtr == 0) ? null : Converter.convertToShorts(cPtr, getNumberOfPolygons()); 142 | } 143 | 144 | /** 145 | * 146 | * @param areas Area ID of polygons. 147 | */ 148 | public void setAreas(char[] areas) { 149 | SWIGTYPE_p_unsigned_char value = Converter.convertToSWIGTYPE_p_unsigned_char(areas); 150 | RecastJNI.dtTileCachePolyMesh_areas_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value)); 151 | } 152 | 153 | /** 154 | * 155 | * @return Area ID of polygons. 156 | */ 157 | public char[] getAreas() { 158 | long cPtr = RecastJNI.dtTileCachePolyMesh_areas_get(swigCPtr, this); 159 | return (cPtr == 0) ? null : Converter.convertToChars(cPtr, getNumberOfPolygons()); 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/OffMeshConnection.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | import com.jme3.math.Vector3f; 7 | 8 | /** 9 | * Defines an navigation mesh off-mesh connection within a MeshTile object. 10 | * 11 | * An off-mesh connection is a user defined traversable connection made up to 12 | * two vertices. 13 | * 14 | * @see MeshTile 15 | * @author Tihomir Radosavljevic 16 | * @version 1.0 17 | */ 18 | public class OffMeshConnection { 19 | 20 | private long swigCPtr; 21 | protected boolean swigCMemOwn; 22 | 23 | public OffMeshConnection() { 24 | this(RecastJNI.new_dtOffMeshConnection(), true); 25 | } 26 | 27 | public OffMeshConnection(long cPtr, boolean cMemoryOwn) { 28 | swigCMemOwn = cMemoryOwn; 29 | swigCPtr = cPtr; 30 | } 31 | 32 | public static long getCPtr(OffMeshConnection obj) { 33 | return (obj == null) ? 0 : obj.swigCPtr; 34 | } 35 | 36 | @Override 37 | protected void finalize() { 38 | delete(); 39 | } 40 | 41 | public synchronized void delete() { 42 | if (swigCPtr != 0) { 43 | if (swigCMemOwn) { 44 | swigCMemOwn = false; 45 | RecastJNI.delete_dtOffMeshConnection(swigCPtr); 46 | } 47 | swigCPtr = 0; 48 | } 49 | } 50 | 51 | /** 52 | * For a properly built navigation mesh, vertex A will always be within the 53 | * bounds of the mesh. Vertex B is not required to be within the bounds of 54 | * the mesh. 55 | * 56 | * @param position The endpoints of the connection. [(ax, ay, az, bx, by, 57 | * bz)]. 58 | */ 59 | public void setPosition(Vector3f[] position) { 60 | if (position.length != 2) { 61 | throw new RuntimeException("length of position must be 2"); 62 | } 63 | SWIGTYPE_p_float value = Converter.convertToSWIGTYPE_p_float(position); 64 | RecastJNI.dtOffMeshConnection_pos_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 65 | } 66 | 67 | /** 68 | * For a properly built navigation mesh, vertex A will always be within the 69 | * bounds of the mesh. Vertex B is not required to be within the bounds of 70 | * the mesh. 71 | * 72 | * @return The endpoints of the connection. [(ax, ay, az, bx, by, bz)]. 73 | */ 74 | public Vector3f[] getPosition() { 75 | long cPtr = RecastJNI.dtOffMeshConnection_pos_get(swigCPtr, this); 76 | return (cPtr == 0) ? null : Converter.convertToVector3f(cPtr, 2); 77 | } 78 | 79 | /** 80 | * 81 | * @param value The radius of the endpoints. [Limit: >= 0]. 82 | */ 83 | public void setRadius(float value) { 84 | RecastJNI.dtOffMeshConnection_rad_set(swigCPtr, this, value); 85 | } 86 | 87 | /** 88 | * 89 | * @return The radius of the endpoints. [Limit: >= 0]. 90 | */ 91 | public float getRadius() { 92 | return RecastJNI.dtOffMeshConnection_rad_get(swigCPtr, this); 93 | } 94 | 95 | /** 96 | * 97 | * @param value The polygon reference of the connection within the tile. 98 | */ 99 | public void setPolygon(int value) { 100 | RecastJNI.dtOffMeshConnection_poly_set(swigCPtr, this, value); 101 | } 102 | 103 | /** 104 | * 105 | * @return The polygon reference of the connection within the tile. 106 | */ 107 | public int getPolygon() { 108 | return RecastJNI.dtOffMeshConnection_poly_get(swigCPtr, this); 109 | } 110 | 111 | /** 112 | * These are not the connection's user defined flags. Those are assigned via 113 | * the connection's Poly definition. These are link flags used for internal 114 | * purposes. 115 | * 116 | * @see Poly 117 | * @param value Link flags. 118 | */ 119 | public void setFlags(short value) { 120 | RecastJNI.dtOffMeshConnection_flags_set(swigCPtr, this, value); 121 | } 122 | 123 | /** 124 | * These are not the connection's user defined flags. Those are assigned via 125 | * the connection's Poly definition. These are link flags used for internal 126 | * purposes. 127 | * 128 | * @see Poly 129 | * @return Link flags. 130 | */ 131 | public short getFlags() { 132 | return RecastJNI.dtOffMeshConnection_flags_get(swigCPtr, this); 133 | } 134 | 135 | /** 136 | * 137 | * @param value End point side. 138 | */ 139 | public void setSide(short value) { 140 | RecastJNI.dtOffMeshConnection_side_set(swigCPtr, this, value); 141 | } 142 | 143 | /** 144 | * 145 | * @return End point side. 146 | */ 147 | public short getSide() { 148 | return RecastJNI.dtOffMeshConnection_side_get(swigCPtr, this); 149 | } 150 | 151 | /** 152 | * 153 | * @param value The id of the offmesh connection. (User assigned when the 154 | * navigation mesh is built.) 155 | */ 156 | public void setUserId(long value) { 157 | RecastJNI.dtOffMeshConnection_userId_set(swigCPtr, this, value); 158 | } 159 | 160 | /** 161 | * 162 | * @return The id of the offmesh connection. (User assigned when the 163 | * navigation mesh is built.) 164 | */ 165 | public long getUserId() { 166 | return RecastJNI.dtOffMeshConnection_userId_get(swigCPtr, this); 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/tilecache/TileCacheLayerHeader.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.tilecache; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | import com.jme3.math.Vector3f; 7 | 8 | /** 9 | * 10 | * @author Tihomir Radosavljevic 11 | * @version 0.5 12 | */ 13 | public class TileCacheLayerHeader { 14 | 15 | private long swigCPtr; 16 | protected boolean swigCMemOwn; 17 | 18 | public TileCacheLayerHeader() { 19 | this(RecastJNI.new_dtTileCacheLayerHeader(), true); 20 | } 21 | 22 | public TileCacheLayerHeader(long cPtr, boolean cMemoryOwn) { 23 | swigCMemOwn = cMemoryOwn; 24 | swigCPtr = cPtr; 25 | } 26 | 27 | public static long getCPtr(TileCacheLayerHeader obj) { 28 | return (obj == null) ? 0 : obj.swigCPtr; 29 | } 30 | 31 | @Override 32 | protected void finalize() { 33 | delete(); 34 | } 35 | 36 | public synchronized void delete() { 37 | if (swigCPtr != 0) { 38 | if (swigCMemOwn) { 39 | swigCMemOwn = false; 40 | RecastJNI.delete_dtTileCacheLayerHeader(swigCPtr); 41 | } 42 | swigCPtr = 0; 43 | } 44 | } 45 | 46 | public void setMagic(int value) { 47 | RecastJNI.dtTileCacheLayerHeader_magic_set(swigCPtr, this, value); 48 | } 49 | 50 | public int getMagic() { 51 | return RecastJNI.dtTileCacheLayerHeader_magic_get(swigCPtr, this); 52 | } 53 | 54 | public void setVersion(int value) { 55 | RecastJNI.dtTileCacheLayerHeader_version_set(swigCPtr, this, value); 56 | } 57 | 58 | public int getVersion() { 59 | return RecastJNI.dtTileCacheLayerHeader_version_get(swigCPtr, this); 60 | } 61 | 62 | public void setTX(int value) { 63 | RecastJNI.dtTileCacheLayerHeader_tx_set(swigCPtr, this, value); 64 | } 65 | 66 | public int getTX() { 67 | return RecastJNI.dtTileCacheLayerHeader_tx_get(swigCPtr, this); 68 | } 69 | 70 | public void setTY(int value) { 71 | RecastJNI.dtTileCacheLayerHeader_ty_set(swigCPtr, this, value); 72 | } 73 | 74 | public int getTY() { 75 | return RecastJNI.dtTileCacheLayerHeader_ty_get(swigCPtr, this); 76 | } 77 | 78 | public void setTLayer(int value) { 79 | RecastJNI.dtTileCacheLayerHeader_tlayer_set(swigCPtr, this, value); 80 | } 81 | 82 | public int getTLayer() { 83 | return RecastJNI.dtTileCacheLayerHeader_tlayer_get(swigCPtr, this); 84 | } 85 | 86 | public void setMinBounds(Vector3f minBounds) { 87 | SWIGTYPE_p_float value = Converter.convertToSWIGTYPE_p_float(minBounds); 88 | RecastJNI.dtTileCacheLayerHeader_bmin_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 89 | } 90 | 91 | public Vector3f getMinBounds() { 92 | long cPtr = RecastJNI.dtTileCacheLayerHeader_bmin_get(swigCPtr, this); 93 | if (cPtr == 0) { 94 | return null; 95 | } 96 | return Converter.convertToVector3f(cPtr); 97 | } 98 | 99 | public void setMaxBounds(Vector3f maxBounds) { 100 | SWIGTYPE_p_float value = Converter.convertToSWIGTYPE_p_float(maxBounds); 101 | RecastJNI.dtTileCacheLayerHeader_bmax_set(swigCPtr, this, SWIGTYPE_p_float.getCPtr(value)); 102 | 103 | } 104 | 105 | public Vector3f getMaxBounds() { 106 | long cPtr = RecastJNI.dtTileCacheLayerHeader_bmax_get(swigCPtr, this); 107 | if (cPtr == 0) { 108 | return null; 109 | } 110 | return Converter.convertToVector3f(cPtr); 111 | } 112 | 113 | public void setMinHeight(int value) { 114 | RecastJNI.dtTileCacheLayerHeader_hmin_set(swigCPtr, this, value); 115 | } 116 | 117 | public int getMinHeight() { 118 | return RecastJNI.dtTileCacheLayerHeader_hmin_get(swigCPtr, this); 119 | } 120 | 121 | public void setMaxHeight(int value) { 122 | RecastJNI.dtTileCacheLayerHeader_hmax_set(swigCPtr, this, value); 123 | } 124 | 125 | public int getMaxHeight() { 126 | return RecastJNI.dtTileCacheLayerHeader_hmax_get(swigCPtr, this); 127 | } 128 | 129 | public void setWidth(short value) { 130 | RecastJNI.dtTileCacheLayerHeader_width_set(swigCPtr, this, value); 131 | } 132 | 133 | public short getWidth() { 134 | return RecastJNI.dtTileCacheLayerHeader_width_get(swigCPtr, this); 135 | } 136 | 137 | public void setHeight(short value) { 138 | RecastJNI.dtTileCacheLayerHeader_height_set(swigCPtr, this, value); 139 | } 140 | 141 | public short getHeight() { 142 | return RecastJNI.dtTileCacheLayerHeader_height_get(swigCPtr, this); 143 | } 144 | 145 | public void setMinX(short value) { 146 | RecastJNI.dtTileCacheLayerHeader_minx_set(swigCPtr, this, value); 147 | } 148 | 149 | public short getMinX() { 150 | return RecastJNI.dtTileCacheLayerHeader_minx_get(swigCPtr, this); 151 | } 152 | 153 | public void setMaxX(short value) { 154 | RecastJNI.dtTileCacheLayerHeader_maxx_set(swigCPtr, this, value); 155 | } 156 | 157 | public short getMaxX() { 158 | return RecastJNI.dtTileCacheLayerHeader_maxx_get(swigCPtr, this); 159 | } 160 | 161 | public void setMinY(short value) { 162 | RecastJNI.dtTileCacheLayerHeader_miny_set(swigCPtr, this, value); 163 | } 164 | 165 | public short getMinY() { 166 | return RecastJNI.dtTileCacheLayerHeader_miny_get(swigCPtr, this); 167 | } 168 | 169 | public void setMaxY(short value) { 170 | RecastJNI.dtTileCacheLayerHeader_maxy_set(swigCPtr, this, value); 171 | } 172 | 173 | public short getMaxY() { 174 | return RecastJNI.dtTileCacheLayerHeader_maxy_get(swigCPtr, this); 175 | } 176 | } -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/QueryFilter.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 5 | import com.jme3.ai.navigation.utils.RecastJNI; 6 | import com.jme3.math.Vector3f; 7 | 8 | /** 9 | * Defines polygon filtering and traversal costs for navigation mesh query 10 | * operations. 11 | * 12 | * The Default Implementation 13 | * 14 | * At construction: All area costs default to 1.0. All flags are included and 15 | * none are excluded. 16 | * 17 | * If a polygon has both an include and an exclude flag, it will be excluded. 18 | * 19 | * The way filtering works, a navigation mesh polygon must have at least one 20 | * flag set to ever be considered by a query. So a polygon with no flags will 21 | * never be considered. 22 | * 23 | * Setting the include flags to 0 will result in all polygons being excluded. 24 | * 25 | * @author Tihomir Radosavljevic 26 | * @version 1.0 27 | */ 28 | public class QueryFilter { 29 | 30 | private long swigCPtr; 31 | protected boolean swigCMemOwn; 32 | 33 | public QueryFilter() { 34 | this(RecastJNI.new_dtQueryFilter(), true); 35 | } 36 | 37 | public QueryFilter(long cPtr, boolean cMemoryOwn) { 38 | swigCMemOwn = cMemoryOwn; 39 | swigCPtr = cPtr; 40 | } 41 | 42 | public static long getCPtr(QueryFilter obj) { 43 | return (obj == null) ? 0 : obj.swigCPtr; 44 | } 45 | 46 | @Override 47 | protected void finalize() { 48 | delete(); 49 | } 50 | 51 | public synchronized void delete() { 52 | if (swigCPtr != 0) { 53 | if (swigCMemOwn) { 54 | swigCMemOwn = false; 55 | RecastJNI.delete_dtQueryFilter(swigCPtr); 56 | } 57 | swigCPtr = 0; 58 | } 59 | } 60 | 61 | /** 62 | * Returns true if the polygon can be visited. (I.e. Is traversable.) 63 | * 64 | * @param ref The reference id of the polygon test. 65 | * @param tile The tile containing the polygon. 66 | * @param poly The polygon to test. 67 | * @return 68 | */ 69 | public boolean passFilter(long ref, MeshTile tile, Poly poly) { 70 | return RecastJNI.dtQueryFilter_passFilter(swigCPtr, this, ref, MeshTile.getCPtr(tile), tile, Poly.getCPtr(poly), poly); 71 | } 72 | 73 | /** 74 | * 75 | * @param startPosition The start position on the edge of the previous and 76 | * current polygon. 77 | * @param endPosition The end position on the edge of the current and next 78 | * polygon. 79 | * @param prevRef The reference id of the previous polygon. [opt] 80 | * @param prevTile The tile containing the previous polygon. [opt] 81 | * @param prevPoly The previous polygon. [opt] 82 | * @param curRef The reference id of the current polygon. 83 | * @param curTile The tile containing the current polygon. 84 | * @param curPoly The current polygon. 85 | * @param nextRef The refernece id of the next polygon. [opt] 86 | * @param nextTile The tile containing the next polygon. [opt] 87 | * @param nextPoly The next polygon. [opt] 88 | * @return 89 | */ 90 | public float getCost(Vector3f startPosition, Vector3f endPosition, long prevRef, MeshTile prevTile, Poly prevPoly, long curRef, MeshTile curTile, Poly curPoly, long nextRef, MeshTile nextTile, Poly nextPoly) { 91 | SWIGTYPE_p_float pa = Converter.convertToSWIGTYPE_p_float(startPosition); 92 | SWIGTYPE_p_float pb = Converter.convertToSWIGTYPE_p_float(endPosition); 93 | return RecastJNI.dtQueryFilter_getCost(swigCPtr, this, SWIGTYPE_p_float.getCPtr(pa), SWIGTYPE_p_float.getCPtr(pb), prevRef, MeshTile.getCPtr(prevTile), prevTile, Poly.getCPtr(prevPoly), prevPoly, curRef, MeshTile.getCPtr(curTile), curTile, Poly.getCPtr(curPoly), curPoly, nextRef, MeshTile.getCPtr(nextTile), nextTile, Poly.getCPtr(nextPoly), nextPoly); 94 | } 95 | 96 | /** 97 | * Returns the traversal cost of the area. 98 | * 99 | * @param i The id of the area. 100 | * @return The traversal cost of the area. 101 | */ 102 | public float getAreaCost(int i) { 103 | return RecastJNI.dtQueryFilter_getAreaCost(swigCPtr, this, i); 104 | } 105 | 106 | /** 107 | * Sets the traversal cost of the area. 108 | * 109 | * @param i The id of the area. 110 | * @param cost The new cost of traversing the area. 111 | */ 112 | public void setAreaCost(int i, float cost) { 113 | RecastJNI.dtQueryFilter_setAreaCost(swigCPtr, this, i, cost); 114 | } 115 | 116 | /** 117 | * Any polygons that include one or more of these flags will be included in 118 | * the operation. 119 | * 120 | * @return Returns the include flags for the filter. 121 | */ 122 | public int getIncludeFlags() { 123 | return RecastJNI.dtQueryFilter_getIncludeFlags(swigCPtr, this); 124 | } 125 | 126 | /** 127 | * Sets the include flags for the filter. 128 | * 129 | * @param flags The new flags. 130 | */ 131 | public void setIncludeFlags(int flags) { 132 | RecastJNI.dtQueryFilter_setIncludeFlags(swigCPtr, this, flags); 133 | } 134 | 135 | /** 136 | * Any polygons that include one ore more of these flags will be excluded 137 | * from the operation. 138 | * 139 | * @return Returns the exclude flags for the filter. 140 | */ 141 | public int getExcludeFlags() { 142 | return RecastJNI.dtQueryFilter_getExcludeFlags(swigCPtr, this); 143 | } 144 | 145 | /** 146 | * Sets the exclude flags for the filter. 147 | * 148 | * @param flags The new flags. 149 | */ 150 | public void setExcludeFlags(int flags) { 151 | RecastJNI.dtQueryFilter_setExcludeFlags(swigCPtr, this, flags); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/crowd/dtCrowd.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.crowd; 2 | 3 | import com.jme3.ai.navigation.detour.QueryFilter; 4 | import com.jme3.ai.navigation.detour.NavMeshQuery; 5 | import com.jme3.ai.navigation.detour.NavMesh; 6 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_p_dtCrowdAgent; 7 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_float; 8 | import com.jme3.ai.navigation.utils.RecastJNI; 9 | 10 | /* ---------------------------------------------------------------------------- 11 | * This file was automatically generated by SWIG (http://www.swig.org). 12 | * Version 2.0.4 13 | * 14 | * Do not make changes to this file unless you know what you are doing--modify 15 | * the SWIG interface file instead. 16 | * ----------------------------------------------------------------------------- */ 17 | public class dtCrowd { 18 | 19 | private long swigCPtr; 20 | protected boolean swigCMemOwn; 21 | 22 | public dtCrowd() { 23 | swigCPtr = RecastJNI.dtAllocCrowd(); 24 | swigCMemOwn = (swigCPtr == 0) ? false : true; 25 | } 26 | 27 | public dtCrowd(long cPtr, boolean cMemoryOwn) { 28 | swigCMemOwn = cMemoryOwn; 29 | swigCPtr = cPtr; 30 | } 31 | 32 | public static long getCPtr(dtCrowd obj) { 33 | return (obj == null) ? 0 : obj.swigCPtr; 34 | } 35 | 36 | protected void finalize() { 37 | delete(); 38 | } 39 | 40 | public synchronized void delete() { 41 | if (swigCPtr != 0) { 42 | if (swigCMemOwn) { 43 | swigCMemOwn = false; 44 | RecastJNI.dtFreeCrowd(swigCPtr, this); 45 | } 46 | swigCPtr = 0; 47 | } 48 | } 49 | 50 | public boolean init(int maxAgents, float maxAgentRadius, NavMesh nav) { 51 | return RecastJNI.dtCrowd_init(swigCPtr, this, maxAgents, maxAgentRadius, NavMesh.getCPtr(nav), nav); 52 | } 53 | 54 | public void setObstacleAvoidanceParams(int idx, dtObstacleAvoidanceParams params) { 55 | RecastJNI.dtCrowd_setObstacleAvoidanceParams(swigCPtr, this, idx, dtObstacleAvoidanceParams.getCPtr(params), params); 56 | } 57 | 58 | public dtObstacleAvoidanceParams getObstacleAvoidanceParams(int idx) { 59 | long cPtr = RecastJNI.dtCrowd_getObstacleAvoidanceParams(swigCPtr, this, idx); 60 | return (cPtr == 0) ? null : new dtObstacleAvoidanceParams(cPtr, false); 61 | } 62 | 63 | public dtCrowdAgent getAgent(int idx) { 64 | long cPtr = RecastJNI.dtCrowd_getAgent(swigCPtr, this, idx); 65 | return (cPtr == 0) ? null : new dtCrowdAgent(cPtr, false); 66 | } 67 | 68 | public dtCrowdAgent getEditableAgent(int idx) { 69 | long cPtr = RecastJNI.dtCrowd_getEditableAgent(swigCPtr, this, idx); 70 | return (cPtr == 0) ? null : new dtCrowdAgent(cPtr, false); 71 | } 72 | 73 | public int getAgentCount() { 74 | return RecastJNI.dtCrowd_getAgentCount(swigCPtr, this); 75 | } 76 | 77 | public int addAgent(SWIGTYPE_p_float pos, dtCrowdAgentParams params) { 78 | return RecastJNI.dtCrowd_addAgent(swigCPtr, this, SWIGTYPE_p_float.getCPtr(pos), dtCrowdAgentParams.getCPtr(params), params); 79 | } 80 | 81 | public void updateAgentParameters(int idx, dtCrowdAgentParams params) { 82 | RecastJNI.dtCrowd_updateAgentParameters(swigCPtr, this, idx, dtCrowdAgentParams.getCPtr(params), params); 83 | } 84 | 85 | public void removeAgent(int idx) { 86 | RecastJNI.dtCrowd_removeAgent(swigCPtr, this, idx); 87 | } 88 | 89 | public boolean requestMoveTarget(int idx, long ref, SWIGTYPE_p_float pos) { 90 | return RecastJNI.dtCrowd_requestMoveTarget(swigCPtr, this, idx, ref, SWIGTYPE_p_float.getCPtr(pos)); 91 | } 92 | 93 | public boolean requestMoveVelocity(int idx, SWIGTYPE_p_float vel) { 94 | return RecastJNI.dtCrowd_requestMoveVelocity(swigCPtr, this, idx, SWIGTYPE_p_float.getCPtr(vel)); 95 | } 96 | 97 | public boolean resetMoveTarget(int idx) { 98 | return RecastJNI.dtCrowd_resetMoveTarget(swigCPtr, this, idx); 99 | } 100 | 101 | public int getActiveAgents(SWIGTYPE_p_p_dtCrowdAgent agents, int maxAgents) { 102 | return RecastJNI.dtCrowd_getActiveAgents(swigCPtr, this, SWIGTYPE_p_p_dtCrowdAgent.getCPtr(agents), maxAgents); 103 | } 104 | 105 | public void update(float dt, dtCrowdAgentDebugInfo debug) { 106 | RecastJNI.dtCrowd_update(swigCPtr, this, dt, dtCrowdAgentDebugInfo.getCPtr(debug), debug); 107 | } 108 | 109 | public QueryFilter getFilter(int i) { 110 | long cPtr = RecastJNI.dtCrowd_getFilter(swigCPtr, this, i); 111 | return (cPtr == 0) ? null : new QueryFilter(cPtr, false); 112 | } 113 | 114 | public QueryFilter getEditableFilter(int i) { 115 | long cPtr = RecastJNI.dtCrowd_getEditableFilter(swigCPtr, this, i); 116 | return (cPtr == 0) ? null : new QueryFilter(cPtr, false); 117 | } 118 | 119 | public SWIGTYPE_p_float getQueryExtents() { 120 | long cPtr = RecastJNI.dtCrowd_getQueryExtents(swigCPtr, this); 121 | return (cPtr == 0) ? null : new SWIGTYPE_p_float(cPtr, false); 122 | } 123 | 124 | public int getVelocitySampleCount() { 125 | return RecastJNI.dtCrowd_getVelocitySampleCount(swigCPtr, this); 126 | } 127 | 128 | public dtProximityGrid getGrid() { 129 | long cPtr = RecastJNI.dtCrowd_getGrid(swigCPtr, this); 130 | return (cPtr == 0) ? null : new dtProximityGrid(cPtr, false); 131 | } 132 | 133 | public dtPathQueue getPathQueue() { 134 | long cPtr = RecastJNI.dtCrowd_getPathQueue(swigCPtr, this); 135 | return (cPtr == 0) ? null : new dtPathQueue(cPtr, false); 136 | } 137 | 138 | public NavMeshQuery getNavMeshQuery() { 139 | long cPtr = RecastJNI.dtCrowd_getNavMeshQuery(swigCPtr, this); 140 | return (cPtr == 0) ? null : new NavMeshQuery(cPtr, false); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/detour/Poly.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.detour; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_unsigned_short; 6 | 7 | /** 8 | * Defines a polygon within a MeshTile object. 9 | * 10 | * @see MeshTile 11 | * @author Tihomir Radosavljevic 12 | * @version 0.9 13 | */ 14 | public class Poly { 15 | 16 | private long swigCPtr; 17 | protected boolean swigCMemOwn; 18 | 19 | public Poly() { 20 | this(RecastJNI.new_dtPoly(), true); 21 | } 22 | 23 | public Poly(long cPtr, boolean cMemoryOwn) { 24 | swigCMemOwn = cMemoryOwn; 25 | swigCPtr = cPtr; 26 | } 27 | 28 | public static long getCPtr(Poly obj) { 29 | return (obj == null) ? 0 : obj.swigCPtr; 30 | } 31 | 32 | @Override 33 | protected void finalize() { 34 | delete(); 35 | } 36 | 37 | public synchronized void delete() { 38 | if (swigCPtr != 0) { 39 | if (swigCMemOwn) { 40 | swigCMemOwn = false; 41 | RecastJNI.delete_dtPoly(swigCPtr); 42 | } 43 | swigCPtr = 0; 44 | } 45 | } 46 | 47 | /** 48 | * 49 | * @param value Index to first link in linked list. (Or DT_NULL_LINK if 50 | * there is no link.) 51 | */ 52 | public void setFirstLink(long value) { 53 | RecastJNI.dtPoly_firstLink_set(swigCPtr, this, value); 54 | } 55 | 56 | /** 57 | * 58 | * @return Index to first link in linked list. (Or DT_NULL_LINK if there is 59 | * no link.) 60 | */ 61 | public long getFirstLink() { 62 | return RecastJNI.dtPoly_firstLink_get(swigCPtr, this); 63 | } 64 | 65 | /** 66 | * 67 | * @param vertices The indices of the polygon's vertices. 68 | * @see MeshTile#getVertices() 69 | */ 70 | public void setVertices(short[] vertices) { 71 | SWIGTYPE_p_unsigned_short value = Converter.convertToSWIGTYPE_p_unsigned_short(vertices); 72 | RecastJNI.dtPoly_verts_set(swigCPtr, this, SWIGTYPE_p_unsigned_short.getCPtr(value)); 73 | } 74 | 75 | /** 76 | * 77 | * @return The indices of the polygon's vertices. 78 | * @see MeshTile#getVertices() 79 | */ 80 | public short[] getVertices() { 81 | long cPtr = RecastJNI.dtPoly_verts_get(swigCPtr, this); 82 | return (cPtr == 0) ? null : Converter.convertToShorts(cPtr, getVerticesCount()); 83 | } 84 | 85 | /** 86 | * Note: probably doesn't work as expected 87 | * 88 | * @param neighbours Packed data representing neighbor polygons references 89 | * and flags for each edge. 90 | * 91 | * Each entry represents data for the edge starting at the vertex of the 92 | * same index. E.g. The entry at index n represents the edge data for 93 | * vertex[n] to vertex[n+1]. 94 | * 95 | * A value of zero indicates the edge has no polygon connection. (It makes 96 | * up the border of the navigation mesh.) 97 | */ 98 | public void setNeighbours(short[] neighbours) { 99 | SWIGTYPE_p_unsigned_short value = Converter.convertToSWIGTYPE_p_unsigned_short(neighbours); 100 | RecastJNI.dtPoly_neis_set(swigCPtr, this, SWIGTYPE_p_unsigned_short.getCPtr(value)); 101 | } 102 | 103 | /** 104 | * Note: probably doesn't work as expected 105 | * 106 | * @return Packed data representing neighbor polygons references and flags 107 | * for each edge. 108 | * 109 | * Each entry represents data for the edge starting at the vertex of the 110 | * same index. E.g. The entry at index n represents the edge data for 111 | * vertex[n] to vertex[n+1]. 112 | * 113 | * A value of zero indicates the edge has no polygon connection. (It makes 114 | * up the border of the navigation mesh.) 115 | */ 116 | public short[] getNeighbours() { 117 | long cPtr = RecastJNI.dtPoly_neis_get(swigCPtr, this); 118 | //check count 119 | return (cPtr == 0) ? null : Converter.convertToShorts(cPtr, getVerticesCount()); 120 | } 121 | 122 | /** 123 | * 124 | * @param value The user defined polygon flags. 125 | */ 126 | public void setFlags(int value) { 127 | RecastJNI.dtPoly_flags_set(swigCPtr, this, value); 128 | } 129 | 130 | /** 131 | * 132 | * @return The user defined polygon flags. 133 | */ 134 | public int getFlags() { 135 | return RecastJNI.dtPoly_flags_get(swigCPtr, this); 136 | } 137 | 138 | /** 139 | * 140 | * @param value The number of vertices in the polygon. 141 | */ 142 | public void setVerticesCount(short value) { 143 | RecastJNI.dtPoly_vertCount_set(swigCPtr, this, value); 144 | } 145 | 146 | /** 147 | * 148 | * @return The number of vertices in the polygon. 149 | */ 150 | public short getVerticesCount() { 151 | return RecastJNI.dtPoly_vertCount_get(swigCPtr, this); 152 | } 153 | 154 | /** 155 | * Sets the user defined area id. [Limit: less than DT_MAX_AREAS]. 156 | * 157 | * @param a 158 | */ 159 | public void setArea(short a) { 160 | RecastJNI.dtPoly_setArea(swigCPtr, this, a); 161 | } 162 | 163 | /** 164 | * Sets the polygon type 165 | * 166 | * @param t 167 | * @see PolyTypes 168 | */ 169 | public void setType(short t) { 170 | RecastJNI.dtPoly_setType(swigCPtr, this, t); 171 | } 172 | 173 | /** 174 | * Gets the user defined area id. 175 | * 176 | * @return 177 | */ 178 | public short getArea() { 179 | return RecastJNI.dtPoly_getArea(swigCPtr, this); 180 | } 181 | 182 | /** 183 | * Gets the polygon type. 184 | * 185 | * @return 186 | * @see PolyTypes 187 | */ 188 | public short getType() { 189 | return RecastJNI.dtPoly_getType(swigCPtr, this); 190 | } 191 | 192 | public void setSwigCPtr(long swigCPtr) { 193 | if (this.swigCPtr==swigCPtr) { 194 | return; 195 | } 196 | delete(); 197 | this.swigCPtr = swigCPtr; 198 | } 199 | 200 | 201 | } 202 | -------------------------------------------------------------------------------- /src/com/jme3/ai/navigation/recast/Contour.java: -------------------------------------------------------------------------------- 1 | package com.jme3.ai.navigation.recast; 2 | 3 | import com.jme3.ai.navigation.utils.Converter; 4 | import com.jme3.ai.navigation.utils.RecastJNI; 5 | import com.jme3.ai.navigation.utils.SWIGTYPE_p_int; 6 | 7 | /** 8 | * Represents a simple, non-overlapping contour in field space. 9 | * 10 | * A contour only exists within the context of a ContourSet object. 11 | * 12 | * While the height of the contour's border may vary, the contour will always 13 | * form a simple polygon when projected onto the xz-plane. 14 | * 15 | * @see ContourSet 16 | * 17 | * @author Tihomir Radosavljevic 18 | * @version 1.0 19 | */ 20 | public class Contour { 21 | 22 | private long swigCPtr; 23 | protected boolean swigCMemOwn; 24 | 25 | /** 26 | * For internal use only. 27 | */ 28 | public Contour(long cPtr, boolean cMemoryOwn) { 29 | swigCMemOwn = cMemoryOwn; 30 | swigCPtr = cPtr; 31 | } 32 | 33 | public static long getCPtr(Contour obj) { 34 | return (obj == null) ? 0 : obj.swigCPtr; 35 | } 36 | 37 | @Override 38 | protected void finalize() { 39 | delete(); 40 | } 41 | 42 | public synchronized void delete() { 43 | if (swigCPtr != 0) { 44 | if (swigCMemOwn) { 45 | swigCMemOwn = false; 46 | RecastJNI.delete_rcContour(swigCPtr); 47 | } 48 | swigCPtr = 0; 49 | } 50 | } 51 | 52 | /** 53 | * The simplified contour is a version of the raw contour with all 54 | * 'unnecessary' vertices removed. Whether a vertex is considered 55 | * unnecessary depends on the contour build process. 56 | * 57 | * The data format is as follows: (x, y, z, r) * numberOfVertices 58 | * 59 | * A contour edge is formed by the current and next vertex. The r-value 60 | * represents region and connection information for the edge. 61 | * 62 | * @param value Simplified contour vertex and connection data. [Size: 4 * 63 | * numberOfVertices]. 64 | */ 65 | public void setVertices(int[] value) { 66 | SWIGTYPE_p_int v = Converter.convertToSWIGTYPE_p_int(value); 67 | RecastJNI.rcContour_verts_set(swigCPtr, this, SWIGTYPE_p_int.getCPtr(v)); 68 | } 69 | 70 | /** 71 | * The simplified contour is a version of the raw contour with all 72 | * 'unnecessary' vertices removed. Whether a vertex is considered 73 | * unnecessary depends on the contour build process. 74 | * 75 | * The data format is as follows: (x, y, z, r) * numberOfVertices 76 | * 77 | * A contour edge is formed by the current and next vertex. The r-value 78 | * represents region and connection information for the edge. 79 | * 80 | * @return Simplified contour vertex and connection data. [Size: 4 * 81 | * numberOfVertices]. 82 | */ 83 | public int[] getVertices() { 84 | long cPtr = RecastJNI.rcContour_verts_get(swigCPtr, this); 85 | if (cPtr == 0) { 86 | return null; 87 | } 88 | return Converter.convertToInts(cPtr, getNumberOfVertices() * 4); 89 | } 90 | 91 | /** 92 | * 93 | * @param numberOfVertices The number of vertices in the simplified contour. 94 | */ 95 | public void setNumberOfVertices(int numberOfVertices) { 96 | RecastJNI.rcContour_nverts_set(swigCPtr, this, numberOfVertices); 97 | } 98 | 99 | /** 100 | * 101 | * @return The number of vertices in the simplified contour. 102 | */ 103 | public int getNumberOfVertices() { 104 | return RecastJNI.rcContour_nverts_get(swigCPtr, this); 105 | } 106 | 107 | /** 108 | * The simplified contour is a version of the raw contour with all 109 | * 'unnecessary' vertices removed. Whether a vertex is considered 110 | * unnecessary depends on the contour build process. 111 | * 112 | * The data format is as follows: (x, y, z, r) * numberOfRawVertices 113 | * 114 | * A contour edge is formed by the current and next vertex. The r-value 115 | * represents region and connection information for the edge. 116 | * 117 | * @param value Raw contour vertex and connection data. [Size: 4 * 118 | * numberOfRawVertices]. 119 | */ 120 | public void setRawVertices(int[] value) { 121 | SWIGTYPE_p_int v = Converter.convertToSWIGTYPE_p_int(value); 122 | RecastJNI.rcContour_rverts_set(swigCPtr, this, SWIGTYPE_p_int.getCPtr(v)); 123 | } 124 | 125 | /** 126 | * The simplified contour is a version of the raw contour with all 127 | * 'unnecessary' vertices removed. Whether a vertex is considered 128 | * unnecessary depends on the contour build process. 129 | * 130 | * The data format is as follows: (x, y, z, r) * numberOfRawVertices 131 | * 132 | * A contour edge is formed by the current and next vertex. The r-value 133 | * represents region and connection information for the edge. 134 | * 135 | * @return Raw contour vertex and connection data. [Size: 4 * 136 | * numberOfRawVertices]. 137 | */ 138 | public int[] getRawVertices() { 139 | long cPtr = RecastJNI.rcContour_rverts_get(swigCPtr, this); 140 | if (cPtr == 0) { 141 | return null; 142 | } 143 | return Converter.convertToInts(cPtr, getNumberOfRawVertices() * 4); 144 | } 145 | 146 | /** 147 | * 148 | * @param value The number of vertices in the raw contour. 149 | */ 150 | public void setNumberOfRawVertices(int value) { 151 | RecastJNI.rcContour_nrverts_set(swigCPtr, this, value); 152 | } 153 | 154 | /** 155 | * 156 | * @return The number of vertices in the raw contour. 157 | */ 158 | public int getNumberOfRawVertices() { 159 | return RecastJNI.rcContour_nrverts_get(swigCPtr, this); 160 | } 161 | 162 | /** 163 | * 164 | * @param value The region id of the contour. 165 | */ 166 | public void setRegionID(int value) { 167 | RecastJNI.rcContour_reg_set(swigCPtr, this, value); 168 | } 169 | 170 | /** 171 | * 172 | * @return The region id of the contour. 173 | */ 174 | public int getRegionID() { 175 | return RecastJNI.rcContour_reg_get(swigCPtr, this); 176 | } 177 | 178 | /** 179 | * 180 | * @param value The area id of the contour. 181 | */ 182 | public void setArea(short value) { 183 | RecastJNI.rcContour_area_set(swigCPtr, this, value); 184 | } 185 | 186 | /** 187 | * 188 | * @return The area id of the contour. 189 | */ 190 | public short getArea() { 191 | return RecastJNI.rcContour_area_get(swigCPtr, this); 192 | } 193 | } 194 | --------------------------------------------------------------------------------