Merge branch 'objTessellation' of github.com:MachineMuse/MinecraftForge into sometweaks
This commit is contained in:
commit
e499a6d375
|
@ -5,5 +5,7 @@ package net.minecraftforge.client.model;
|
||||||
public interface IModelCustom {
|
public interface IModelCustom {
|
||||||
String getType();
|
String getType();
|
||||||
void renderAll();
|
void renderAll();
|
||||||
|
void renderOnly(String... groupNames);
|
||||||
void renderPart(String partName);
|
void renderPart(String partName);
|
||||||
|
void renderAllExcept(String... excludedGroupNames);
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,13 +181,17 @@ public class WavefrontObject implements IModelCustom
|
||||||
{
|
{
|
||||||
tessellator.startDrawing(GL11.GL_TRIANGLES);
|
tessellator.startDrawing(GL11.GL_TRIANGLES);
|
||||||
}
|
}
|
||||||
|
tessellateAll(tessellator);
|
||||||
|
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void tessellateAll(Tessellator tessellator)
|
||||||
|
{
|
||||||
for (GroupObject groupObject : groupObjects)
|
for (GroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
groupObject.render(tessellator);
|
groupObject.render(tessellator);
|
||||||
}
|
}
|
||||||
|
|
||||||
tessellator.draw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderOnly(String... groupNames)
|
public void renderOnly(String... groupNames)
|
||||||
|
@ -204,6 +208,19 @@ public class WavefrontObject implements IModelCustom
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void tessellateOnly(Tessellator tessellator, String... groupNames) {
|
||||||
|
for (GroupObject groupObject : groupObjects)
|
||||||
|
{
|
||||||
|
for (String groupName : groupNames)
|
||||||
|
{
|
||||||
|
if (groupName.equalsIgnoreCase(groupObject.name))
|
||||||
|
{
|
||||||
|
groupObject.render(tessellator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void renderPart(String partName)
|
public void renderPart(String partName)
|
||||||
{
|
{
|
||||||
for (GroupObject groupObject : groupObjects)
|
for (GroupObject groupObject : groupObjects)
|
||||||
|
@ -215,18 +232,54 @@ public class WavefrontObject implements IModelCustom
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderAllExcept(String... excludedGroupNames)
|
public void tessellatePart(Tessellator tessellator, String partName) {
|
||||||
{
|
|
||||||
for (GroupObject groupObject : groupObjects)
|
for (GroupObject groupObject : groupObjects)
|
||||||
{
|
{
|
||||||
|
if (partName.equalsIgnoreCase(groupObject.name))
|
||||||
|
{
|
||||||
|
groupObject.render(tessellator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderAllExcept(String... excludedGroupNames)
|
||||||
|
{
|
||||||
|
boolean exclude;
|
||||||
|
for (GroupObject groupObject : groupObjects)
|
||||||
|
{
|
||||||
|
exclude=false;
|
||||||
for (String excludedGroupName : excludedGroupNames)
|
for (String excludedGroupName : excludedGroupNames)
|
||||||
{
|
{
|
||||||
if (!excludedGroupName.equalsIgnoreCase(groupObject.name))
|
if (excludedGroupName.equalsIgnoreCase(groupObject.name))
|
||||||
|
{
|
||||||
|
exclude=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!exclude)
|
||||||
{
|
{
|
||||||
groupObject.render();
|
groupObject.render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void tessellateAllExcept(Tessellator tessellator, String... excludedGroupNames)
|
||||||
|
{
|
||||||
|
boolean exclude;
|
||||||
|
for (GroupObject groupObject : groupObjects)
|
||||||
|
{
|
||||||
|
exclude=false;
|
||||||
|
for (String excludedGroupName : excludedGroupNames)
|
||||||
|
{
|
||||||
|
if (excludedGroupName.equalsIgnoreCase(groupObject.name))
|
||||||
|
{
|
||||||
|
exclude=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!exclude)
|
||||||
|
{
|
||||||
|
groupObject.render(tessellator);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vertex parseVertex(String line, int lineCount) throws ModelFormatException
|
private Vertex parseVertex(String line, int lineCount) throws ModelFormatException
|
||||||
|
|
Loading…
Reference in New Issue