16 lines
455 B
Rust
16 lines
455 B
Rust
use bevy::prelude::Component;
|
|
use common::space::three_dimensional::{traits::VoxelContainer, vec3generic::Vec3Generic};
|
|
|
|
use crate::voxels::bool_voxel::BoolVoxel;
|
|
|
|
#[derive(Debug, Default, Component)]
|
|
pub struct VoxelCursorLayer {
|
|
pub position: Vec3Generic<i32>,
|
|
}
|
|
|
|
impl VoxelContainer<BoolVoxel> for VoxelCursorLayer {
|
|
fn get_voxel_at_pos(&self, pos: Vec3Generic<i32>) -> Option<BoolVoxel> {
|
|
Some(BoolVoxel(self.position == pos))
|
|
}
|
|
}
|