mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-11 07:47:47 +00:00
Optimised render transformations.
Added documentation to ExtendedMOP.dist Added expand function to CCModel.
This commit is contained in:
1 parent
6a29a2428f
commit
f5bbe9d2da
3 files changed
+21
-4
No files matched your search
@@ -7,6 +7,9 @@ import net.minecraft.util.Vec3;
|
||||
public class ExtendedMOP extends MovingObjectPosition implements Comparable<ExtendedMOP>
|
||||
{
|
||||
public Object data;
|
||||
/**
|
||||
* The square distance from the start of the raytrace.
|
||||
*/
|
||||
public double dist;
|
||||
|
||||
public ExtendedMOP(Entity entity, Object data)
|
||||
|
||||
@@ -355,6 +355,17 @@ public class CCModel
|
||||
return this;
|
||||
}
|
||||
|
||||
public CCModel expand(int extraVerts)
|
||||
{
|
||||
int newLen = verts.length+extraVerts;
|
||||
verts = Arrays.copyOf(verts, newLen);
|
||||
if(normals != null)
|
||||
normals = Arrays.copyOf(normals, newLen);
|
||||
if(colours != null)
|
||||
colours = Arrays.copyOf(colours, newLen);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void render()
|
||||
{
|
||||
render(0, verts.length, null, null, null);
|
||||
|
||||
@@ -51,8 +51,8 @@ public class TransformationList extends Transformation
|
||||
if(mat != null)
|
||||
mat.apply(vec);
|
||||
else
|
||||
for(Transformation t : transformations)
|
||||
t.apply(vec);
|
||||
for(int i = 0; i < transformations.size(); i++)
|
||||
transformations.get(i).apply(vec);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,8 +61,8 @@ public class TransformationList extends Transformation
|
||||
if(mat != null)
|
||||
mat.applyN(normal);
|
||||
else
|
||||
for(Transformation t : transformations)
|
||||
t.applyN(normal);
|
||||
for(int i = 0; i < transformations.size(); i++)
|
||||
transformations.get(i).applyN(normal);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,6 +129,9 @@ public class TransformationList extends Transformation
|
||||
transformations = newList;
|
||||
mat = null;
|
||||
}
|
||||
|
||||
if(transformations.size() > 3 && mat == null)
|
||||
compile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user