Use TempVars for triangle processing instead of explicit allocations, speeds up processing by around 30%
This commit is contained in:
parent
93b3b744f3
commit
ae9f281976
@ -556,14 +556,16 @@ public class TangentBinormalGenerator {
|
|||||||
|
|
||||||
public static TriangleData processTriangle(int[] index,
|
public static TriangleData processTriangle(int[] index,
|
||||||
Vector3f[] v, Vector2f[] t) {
|
Vector3f[] v, Vector2f[] t) {
|
||||||
Vector3f edge1 = new Vector3f();
|
TempVars tmp = TempVars.get();
|
||||||
Vector3f edge2 = new Vector3f();
|
try {
|
||||||
Vector2f edge1uv = new Vector2f();
|
Vector3f edge1 = tmp.vect1;
|
||||||
Vector2f edge2uv = new Vector2f();
|
Vector3f edge2 = tmp.vect2;
|
||||||
|
Vector2f edge1uv = tmp.vect2d;
|
||||||
|
Vector2f edge2uv = tmp.vect2d2;
|
||||||
|
|
||||||
Vector3f tangent = new Vector3f();
|
Vector3f tangent = tmp.vect3;
|
||||||
Vector3f binormal = new Vector3f();
|
Vector3f binormal = tmp.vect4;
|
||||||
Vector3f normal = new Vector3f();
|
Vector3f normal = tmp.vect5;
|
||||||
|
|
||||||
t[1].subtract(t[0], edge1uv);
|
t[1].subtract(t[0], edge1uv);
|
||||||
t[2].subtract(t[0], edge2uv);
|
t[2].subtract(t[0], edge2uv);
|
||||||
@ -617,6 +619,9 @@ public class TangentBinormalGenerator {
|
|||||||
tangent,
|
tangent,
|
||||||
binormal,
|
binormal,
|
||||||
normal);
|
normal);
|
||||||
|
} finally {
|
||||||
|
tmp.release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setToleranceAngle(float angle) {
|
public static void setToleranceAngle(float angle) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user