QuadRotator performance, QaudMatrixTransformer should update orientation

This commit is contained in:
covers1624
2020-06-03 20:53:49 +09:30
parent 1e2e34ac54
commit 64651feb3c
2 changed files with 12 additions and 12 deletions
@@ -51,6 +51,11 @@ public class QuadRotator
{
return quads; // This is the default orientation
}
FacingToRotation rotation = getRotation( newForward, newUp );
if( rotation.isRedundant() )
{
return quads;
}
List<BakedQuad> result = new ArrayList<>( quads.size() );
@@ -63,18 +68,10 @@ public class QuadRotator
for( BakedQuad quad : quads )
{
FacingToRotation rotation = getRotation( newForward, newUp );
if( rotation.isRedundant() )
{
result.add( quad );//Redundant rotation, just don't do anything.
}
else
{
transformer.setMatrix( rotation.getMat() );
pipeline.prepare( collector );
quad.pipe( pipeline );
result.add( collector.bake() );
}
transformer.setMatrix( rotation.getMat() );
pipeline.prepare( collector );
quad.pipe( pipeline );
result.add( collector.bake() );
}
return result;