pub fn mesh_to_trimesh(&mut self, root: Handle<Node>, graph: &Graph) -> RigidBodyHandle {
        let shape = Self::make_trimesh(root, graph);
        let tri_mesh = ColliderBuilder::new(shape).friction(0.0).build();
        let (global_rotation, global_position) = graph.isometric_global_rotation_position(root);
        let body = RigidBodyBuilder::new(BodyStatus::Static)
            .position(Isometry3 {
                rotation: global_rotation,
                translation: Translation {
                    vector: global_position,
                },
            })
            .build();
        let handle = self.add_body(body);
        self.add_collider(tri_mesh, &handle);
        handle
    }
/// Small helper that creates static physics geometry from given mesh.
///
/// # Notes
///
/// This method *bakes* global transform of given mesh into static geometry
/// data. So if given mesh was at some position with any rotation and scale
/// resulting static geometry will have vertices that exactly matches given
/// mesh.
Small helper that creates static physics geometry from given mesh.
Small helper that creates static physics geometry from given mesh .
pub fn mesh_to_trimesh(&mut self, root: Handle<Node>, graph: &Graph) -> RigidBodyHandle {
        let shape = Self::make_trimesh(root, graph);
        let tri_mesh = ColliderBuilder::new(shape).friction(0.0).build();
        let (global_rotation, global_position) = graph.isometric_global_rotation_position(root);
        let body = RigidBodyBuilder::new(BodyStatus::Static)
            .position(Isometry3 {
                rotation: global_rotation,
                translation: Translation {
                    vector: global_position,
                },
            })
            .build();
        let handle = self.add_body(body);
        self.add_collider(tri_mesh, &handle);
        handle
    }
pub fn mesh_to_trimesh ( & mut self , root : Handle < Node > , graph : & Graph ) -> RigidBodyHandle { let shape = Self :: make_trimesh ( root , graph ) ; let tri_mesh = ColliderBuilder :: new ( shape ) . friction ( 0.0 ) . build ( ) ; let ( global_rotation , global_position ) = graph . isometric_global_rotation_position ( root ) ; let body = RigidBodyBuilder :: new ( BodyStatus :: Static ) . position ( Isometry3 { rotation : global_rotation , translation : Translation { vector : global_position , } , } ) . build ( ) ; let handle = self . add_body ( body ) ; self . add_collider ( tri_mesh , & handle ) ; handle }
Small helper that creates static physics geometry from given mesh.
Small helper that creates static physics geometry from given mesh .
&mut self
root
Handle<Node>
graph
&Graph
notes
This method *bakes* global transform of given mesh into static geometry
data. So if given mesh was at some position with any rotation and scale
resulting static geometry will have vertices that exactly matches given
mesh.
This method * bakes * global transform of given mesh into static geometry data . So if given mesh was at some position with any rotation and scale resulting static geometry will have vertices that exactly matches given mesh .