kumpa Posted September 17, 2022 Share Posted September 17, 2022 How does one deal with multiple paths in POP Steer Path I would like to be able to assign a list of possible paths to each agent particle instead of all the particles following all the paths. Currently I set up multiple sops and multiple agent groups but that's not very scalable. Cheers Quote Link to comment Share on other sites More sharing options...
Atom Posted September 18, 2022 Share Posted September 18, 2022 (edited) You could carve a single point down each path. Then use each path's carve end point as a goal point per-agent. Use VEX: on pop steer node (I'd probably use a pop seek) goal = v@goal_P; After you have merged all your states, drop down a PopWrangle and use code to transfer the carved point's location to the v@goal_P. This code updates the distance to the goal on every frame. (i.e. path endpoint or carved point in motion). // Update each agent's distance to the target point. string agent_path = "op:/obj/geo_agent_setup/dopnet_crowdsim:crowdobject1/Geometry"; // Path to our agent database of attributes. int agent_count = npoints(agent_path); // Number of agents in the system. string scatter_path = "op:/obj/geo_agent_paths/OUT_CARVE_POINTS"; // Path to our animated carve points. (a single point per path) int scatter_count = npoints(scatter_path); // Number of points in the scatter. for (int i = 0; i < agent_count; i++) { // Begin looping through all agents. (path point count assumed to be equal to agent count). vector agent_location = point(agent_path,"P",i); // Fetch the point location of the agent. vector scatter_location = point(scatter_path,"P",i); // Fetch the point location in the carve. float scatter_distance = length(scatter_location - agent_location); // Get distance from carve point to my location. vector final_location = set(scatter_location[0],agent_location[1],scatter_location[2]); // The final location uses only the XZ of the scatter and the Y of the agent. setpointattrib(geoself(), "goal_distance", i, scatter_distance, "set"); // Assign this distance to an attribute on myself. setpointattrib(geoself(), "goal_P", i, final_location, "set"); // Assign this location to an attribute on myself. } Edited September 18, 2022 by Atom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.