it sucks
This commit is contained in:
parent
61073ea192
commit
5447c42083
@ -4,7 +4,7 @@ use crate::primitives::{CUBE_DEFAULT_VERTICES,CUBE_DEFAULT_POLYS};
|
||||
use rbx_mesh::mesh_data::{VertexId as MeshDataVertexId,NormalId2 as MeshDataNormalId2};
|
||||
use rbx_mesh::physics_data::VertexId as PhysicsDataVertexId;
|
||||
use strafesnet_common::model::{self,IndexedVertex,PolygonGroup,PolygonGroupId,PolygonList,RenderConfigId};
|
||||
use strafesnet_common::integer::vec3;
|
||||
use strafesnet_common::integer::{vec3,Planar64Vec3};
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug)]
|
||||
@ -169,8 +169,15 @@ pub fn convert(
|
||||
});
|
||||
polygon_groups_normal_it.chain(physics_convex_meshes_it).collect::<Result<_,_>>()?
|
||||
}else{
|
||||
let size=Planar64Vec3::new(size.to_array().map(|a|a.try_into().unwrap()));
|
||||
// generate a unit cube as default physics
|
||||
let pos_list=CUBE_DEFAULT_VERTICES.map(|pos|mb.acquire_pos_id(pos));
|
||||
let pos_list=CUBE_DEFAULT_VERTICES.map(|pos|
|
||||
mb.acquire_pos_id(Planar64Vec3::new([
|
||||
(pos.x*size.x).narrow_1().unwrap(),
|
||||
(pos.y*size.y).narrow_1().unwrap(),
|
||||
(pos.z*size.z).narrow_1().unwrap(),
|
||||
]))
|
||||
);
|
||||
let tex=mb.acquire_tex_id(glam::Vec2::ZERO);
|
||||
let normal=mb.acquire_normal_id(vec3::ZERO);
|
||||
let color=mb.acquire_color_id(glam::Vec4::ONE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user