Compare commits
1 Commits
master
...
zero-verti
| Author | SHA1 | Date | |
|---|---|---|---|
|
fd82fa6203
|
@@ -9,6 +9,7 @@ use crate::loader::MeshWithSize;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error{
|
||||
ZeroVertices,
|
||||
RbxMesh(rbx_mesh::mesh::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{
|
||||
aabb.grow(point);
|
||||
}
|
||||
if mesh.unique_vertices.is_empty(){
|
||||
return Err(Error::ZeroVertices);
|
||||
}
|
||||
Ok(MeshWithSize{mesh,size:aabb.size()})
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use strafesnet_common::integer::vec3;
|
||||
#[derive(Debug)]
|
||||
pub enum Error{
|
||||
Block,
|
||||
ZeroVertices,
|
||||
MissingVertexId(u32),
|
||||
Planar64Vec3(strafesnet_common::integer::Planar64TryFromFloatError),
|
||||
RobloxPhysicsData(rbx_mesh::physics_data::Error),
|
||||
@@ -265,6 +266,9 @@ pub fn convert(
|
||||
graphics_groups,
|
||||
physics_groups,
|
||||
);
|
||||
if mesh.unique_vertices.is_empty(){
|
||||
return Err(Error::ZeroVertices);
|
||||
}
|
||||
Ok(MeshWithSize{
|
||||
mesh,
|
||||
size:vec3::ONE,
|
||||
|
||||
Reference in New Issue
Block a user