constexpr void build_positions(Sph sphere, OutputIt output) const noexcept
 {
   build_vertices(
    output, [=](auto norm) noexcept {
      return sphere.center + norm * sphere.radius;
    });
 }
示例#2
0
Mesh* mesh_init_model() {
	/*	
	float gap_x = (320.0/512.0) * 1.0/CLOTH_WIDTH;
	float gap_y = (480.0/512.0) * 1.0/CLOTH_HEIGHT;	
	*/
	
	NSLog(@"rezerwacja pamieci dla mesh_ptr");			
	Mesh* mesh_ptr = (Mesh*)alloc_mem(1, sizeof(Mesh));
	
	build_vertices(mesh_ptr);
	build_constraints(mesh_ptr);
	build_triangles(mesh_ptr);

	mesh_ptr->touch.size = 0;
	memset(mesh_ptr->touch.vindex, 0, sizeof(int) * 5);
	
	mesh_ptr->use_texture = true;
	mesh_ptr->use_tearing = false;
	
	return mesh_ptr;
};
 constexpr void fill_vertices(TVertex atex, OutputIt output) const noexcept
 {
   build_vertices(
    output, [=](auto) noexcept { return atex; });
 }
 constexpr void build_normals(OutputIt output) const noexcept
 {
   build_vertices(
    output, [](auto norm) noexcept { return norm; });
 }