diff --git a/examples/boids/2d/simple/example.gd b/examples/boids/2d/simple/example.gd index b17a5d4..3f06d49 100644 --- a/examples/boids/2d/simple/example.gd +++ b/examples/boids/2d/simple/example.gd @@ -2,7 +2,7 @@ extends Node2D func _ready() -> void: for flock in get_children(): - for i in 100: spawnBoid(flock) + for i in 1000: spawnBoid(flock) func spawnBoid(flock: Flock2D) -> void: var boid: Boid2D = preload("../example_boid.tscn").instantiate() diff --git a/rust/src/boid/boid_2d.rs b/rust/src/boid/boid_2d.rs index a4bf13a..1c20831 100644 --- a/rust/src/boid/boid_2d.rs +++ b/rust/src/boid/boid_2d.rs @@ -5,6 +5,8 @@ use crate::{BoidProperties, Flock2D}; #[derive(GodotClass)] #[class(init, base=Node2D)] +/// A 2D boid. +/// Doesn't do anything on it's own, must be a child of a `Flock2D`. pub struct Boid2D { #[export] /// The properties of this boid. diff --git a/rust/src/boid/boid_3d.rs b/rust/src/boid/boid_3d.rs index 010271d..b99c5c7 100644 --- a/rust/src/boid/boid_3d.rs +++ b/rust/src/boid/boid_3d.rs @@ -5,6 +5,8 @@ use crate::{to_glam_vec, BoidProperties, Flock3D}; #[derive(GodotClass)] #[class(init, base=Node3D)] +/// A 3D boid. +/// Doesn't do anything on it's own, must be a child of a `Flock3D`. pub struct Boid3D { #[export] /// The properties of this boid. diff --git a/rust/src/boid_properties.rs b/rust/src/boid_properties.rs index 7d77f6f..db60c79 100644 --- a/rust/src/boid_properties.rs +++ b/rust/src/boid_properties.rs @@ -2,6 +2,7 @@ use godot::prelude::*; #[derive(Default, Clone, Debug, GodotClass)] #[class(tool, init, base=Resource)] +/// Properties for a 2D/3D boid. pub struct BoidProperties { #[export] #[init(val = 4.0)] diff --git a/rust/src/flock/flock_2d.rs b/rust/src/flock/flock_2d.rs index 72f132b..6055479 100644 --- a/rust/src/flock/flock_2d.rs +++ b/rust/src/flock/flock_2d.rs @@ -7,6 +7,8 @@ use super::Flock; #[derive(GodotClass)] #[class(init, base=Node2D)] +/// A flock that holds 2D boids. +/// Adding `Boid2D` as a child of this node will register the boid. pub struct Flock2D { #[export] /// Properties of this flock. @@ -58,6 +60,7 @@ impl INode2D for Flock2D { impl Flock2D { #[func] #[inline(always)] + /// Retrieve the ID of this flock. pub fn get_id(&self) -> i64 { self.base().instance_id().to_i64() } diff --git a/rust/src/flock/flock_3d.rs b/rust/src/flock/flock_3d.rs index be5b737..533594d 100644 --- a/rust/src/flock/flock_3d.rs +++ b/rust/src/flock/flock_3d.rs @@ -9,6 +9,8 @@ use super::Flock; #[derive(GodotClass)] #[class(init, base=Node3D)] +/// A flock that holds 3D boids. +/// Adding `Boid3D` as a child of this node will register the boid. pub struct Flock3D { #[export] /// Properties of this flock. @@ -60,6 +62,7 @@ impl INode3D for Flock3D { impl Flock3D { #[func] #[inline(always)] + /// Retrieve the ID of this flock. pub fn get_id(&self) -> i64 { self.base().instance_id().to_i64() } diff --git a/rust/src/flock_properties.rs b/rust/src/flock_properties.rs index 8fdce9b..b3dd037 100644 --- a/rust/src/flock_properties.rs +++ b/rust/src/flock_properties.rs @@ -2,6 +2,7 @@ use godot::prelude::*; #[derive(Default, Clone, Debug, GodotClass)] #[class(tool, init, base=Resource)] +/// Properties for a 2D/3D flock. pub struct FlockProperties { #[export] #[init(val = 625.0)]