Skip to main content

AiBehaviorEditor

Struct AiBehaviorEditor 

Source
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§shared_blackboard: Blackboard§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: f32

Implementations§

Source§

impl AiBehaviorEditor

Source

pub fn new() -> Self

Source

pub fn bt_add_node( &mut self, tree_idx: usize, node_type: BtNodeType, ) -> Option<u32>

Source

pub fn bt_remove_node(&mut self, tree_idx: usize, node_id: u32)

Source

pub fn bt_connect_nodes( &mut self, tree_idx: usize, parent_id: u32, child_id: u32, )

Source

pub fn bt_move_node(&mut self, tree_idx: usize, node_id: u32, new_pos: Vec2)

Source

pub fn bt_auto_layout(&mut self, tree_idx: usize)

Source

pub fn bt_undo(&mut self)

Source

pub fn bt_redo(&mut self)

Source

pub fn bt_duplicate_node( &mut self, tree_idx: usize, node_id: u32, ) -> Option<u32>

Source

pub fn bt_select_all(&mut self, tree_idx: usize)

Source

pub fn bt_delete_selected(&mut self, tree_idx: usize)

Source

pub fn bt_hit_test(&self, tree_idx: usize, world_pos: Vec2) -> Option<u32>

Source

pub fn bt_get_node_color(&self, node: &BtNode) -> Vec4

Source

pub fn bt_get_bezier_control_points( from: Vec2, to: Vec2, ) -> (Vec2, Vec2, Vec2, Vec2)

Source

pub fn bt_bezier_point(p0: Vec2, p1: Vec2, p2: Vec2, p3: Vec2, t: f32) -> Vec2

Source

pub fn bt_get_edge_polyline( from: Vec2, to: Vec2, num_points: usize, ) -> Vec<Vec2>

Source

pub fn fsm_add_state( &mut self, fsm_idx: usize, name: &str, pos: Vec2, ) -> Option<u32>

Source

pub fn fsm_add_transition( &mut self, fsm_idx: usize, from: u32, to: u32, condition: FsmConditionOp, priority: i32, ) -> Option<u32>

Source

pub fn fsm_remove_state(&mut self, fsm_idx: usize, state_id: u32)

Source

pub fn fsm_remove_transition(&mut self, fsm_idx: usize, transition_id: u32)

Source

pub fn fsm_transition_midpoint( &self, fsm_idx: usize, transition: &FsmTransition, ) -> Vec2

Source

pub fn fsm_hit_test_state( &self, fsm_idx: usize, world_pos: Vec2, state_radius: f32, ) -> Option<u32>

Source

pub fn goap_add_action(&mut self, action: GoapAction)

Source

pub fn goap_remove_action(&mut self, action_id: u32)

Source

pub fn goap_replan(&mut self)

Source

pub fn goap_toggle_world_state_bit(&mut self, bit: u8)

Source

pub fn goap_toggle_goal_bit(&mut self, bit: u8)

Source

pub fn goap_plan_to_names(&self) -> Vec<String>

Source

pub fn goap_plan_total_cost(&self) -> f32

Source

pub fn goap_simulate_plan_states(&self) -> Vec<(String, WorldState)>

Source

pub fn utility_update_curve_preview(&mut self)

Source

pub fn utility_score_all(&self) -> Vec<(u32, String, f32)>

Source

pub fn utility_set_consideration_curve( &mut self, action_id: u32, consideration_idx: usize, curve: ResponseCurve, )

Source

pub fn recompute_formation_preview(&mut self)

Source

pub fn set_formation(&mut self, formation: FormationType)

Source

pub fn get_formation_debug_lines(&self) -> Vec<(Vec3, Vec3)>

Source

pub fn add_perception_system(&mut self, agent_id: u64)

Source

pub fn perception_debug_draw( &mut self, agent_idx: usize, observer_pos: Vec3, observer_fwd: Vec3, )

Source

pub fn add_steering_agent(&mut self, id: u64, pos: Vec3)

Source

pub fn tick_steering_agents(&mut self, dt: f32)

Source

