diff --git a/src/model_physics.rs b/src/model_physics.rs index 0815e4f..dc9e342 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -342,9 +342,9 @@ impl TryFrom<&model::Mesh> for PhysicsMesh{ let v0=mesh.unique_pos[vert0_id.get() as usize]; let v1=mesh.unique_pos[vert1_id.get() as usize]; normal+=Planar64Vec3::new( - (v0.y()-v1.y())*(v0.z()+v1.z()), - (v0.z()-v1.z())*(v0.x()+v1.x()), - (v0.x()-v1.x())*(v0.y()+v1.y()), + (v0.y-v1.y)*(v0.z+v1.z), + (v0.z-v1.z)*(v0.x+v1.x), + (v0.x-v1.x)*(v0.y+v1.y), ); //get/create edge and push face into it let (edge_ref_verts,is_sorted)=EdgeRefVerts::new(submesh_vert0_id,submesh_vert1_id); @@ -955,7 +955,7 @@ fn is_empty_volume(normals:Vec)->bool{ if k!=i&&k!=j{ let d=n.dot(normals[k]); if let Some(comp)=&d_comp{ - if *comp*d>1, mesh, transform, } @@ -475,7 +475,7 @@ impl StyleHelper for StyleModifiers{ gameplay_style::HitboxMesh::Box=>PhysicsMesh::unit_cube(), gameplay_style::HitboxMesh::Cylinder=>PhysicsMesh::unit_cylinder(), }; - let transform=integer::Planar64Affine3::new(Planar64Mat3::from_diagonal(self.hitbox.halfsize),Planar64Vec3::ZERO); + let transform=Planar64Mat3::from_diagonal(self.hitbox.halfsize).extend(Planar64Vec3::ZERO); HitboxMesh::new(mesh,transform) } } @@ -851,20 +851,20 @@ impl Body{ aabb.grow(self.extrapolated_position(t1)); //v+a*t==0 //goober code - if self.acceleration.x()!=Planar64::ZERO{ - let t=Time::from(-self.velocity.x()/self.acceleration.x()); + if self.acceleration.x!=Planar64::ZERO{ + let t=Time::from(-self.velocity.x/self.acceleration.x); if t0Result<(),TeleportToSpawnError>{ + const EPSILON:Planar64=Planar64::raw((1<<32)/16); let transform=models.get_model_transform(stage.spawn()).ok_or(TeleportToSpawnError::NoModel)?; - let point=transform.vertex.transform_point3(Planar64Vec3::Y)+Planar64Vec3::Y*(style.hitbox.halfsize.y()+Planar64::ONE/16); + let point=transform.vertex.y_axis+Planar64Vec3::new([Planar64::ZERO,style.hitbox.halfsize.y+EPSILON,Planar64::ZERO]); teleport(point,move_state,body,touching,run,mode_state,Some(mode),models,hitbox_mesh,bvh,style,camera,input_state,time); Ok(()) }