summaryrefslogtreecommitdiff
path: root/world/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-10 20:06:01 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-10 20:06:01 +0100
commit3ac853862b5965c1ebfb10b12fb35cf5c671232f (patch)
tree4aaa6684d21ec7eb4dbae00878111989131aedba /world/src/main.rs
parent2746fce8d943325f34b188a67b7039453d8484d1 (diff)
downloadweareserver-3ac853862b5965c1ebfb10b12fb35cf5c671232f.tar
weareserver-3ac853862b5965c1ebfb10b12fb35cf5c671232f.tar.bz2
weareserver-3ac853862b5965c1ebfb10b12fb35cf5c671232f.tar.zst
physics extension and fixes
Diffstat (limited to 'world/src/main.rs')
-rw-r--r--world/src/main.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/world/src/main.rs b/world/src/main.rs
index 5dbfd06..c90ff0c 100644
--- a/world/src/main.rs
+++ b/world/src/main.rs
@@ -16,6 +16,7 @@
*/
#![feature(iter_array_chunks)]
pub mod mesh;
+pub mod physics;
use anyhow::{Result, bail};
use clap::Parser;
@@ -23,6 +24,7 @@ use gltf::{Gltf, image::Source, import_buffers};
use image::{ImageReader, codecs::webp::WebPEncoder};
use log::info;
use mesh::import_mesh;
+use physics::import_physics;
use rand::random;
use std::{
fs::File,
@@ -93,6 +95,7 @@ fn main() -> Result<()> {
for node in gltf.nodes() {
if let Some(mesh) = node.mesh() {
+ info!("--- MESH ---");
import_mesh(
mesh,
&buffers,
@@ -105,7 +108,11 @@ fn main() -> Result<()> {
}
let (position, _, _) = node.transform().decomposed();
if let Some(light) = node.light() {
+ info!("--- LIGHT ---");
let emission = Some(Vec3A::from_array(light.color()) * light.intensity());
+ if let Some(e) = emission {
+ info!("emission is {e}");
+ }
prefab.light.push((
Vec3A::from_array(position),
store.set(&LightPart {
@@ -114,6 +121,7 @@ fn main() -> Result<()> {
})?,
));
}
+ import_physics(&gltf, &node, &mut prefab, &store, &buffers)?;
}
if let Some(skybox) = args.skybox {