Compare commits
1 Commits
debug-26
...
zero-verti
| Author | SHA1 | Date | |
|---|---|---|---|
|
fd82fa6203
|
@@ -9,6 +9,7 @@ use crate::loader::MeshWithSize;
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error{
|
pub enum Error{
|
||||||
|
ZeroVertices,
|
||||||
RbxMesh(rbx_mesh::mesh::Error)
|
RbxMesh(rbx_mesh::mesh::Error)
|
||||||
}
|
}
|
||||||
impl std::fmt::Display for Error{
|
impl std::fmt::Display for Error{
|
||||||
@@ -143,5 +144,8 @@ pub fn convert(roblox_mesh_bytes:crate::data::RobloxMeshBytes)->Result<MeshWithS
|
|||||||
for &point in &mesh.unique_pos{
|
for &point in &mesh.unique_pos{
|
||||||
aabb.grow(point);
|
aabb.grow(point);
|
||||||
}
|
}
|
||||||
|
if mesh.unique_vertices.is_empty(){
|
||||||
|
return Err(Error::ZeroVertices);
|
||||||
|
}
|
||||||
Ok(MeshWithSize{mesh,size:aabb.size()})
|
Ok(MeshWithSize{mesh,size:aabb.size()})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ use strafesnet_common::integer::vec3;
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error{
|
pub enum Error{
|
||||||
Block,
|
Block,
|
||||||
|
ZeroVertices,
|
||||||
MissingVertexId(u32),
|
MissingVertexId(u32),
|
||||||
Planar64Vec3(strafesnet_common::integer::Planar64TryFromFloatError),
|
Planar64Vec3(strafesnet_common::integer::Planar64TryFromFloatError),
|
||||||
RobloxPhysicsData(rbx_mesh::physics_data::Error),
|
RobloxPhysicsData(rbx_mesh::physics_data::Error),
|
||||||
@@ -265,6 +266,9 @@ pub fn convert(
|
|||||||
graphics_groups,
|
graphics_groups,
|
||||||
physics_groups,
|
physics_groups,
|
||||||
);
|
);
|
||||||
|
if mesh.unique_vertices.is_empty(){
|
||||||
|
return Err(Error::ZeroVertices);
|
||||||
|
}
|
||||||
Ok(MeshWithSize{
|
Ok(MeshWithSize{
|
||||||
mesh,
|
mesh,
|
||||||
size:vec3::ONE,
|
size:vec3::ONE,
|
||||||
|
|||||||
Reference in New Issue
Block a user