forked from StrafesNET/strafe-client
lol idk #1
@ -419,10 +419,8 @@ impl GraphicsState{
|
||||
//this mut be combined in a more complex way if the models use different render patterns per group
|
||||
let mut indices=Vec::new();
|
||||
for poly in model.polys.polys(){
|
||||
for end_index in 2..poly.len(){
|
||||
for index in [0,end_index-1,end_index]{
|
||||
let vertex_index=poly[index];
|
||||
indices.push(*index_from_vertex.entry(vertex_index).or_insert_with(||{
|
||||
let mut poly_vertices=poly.iter()
|
||||
.map(|&vertex_index|*index_from_vertex.entry(vertex_index).or_insert_with(||{
|
||||
let i=vertices.len();
|
||||
let vertex=&model.unique_vertices[vertex_index.get() as usize];
|
||||
vertices.push(GraphicsVertex{
|
||||
@ -433,8 +431,14 @@ impl GraphicsState{
|
||||
});
|
||||
i
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
let a=poly_vertices.next().unwrap();
|
||||
let mut b=poly_vertices.next().unwrap();
|
||||
|
||||
poly_vertices.for_each(|c|{
|
||||
indices.extend([a,b,c]);
|
||||
b=c;
|
||||
});
|
||||
}
|
||||
GraphicsMeshOwnedRenderConfig{
|
||||
instances:model.instances,
|
||||
|
Loading…
Reference in New Issue
Block a user