pub struct AiBehaviorEditor {Show 61 fields
pub active_tree_index: usize,
pub behavior_trees: Vec<BehaviorTree>,
pub bt_layout: ReingoldTilford,
pub bt_selection: GraphSelection,
pub bt_camera: NodeGraphCamera,
pub bt_connection_draft: Option<ConnectionDraft>,
pub bt_tool: EditorTool,
pub bt_node_palette: Vec<(String, BtNodeType)>,
pub bt_comments: Vec<NodeComment>,
pub bt_undo_stack: Vec<BtUndoEntry>,
pub bt_redo_stack: Vec<BtUndoEntry>,
pub active_fsm_index: usize,
pub fsm_instances: Vec<FsmInstance>,
pub fsm_camera: NodeGraphCamera,
pub fsm_selection: HashSet<u32>,
pub fsm_tool: EditorTool,
pub fsm_transition_draft: Option<(u32, Vec2)>,
pub goap_planner: GoapPlanner,
pub goap_world_state: WorldState,
pub goap_goal_state: WorldState,
pub goap_last_plan: Option<Vec<usize>>,
pub goap_action_editor_open: bool,
pub goap_selected_action: Option<u32>,
pub utility_dm: UtilityDecisionMaker,
pub utility_selected_action: Option<u32>,
pub utility_curve_editor_open: bool,
pub utility_selected_consideration: Option<(u32, usize)>,
pub utility_curve_preview_points: Vec<Vec2>,
pub perception_systems: Vec<PerceptionSystem>,
pub selected_perception_agent: Option<u64>,
pub perception_debug_draw: bool,
pub formation_preview: FormationType,
pub formation_n_agents: usize,
pub formation_spacing: f32,
pub formation_preview_slots: Vec<Vec3>,
pub steering_agents: Vec<SteeringAgent>,
pub steering_debug_draw: bool,
pub steering_selected_agent: Option<u64>,
pub emotion_engines: Vec<EmotionEngine>,
pub selected_emotion_agent: usize,
pub emotion_debug_draw: bool,
pub blackboard_inspector: BlackboardInspector,
pub shared_blackboard: Blackboard,
pub debug_buffer: DebugVisualizationBuffer,
pub show_debug_panel: bool,
pub agents: Vec<AiAgent>,
pub selected_agent_id: Option<u64>,
pub simulation_running: bool,
pub simulation_speed: f32,
pub obstacles: Vec<Aabb>,
pub flow_field: HashMap<(i32, i32), Vec3>,
pub current_time: f32,
pub frame_dt: f32,
pub panel_sizes: HashMap<String, Vec2>,
pub theme_color: Vec4,
pub font_size: f32,
pub grid_visible: bool,
pub grid_size: f32,
pub snap_to_grid: bool,
pub status_message: String,
pub status_timer: f32,
}Fields§
§active_tree_index: usize§behavior_trees: Vec<BehaviorTree>§bt_layout: ReingoldTilford§bt_selection: GraphSelection§bt_camera: NodeGraphCamera§bt_connection_draft: Option<ConnectionDraft>§bt_tool: EditorTool§bt_node_palette: Vec<(String, BtNodeType)>§bt_comments: Vec<NodeComment>§bt_undo_stack: Vec<BtUndoEntry>§bt_redo_stack: Vec<BtUndoEntry>§active_fsm_index: usize§fsm_instances: Vec<FsmInstance>§fsm_camera: NodeGraphCamera§fsm_selection: HashSet<u32>§fsm_tool: EditorTool§fsm_transition_draft: Option<(u32, Vec2)>§goap_planner: GoapPlanner§goap_world_state: WorldState§goap_goal_state: WorldState§goap_last_plan: Option<Vec<usize>>§goap_action_editor_open: bool§goap_selected_action: Option<u32>§utility_dm: UtilityDecisionMaker§utility_selected_action: Option<u32>§utility_curve_editor_open: bool§utility_selected_consideration: Option<(u32, usize)>§utility_curve_preview_points: Vec<Vec2>§perception_systems: Vec<PerceptionSystem>§selected_perception_agent: Option<u64>§perception_debug_draw: bool§formation_preview: FormationType§formation_n_agents: usize§formation_spacing: f32§formation_preview_slots: Vec<Vec3>§steering_agents: Vec<SteeringAgent>§steering_debug_draw: bool§steering_selected_agent: Option<u64>§emotion_engines: Vec<EmotionEngine>§selected_emotion_agent: usize§emotion_debug_draw: bool§blackboard_inspector: BlackboardInspector§debug_buffer: DebugVisualizationBuffer§show_debug_panel: bool§agents: Vec<AiAgent>§selected_agent_id: Option<u64>§simulation_running: bool§simulation_speed: f32§obstacles: Vec<Aabb>§flow_field: HashMap<(i32, i32), Vec3>§current_time: f32§frame_dt: f32§panel_sizes: HashMap<String, Vec2>§theme_color: Vec4§font_size: f32§grid_visible: bool§grid_size: f32§snap_to_grid: bool§status_message: String§status_timer: f32Implementations§
Source§impl AiBehaviorEditor
impl AiBehaviorEditor
pub fn new() -> Self
pub fn bt_add_node( &mut self, tree_idx: usize, node_type: BtNodeType, ) -> Option<u32>
pub fn bt_remove_node(&mut self, tree_idx: usize, node_id: u32)
pub fn bt_connect_nodes( &mut self, tree_idx: usize, parent_id: u32, child_id: u32, )
pub fn bt_move_node(&mut self, tree_idx: usize, node_id: u32, new_pos: Vec2)
pub fn bt_auto_layout(&mut self, tree_idx: usize)
pub fn bt_undo(&mut self)
pub fn bt_redo(&mut self)
pub fn bt_duplicate_node( &mut self, tree_idx: usize, node_id: u32, ) -> Option<u32>
pub fn bt_select_all(&mut self, tree_idx: usize)
pub fn bt_delete_selected(&mut self, tree_idx: usize)
pub fn bt_hit_test(&self, tree_idx: usize, world_pos: Vec2) -> Option<u32>
pub fn bt_get_node_color(&self, node: &BtNode) -> Vec4
pub fn bt_get_bezier_control_points( from: Vec2, to: Vec2, ) -> (Vec2, Vec2, Vec2, Vec2)
pub fn bt_bezier_point(p0: Vec2, p1: Vec2, p2: Vec2, p3: Vec2, t: f32) -> Vec2
pub fn bt_get_edge_polyline( from: Vec2, to: Vec2, num_points: usize, ) -> Vec<Vec2>
pub fn fsm_add_state( &mut self, fsm_idx: usize, name: &str, pos: Vec2, ) -> Option<u32>
pub fn fsm_add_transition( &mut self, fsm_idx: usize, from: u32, to: u32, condition: FsmConditionOp, priority: i32, ) -> Option<u32>
pub fn fsm_remove_state(&mut self, fsm_idx: usize, state_id: u32)
pub fn fsm_remove_transition(&mut self, fsm_idx: usize, transition_id: u32)
pub fn fsm_transition_midpoint( &self, fsm_idx: usize, transition: &FsmTransition, ) -> Vec2
pub fn fsm_hit_test_state( &self, fsm_idx: usize, world_pos: Vec2, state_radius: f32, ) -> Option<u32>
pub fn goap_add_action(&mut self, action: GoapAction)
pub fn goap_remove_action(&mut self, action_id: u32)
pub fn goap_replan(&mut self)
pub fn goap_toggle_world_state_bit(&mut self, bit: u8)
pub fn goap_toggle_goal_bit(&mut self, bit: u8)
pub fn goap_plan_to_names(&self) -> Vec<String>
pub fn goap_plan_total_cost(&self) -> f32
pub fn goap_simulate_plan_states(&self) -> Vec<(String, WorldState)>
pub fn utility_update_curve_preview(&mut self)
pub fn utility_score_all(&self) -> Vec<(u32, String, f32)>
pub fn utility_set_consideration_curve( &mut self, action_id: u32, consideration_idx: usize, curve: ResponseCurve, )
pub fn recompute_formation_preview(&mut self)
pub fn set_formation(&mut self, formation: FormationType)
pub fn get_formation_debug_lines(&self) -> Vec<(Vec3, Vec3)>
pub fn add_perception_system(&mut self, agent_id: u64)
pub fn perception_debug_draw( &mut self, agent_idx: usize, observer_pos: Vec3, observer_fwd: Vec3, )
pub fn add_steering_agent(&mut self, id: u64, pos: Vec3)
pub fn tick_steering_agents(&mut self, dt: f32)
pub fn add_emotion_engine(&mut self)
pub fn trigger_emotion( &mut self, engine_idx: usize, emotion: PrimaryEmotion, intensity: f32, )
pub fn get_emotion_wheel_points( &self, engine_idx: usize, scale: f32, ) -> Vec<Vec2>
pub fn simulation_tick(&mut self, dt: f32)
pub fn show_status(&mut self, message: &str, duration: f32)
pub fn spawn_agent(&mut self, position: Vec3, mode: AiAgentMode) -> u64
pub fn remove_agent(&mut self, id: u64)
pub fn get_agent(&self, id: u64) -> Option<&AiAgent>
pub fn get_agent_mut(&mut self, id: u64) -> Option<&mut AiAgent>
pub fn inspect_blackboard(&mut self, agent_id: Option<u64>)
pub fn blackboard_search_keys(&self, prefix: &str) -> Vec<String>
pub fn generate_flow_field_toward( &mut self, target: Vec3, bounds_min: Vec2, bounds_max: Vec2, cell_size: f32, )
pub fn generate_flow_field_rotational( &mut self, center: Vec3, bounds_min: Vec2, bounds_max: Vec2, cell_size: f32, clockwise: bool, )
pub fn set_dark_theme(&mut self)
pub fn set_light_theme(&mut self)
pub fn set_font_size(&mut self, size: f32)
pub fn serialize_behavior_tree(&self, tree_idx: usize) -> Option<String>
pub fn serialize_goap_actions(&self) -> String
pub fn grid_snap(&self, pos: Vec2) -> Vec2
pub fn grid_lines_in_view( &self, viewport_min: Vec2, viewport_max: Vec2, camera: &NodeGraphCamera, viewport_size: Vec2, ) -> (Vec<(Vec2, Vec2)>, Vec<(Vec2, Vec2)>)
pub fn bt_tree_depth(&self, tree_idx: usize) -> usize
pub fn bt_leaf_count(&self, tree_idx: usize) -> usize
pub fn goap_action_count(&self) -> usize
pub fn agent_count(&self) -> usize
pub fn selected_agent_debug_info(&self) -> Option<String>
pub fn handle_key(&mut self, key: EditorKey, shift: bool, ctrl: bool)
Source§impl AiBehaviorEditor
impl AiBehaviorEditor
pub fn add_influence_map_panel(&mut self)
pub fn get_bt_node_tooltip(&self, tree_idx: usize, node_id: u32) -> String
pub fn center_camera_on_tree(&mut self, tree_idx: usize)
pub fn align_nodes_horizontal(&mut self, tree_idx: usize)
pub fn align_nodes_vertical(&mut self, tree_idx: usize)
pub fn distribute_nodes_horizontally(&mut self, tree_idx: usize)
pub fn set_node_color_by_status(&self) -> HashMap<u32, Vec4>
pub fn export_tree_as_dot(&self, tree_idx: usize) -> String
pub fn compute_heatmap_positions( &self, tree_idx: usize, debugger: &BtDebugger, ) -> Vec<(Vec2, f32)>
pub fn fsm_get_transition_arrow( &self, fsm_idx: usize, transition_id: u32, ) -> Option<(Vec2, Vec2)>
pub fn blackboard_diff( &self, other: &Blackboard, ) -> Vec<(String, BlackboardValue, BlackboardValue)>
pub fn get_formation_agent_positions( &self, leader_pos: Vec3, leader_fwd: Vec3, ) -> Vec<Vec3>
pub fn compute_all_utility_scores(&self) -> Vec<(String, f32)>
pub fn tick_all_emotion_engines(&mut self, dt: f32)
pub fn get_global_threat_level(&self) -> f32
pub fn snapshot_agent_states(&self) -> Vec<HashMap<String, f32>>
Auto Trait Implementations§
impl Freeze for AiBehaviorEditor
impl RefUnwindSafe for AiBehaviorEditor
impl Send for AiBehaviorEditor
impl Sync for AiBehaviorEditor
impl Unpin for AiBehaviorEditor
impl UnsafeUnpin for AiBehaviorEditor
impl UnwindSafe for AiBehaviorEditor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.