"""adds a pursuer""" if data == None: return # set vehicle's type == mp_pursuer OSSteerManager.get_global_ptr().set_parameter_value( OSSteerManager.STEERVEHICLE, "vehicle_type", "mp_pursuer") # handle vehicle handleVehicles(data) if __name__ == '__main__': msg = "'multiple pursuit'" app = startFramework(msg) # # here is room for your own code # print some help to screen text = TextNode("Help") text.set_text( msg + "\n\n" "- press \"d\" to toggle debug drawing\n" "- press \"w\" to add 'wanderer' vehicle\n" "- press \"p\" to add 'pursuer' vehicle\n" "- press \"s\"/\"shift-s\" to increase/decrease last inserted vehicle's max speed\n" "- press \"f\"/\"shift-f\" to increase/decrease last inserted vehicle's max force\n" ) textNodePath = app.aspect2d.attach_new_node(text) textNodePath.set_pos(-1.25, 0.0, -0.5) textNodePath.set_scale(0.035)
print(vehicle.get_name() + " params:") print(vehicle.get_settings()) def plugInCallback(plugIn): """plug-in update callback function""" global globalClock print(plugIn.get_name() + " real time and dt: " + str(globalClock.get_real_time()) + str(globalClock.get_dt())) if __name__ == '__main__': app = startFramework("'one turning'") # # here is room for your own code print( "create a steer manager; set root and mask to manage 'kinematic' vehicles" ) steerMgr = OSSteerManager(app.render, mask) print("reparent the reference node to render") steerMgr.get_reference_node_path().reparent_to(app.render) print("get a sceneNP and reparent to the reference node") sceneNP = loadPlane("SceneNP") sceneNP.reparent_to(steerMgr.get_reference_node_path())