refactor: move properties code under their respective directories
This commit is contained in:
parent
419019cfb0
commit
fbe5d1644b
@ -28,4 +28,8 @@ pub struct BoidProperties {
|
||||
#[init(val = 0.8)]
|
||||
/// How much to follow a flock target (if there is one).
|
||||
pub targeting: f32,
|
||||
#[export]
|
||||
#[init(val = 1.0)]
|
||||
/// How much to avoid avoidance objects (if there are any).
|
||||
pub avoidance: f32,
|
||||
}
|
@ -4,10 +4,15 @@ use std::sync::Arc;
|
||||
use glam::*;
|
||||
use rayon::prelude::*;
|
||||
|
||||
use crate::{BoidProperties, FlockProperties};
|
||||
use crate::FlockProperties;
|
||||
|
||||
pub mod boid_2d;
|
||||
pub mod boid_3d;
|
||||
pub mod boid_properties;
|
||||
|
||||
pub use boid_2d::*;
|
||||
pub use boid_3d::*;
|
||||
pub use boid_properties::*;
|
||||
|
||||
pub trait Boid {
|
||||
fn apply_force(&mut self, force: Vec3);
|
||||
|
@ -1,10 +1,15 @@
|
||||
use crate::{BoidProperties, FlockProperties};
|
||||
|
||||
use glam::*;
|
||||
|
||||
use crate::BoidProperties;
|
||||
|
||||
pub mod flock_properties;
|
||||
pub mod flock_2d;
|
||||
pub mod flock_3d;
|
||||
|
||||
pub use flock_properties::*;
|
||||
pub use flock_2d::*;
|
||||
pub use flock_3d::*;
|
||||
|
||||
pub trait Flock {
|
||||
fn get_flock_properties(&self) -> &FlockProperties;
|
||||
fn get_target_position(&self) -> Option<Vec3>;
|
||||
|
@ -9,15 +9,12 @@ use godot::{
|
||||
use indexmap::IndexMap;
|
||||
use rayon::prelude::*;
|
||||
|
||||
mod obstacle;
|
||||
mod boid;
|
||||
mod boid_properties;
|
||||
mod flock;
|
||||
mod flock_properties;
|
||||
|
||||
pub use boid::{boid_2d::*, boid_3d::*, Boid};
|
||||
pub use boid_properties::BoidProperties;
|
||||
pub use flock::{flock_2d::*, flock_3d::*, Flock};
|
||||
pub use flock_properties::FlockProperties;
|
||||
pub use boid::{*, Boid};
|
||||
pub use flock::{*, Flock};
|
||||
|
||||
use rustc_hash::FxBuildHasher;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user