소스 검색

Merge pull request #9151 from CedricGuillemet/mackeyHelperFunctions

Helper function for off mesh link
Raanan Weber 4 년 전
부모
커밋
214d2244f9
3개의 변경된 파일38개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      dist/preview release/recast.js
  2. 14 0
      src/Navigation/INavigationEngine.ts
  3. 18 0
      src/Navigation/Plugins/recastJSPlugin.ts

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 6 - 6
dist/preview release/recast.js


+ 14 - 0
src/Navigation/INavigationEngine.ts

@@ -183,6 +183,20 @@ export interface ICrowd {
     getAgentNextTargetPath(index: number): Vector3;
 
     /**
+     * Gets the agent state
+     * @param index agent index returned by addAgent
+     * @returns agent state
+     */
+    getAgentState(index: number): number;
+
+    /**
+     * returns true if the agent in over an off mesh link connection
+     * @param index agent index returned by addAgent
+     * @returns true if over an off mesh link connection
+     */
+    overOffmeshConnection(index: number): boolean;
+
+    /**
      * Gets the agent next target point on the path
      * @param index agent index returned by addAgent
      * @param result output world space position

+ 18 - 0
src/Navigation/Plugins/recastJSPlugin.ts

@@ -481,6 +481,24 @@ export class RecastJSCrowd implements ICrowd {
     }
 
     /**
+     * Gets the agent state
+     * @param index agent index returned by addAgent
+     * @returns agent state
+     */
+    getAgentState(index: number): number {
+        return this.recastCrowd.getAgentState(index);
+    }
+
+    /**
+     * returns true if the agent in over an off mesh link connection
+     * @param index agent index returned by addAgent
+     * @returns true if over an off mesh link connection
+     */
+    overOffmeshConnection(index: number): boolean {
+        return this.recastCrowd.overOffmeshConnection(index);
+    }
+
+    /**
      * Asks a particular agent to go to a destination. That destination is constrained by the navigation mesh
      * @param index agent index returned by addAgent
      * @param destination targeted world position