Explorar o código

Merge pull request #9151 from CedricGuillemet/mackeyHelperFunctions

Helper function for off mesh link
Raanan Weber %!s(int64=4) %!d(string=hai) anos
pai
achega
214d2244f9

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 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