summaryrefslogtreecommitdiff
path: root/shared/src/resources.rs
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src/resources.rs')
-rw-r--r--shared/src/resources.rs19
1 files changed, 17 insertions, 2 deletions
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 <https://www.gnu.org/licenses/>.
*/
-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<Prefab>,
+ c_spatial_index[multi]: Resource<SpatialIndex>,
+ }
+
+ pub struct SpatialIndex {
+ level: u32,
+ prefab: Resource<Prefab>,
+ child[multi]: (AABB, Resource<SpatialIndex>),
}
pub struct Prefab {
name: String,
+ transform: DAffine3,
+ prefab[multi]: (Affine3A, Resource<Prefab>),
+ graphics[multi]: (Affine3A, Resource<GraphicsPart>),
mesh[multi]: (Affine3A, Resource<MeshPart>),
collision[multi]: (Affine3A, Resource<CollisionPart>),
light[multi]: (Vec3A, Resource<LightPart>),