picking + entity names

This commit is contained in:
Jonas H
2026-03-05 15:05:19 +01:00
parent 5e5c6a47e7
commit bab54b6f21
9 changed files with 400 additions and 50 deletions

View File

@@ -2,11 +2,11 @@ use std::collections::HashMap;
use crate::components::dissolve::DissolveComponent;
use crate::components::follow::FollowComponent;
use crate::components::jump::JumpComponent;
use crate::components::lights::spot::SpotlightComponent;
use crate::components::tree_instances::TreeInstancesComponent;
use crate::components::{
CameraComponent, InputComponent, MeshComponent, MovementComponent, PhysicsComponent,
RotateComponent,
CameraComponent, InputComponent, JumpComponent, MeshComponent, MovementComponent,
PhysicsComponent, RotateComponent,
};
use crate::entity::{EntityHandle, EntityManager};
use crate::state::StateMachine;
@@ -84,6 +84,8 @@ pub struct World
pub dissolves: Storage<DissolveComponent>,
pub follows: Storage<FollowComponent>,
pub rotates: Storage<RotateComponent>,
pub tree_instances: Storage<TreeInstancesComponent>,
pub names: Storage<String>,
}
impl World
@@ -106,6 +108,8 @@ impl World
dissolves: Storage::new(),
follows: Storage::new(),
rotates: Storage::new(),
tree_instances: Storage::new(),
names: Storage::new(),
}
}
@@ -130,6 +134,8 @@ impl World
self.dissolves.remove(entity);
self.follows.remove(entity);
self.rotates.remove(entity);
self.tree_instances.remove(entity);
self.names.remove(entity);
self.entities.despawn(entity);
}