summaryrefslogtreecommitdiff
path: root/shared/src/tree.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-07 22:56:34 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-07 22:56:34 +0100
commit02d65e6b7ce7a0e6bae054bd321c68dda1cb0de3 (patch)
tree10362c18bccf2e9690d78844a7ff3ca403f7a126 /shared/src/tree.rs
parent745c0ff9cfb27381114ce832baed3b57a2e4b4f6 (diff)
downloadweareserver-02d65e6b7ce7a0e6bae054bd321c68dda1cb0de3.tar
weareserver-02d65e6b7ce7a0e6bae054bd321c68dda1cb0de3.tar.bz2
weareserver-02d65e6b7ce7a0e6bae054bd321c68dda1cb0de3.tar.zst
static typing for resources
Diffstat (limited to 'shared/src/tree.rs')
-rw-r--r--shared/src/tree.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/shared/src/tree.rs b/shared/src/tree.rs
index e2c8250..9337cfb 100644
--- a/shared/src/tree.rs
+++ b/shared/src/tree.rs
@@ -14,7 +14,10 @@
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::packets::{Object, Packet, Resource};
+use crate::{
+ packets::{Object, Packet, Resource},
+ resources::Prefab,
+};
use glam::Vec3A;
use std::collections::HashMap;
@@ -26,7 +29,7 @@ pub struct ObjectData {
pub rot: Vec3A,
pub parent: Object,
pub pose: Vec<f32>,
- pub res: Resource,
+ pub res: Resource<Prefab>,
}
impl Default for SceneTree {
fn default() -> Self {
@@ -44,7 +47,7 @@ impl SceneTree {
pos: Vec3A::ZERO,
rot: Vec3A::ZERO,
pose: Vec::new(),
- res: *res,
+ res: res.clone(),
});
}
Packet::Remove(object) => {
@@ -75,7 +78,7 @@ impl SceneTree {
.iter()
.map(|(object, data)| {
[
- Packet::Add(*object, data.res),
+ Packet::Add(*object, data.res.clone()),
Packet::Parent(*object, data.parent),
Packet::Position(*object, data.pos, data.rot),
Packet::Pose(*object, data.pose.clone()),