From 40afd6fa42ad937148c6812b8df8efff6c78e4b5 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 27 Mar 2025 18:17:34 +0100 Subject: spatial tree, graphics and some unit tests --- shared/src/resources.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'shared/src/resources.rs') diff --git a/shared/src/resources.rs b/shared/src/resources.rs index 4d14633..fa3c17b 100644 --- a/shared/src/resources.rs +++ b/shared/src/resources.rs @@ -14,9 +14,14 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -use crate::{helper::ReadWrite, loader::ResLoader, packets::Resource}; +use crate::{ + graphics::GraphicsPart, + helper::{AABB, ReadWrite}, + loader::ResLoader, + packets::Resource, +}; use anyhow::Result; -use glam::{Affine3A, Vec2, Vec3A, Vec4}; +use glam::{Affine3A, DAffine3, Vec2, Vec3A, Vec4}; use log::warn; use std::{ borrow::Cow, @@ -75,10 +80,20 @@ macro_rules! resource_dicts { resource_dicts!( pub struct RespackEntry { c_prefab[multi]: Resource, + c_spatial_index[multi]: Resource, + } + + pub struct SpatialIndex { + level: u32, + prefab: Resource, + child[multi]: (AABB, Resource), } pub struct Prefab { name: String, + transform: DAffine3, + prefab[multi]: (Affine3A, Resource), + graphics[multi]: (Affine3A, Resource), mesh[multi]: (Affine3A, Resource), collision[multi]: (Affine3A, Resource), light[multi]: (Vec3A, Resource), -- cgit v1.2.3-70-g09d2