pub fn add_emotion_engine(&mut self)

Source

pub fn trigger_emotion( &mut self, engine_idx: usize, emotion: PrimaryEmotion, intensity: f32, )

Source

pub fn get_emotion_wheel_points( &self, engine_idx: usize, scale: f32, ) -> Vec<Vec2>

Source

pub fn simulation_tick(&mut self, dt: f32)

Source

pub fn show_status(&mut self, message: &str, duration: f32)

Source

pub fn spawn_agent(&mut self, position: Vec3, mode: AiAgentMode) -> u64

Source

pub fn remove_agent(&mut self, id: u64)

Source

pub fn get_agent(&self, id: u64) -> Option<&AiAgent>

Source

pub fn get_agent_mut(&mut self, id: u64) -> Option<&mut AiAgent>

Source

pub fn inspect_blackboard(&mut self, agent_id: Option<u64>)

Source

pub fn blackboard_search_keys(&self, prefix: &str) -> Vec<String>

Source

pub fn generate_flow_field_toward( &mut self, target: Vec3, bounds_min: Vec2, bounds_max: Vec2, cell_size: f32, )

Source

pub fn generate_flow_field_rotational( &mut self, center: Vec3, bounds_min: Vec2, bounds_max: Vec2, cell_size: f32, clockwise: bool, )

Source

pub fn set_dark_theme(&mut self)

Source

pub fn set_light_theme(&mut self)

Source

pub fn set_font_size(&mut self, size: f32)

Source

pub fn serialize_behavior_tree(&self, tree_idx: usize) -> Option<String>

Source

pub fn serialize_goap_actions(&self) -> String

Source

pub fn grid_snap(&self, pos: Vec2) -> Vec2

Source

pub fn grid_lines_in_view( &self, viewport_min: Vec2, viewport_max: Vec2, camera: &NodeGraphCamera, viewport_size: Vec2, ) -> (Vec<(Vec2, Vec2)>, Vec<(Vec2, Vec2)>)

Source

pub fn bt_tree_depth(&self, tree_idx: usize) -> usize

Source

pub fn bt_leaf_count(&self, tree_idx: usize) -> usize

Source

pub fn goap_action_count(&self) -> usize

Source

pub fn agent_count(&self) -> usize

Source

pub fn selected_agent_debug_info(&self) -> Option<String>

Source

pub fn handle_key(&mut self, key: EditorKey, shift: bool, ctrl: bool)

Source§

impl AiBehaviorEditor

Source

pub fn add_influence_map_panel(&mut self)

Source

pub fn get_bt_node_tooltip(&self, tree_idx: usize, node_id: u32) -> String

Source

pub fn center_camera_on_tree(&mut self, tree_idx: usize)

Source

pub fn align_nodes_horizontal(&mut self, tree_idx: usize)

Source

pub fn align_nodes_vertical(&mut self, tree_idx: usize)

Source

pub fn distribute_nodes_horizontally(&mut self, tree_idx: usize)

Source

pub fn set_node_color_by_status(&self) -> HashMap<u32, Vec4>

Source

pub fn export_tree_as_dot(&self, tree_idx: usize) -> String

Source

pub fn compute_heatmap_positions( &self, tree_idx: usize, debugger: &BtDebugger, ) -> Vec<(Vec2, f32)>

Source

pub fn fsm_get_transition_arrow( &self, fsm_idx: usize, transition_id: u32, ) -> Option<(Vec2, Vec2)>

Source

pub fn blackboard_diff( &self, other: &Blackboard, ) -> Vec<(String, BlackboardValue, BlackboardValue)>

Source

pub fn get_formation_agent_positions( &self, leader_pos: Vec3, leader_fwd: Vec3, ) -> Vec<Vec3>

Source

pub fn compute_all_utility_scores(&self) -> Vec<(String, f32)>

Source

pub fn tick_all_emotion_engines(&mut self, dt: f32)

Source

pub fn get_global_threat_level(&self) -> f32

Source

pub fn snapshot_agent_states(&self) -> Vec<HashMap<String, f32>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more