Newbie - Where to put control code for agents?

Hello all,

I am producing a simulation where a set of agents alter their linear velocity based on some simple rules (basically a flocking simulation - boids). Traditionally this kind of software is implemented by computing a new velocity for each agent on each animation step. Where does this kind of code go in a JME app? Is there some kind of callback or listener that is regularly triggered, where an agent (a spatial + RigidBodyControl) can be programmed to update its heading?

Many thanks,


add a control to the agent which keeps track of the info, and update it as required inside the control’s update loop.

1 Like

Thank you :slight_smile: