Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -12,45 +12,40 @@ public class ModelDefinition
|
||||
public int id;
|
||||
|
||||
public int vertexCount = 0;
|
||||
public int[] vertexPositionsX;
|
||||
public int[] vertexPositionsY;
|
||||
public int[] vertexPositionsZ;
|
||||
public int[] vertexX;
|
||||
public int[] vertexY;
|
||||
public int[] vertexZ;
|
||||
public transient VertexNormal[] vertexNormals;
|
||||
|
||||
public int faceCount;
|
||||
public int[] faceVertexIndices1;
|
||||
public int[] faceVertexIndices2;
|
||||
public int[] faceVertexIndices3;
|
||||
public byte[] faceAlphas;
|
||||
public int[] faceIndices1;
|
||||
public int[] faceIndices2;
|
||||
public int[] faceIndices3;
|
||||
public byte[] faceTransparencies;
|
||||
public short[] faceColors;
|
||||
public byte[] faceRenderPriorities;
|
||||
public byte[] faceRenderTypes;
|
||||
public transient FaceNormal[] faceNormals;
|
||||
|
||||
public int textureTriangleCount;
|
||||
public short[] textureTriangleVertexIndices1;
|
||||
public short[] textureTriangleVertexIndices2;
|
||||
public short[] textureTriangleVertexIndices3;
|
||||
public int numTextureFaces;
|
||||
public short[] texIndices1;
|
||||
public short[] texIndices2;
|
||||
public short[] texIndices3;
|
||||
public transient float[][] faceTextureUCoordinates;
|
||||
public transient float[][] faceTextureVCoordinates;
|
||||
public short[] texturePrimaryColors;
|
||||
public short[] faceTextures;
|
||||
public byte[] textureCoordinates;
|
||||
public byte[] textureCoords;
|
||||
public byte[] textureRenderTypes;
|
||||
|
||||
public int[] vertexSkins;
|
||||
public int[] faceSkins;
|
||||
public int[] packedVertexGroups;
|
||||
public int[] packedTransparencyVertexGroups;
|
||||
|
||||
public byte priority;
|
||||
|
||||
public short[] aShortArray2574;
|
||||
public short[] aShortArray2575;
|
||||
public short[] aShortArray2577;
|
||||
public short[] aShortArray2578;
|
||||
public byte[] aByteArray2580;
|
||||
public short[] aShortArray2586;
|
||||
|
||||
private transient int[][] vertexGroups;
|
||||
public int[][] animayaGroups;
|
||||
public int[][] animayaScales;
|
||||
|
||||
private transient int[] origVX;
|
||||
private transient int[] origVY;
|
||||
@@ -77,17 +72,17 @@ public class ModelDefinition
|
||||
|
||||
for (var1 = 0; var1 < this.faceCount; ++var1)
|
||||
{
|
||||
int vertexA = this.faceVertexIndices1[var1];
|
||||
int vertexB = this.faceVertexIndices2[var1];
|
||||
int vertexC = this.faceVertexIndices3[var1];
|
||||
int vertexA = this.faceIndices1[var1];
|
||||
int vertexB = this.faceIndices2[var1];
|
||||
int vertexC = this.faceIndices3[var1];
|
||||
|
||||
int xA = this.vertexPositionsX[vertexB] - this.vertexPositionsX[vertexA];
|
||||
int yA = this.vertexPositionsY[vertexB] - this.vertexPositionsY[vertexA];
|
||||
int zA = this.vertexPositionsZ[vertexB] - this.vertexPositionsZ[vertexA];
|
||||
int xA = this.vertexX[vertexB] - this.vertexX[vertexA];
|
||||
int yA = this.vertexY[vertexB] - this.vertexY[vertexA];
|
||||
int zA = this.vertexZ[vertexB] - this.vertexZ[vertexA];
|
||||
|
||||
int xB = this.vertexPositionsX[vertexC] - this.vertexPositionsX[vertexA];
|
||||
int yB = this.vertexPositionsY[vertexC] - this.vertexPositionsY[vertexA];
|
||||
int zB = this.vertexPositionsZ[vertexC] - this.vertexPositionsZ[vertexA];
|
||||
int xB = this.vertexX[vertexC] - this.vertexX[vertexA];
|
||||
int yB = this.vertexY[vertexC] - this.vertexY[vertexA];
|
||||
int zB = this.vertexZ[vertexC] - this.vertexZ[vertexA];
|
||||
|
||||
// Compute cross product
|
||||
int var11 = yA * zB - yB * zA;
|
||||
@@ -168,13 +163,13 @@ public class ModelDefinition
|
||||
for (int i = 0; i < faceCount; i++)
|
||||
{
|
||||
int textureCoordinate;
|
||||
if (textureCoordinates == null)
|
||||
if (textureCoords == null)
|
||||
{
|
||||
textureCoordinate = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
textureCoordinate = textureCoordinates[i];
|
||||
textureCoordinate = textureCoords[i];
|
||||
}
|
||||
|
||||
int textureIdx;
|
||||
@@ -215,33 +210,33 @@ public class ModelDefinition
|
||||
|
||||
if (textureRenderType == 0)
|
||||
{
|
||||
int faceVertexIdx1 = faceVertexIndices1[i];
|
||||
int faceVertexIdx2 = faceVertexIndices2[i];
|
||||
int faceVertexIdx3 = faceVertexIndices3[i];
|
||||
int faceVertexIdx1 = faceIndices1[i];
|
||||
int faceVertexIdx2 = faceIndices2[i];
|
||||
int faceVertexIdx3 = faceIndices3[i];
|
||||
|
||||
short triangleVertexIdx1 = textureTriangleVertexIndices1[textureCoordinate];
|
||||
short triangleVertexIdx2 = textureTriangleVertexIndices2[textureCoordinate];
|
||||
short triangleVertexIdx3 = textureTriangleVertexIndices3[textureCoordinate];
|
||||
short triangleVertexIdx1 = texIndices1[textureCoordinate];
|
||||
short triangleVertexIdx2 = texIndices2[textureCoordinate];
|
||||
short triangleVertexIdx3 = texIndices3[textureCoordinate];
|
||||
|
||||
float triangleX = (float) vertexPositionsX[triangleVertexIdx1];
|
||||
float triangleY = (float) vertexPositionsY[triangleVertexIdx1];
|
||||
float triangleZ = (float) vertexPositionsZ[triangleVertexIdx1];
|
||||
float triangleX = (float) vertexX[triangleVertexIdx1];
|
||||
float triangleY = (float) vertexY[triangleVertexIdx1];
|
||||
float triangleZ = (float) vertexZ[triangleVertexIdx1];
|
||||
|
||||
float f_882_ = (float) vertexPositionsX[triangleVertexIdx2] - triangleX;
|
||||
float f_883_ = (float) vertexPositionsY[triangleVertexIdx2] - triangleY;
|
||||
float f_884_ = (float) vertexPositionsZ[triangleVertexIdx2] - triangleZ;
|
||||
float f_885_ = (float) vertexPositionsX[triangleVertexIdx3] - triangleX;
|
||||
float f_886_ = (float) vertexPositionsY[triangleVertexIdx3] - triangleY;
|
||||
float f_887_ = (float) vertexPositionsZ[triangleVertexIdx3] - triangleZ;
|
||||
float f_888_ = (float) vertexPositionsX[faceVertexIdx1] - triangleX;
|
||||
float f_889_ = (float) vertexPositionsY[faceVertexIdx1] - triangleY;
|
||||
float f_890_ = (float) vertexPositionsZ[faceVertexIdx1] - triangleZ;
|
||||
float f_891_ = (float) vertexPositionsX[faceVertexIdx2] - triangleX;
|
||||
float f_892_ = (float) vertexPositionsY[faceVertexIdx2] - triangleY;
|
||||
float f_893_ = (float) vertexPositionsZ[faceVertexIdx2] - triangleZ;
|
||||
float f_894_ = (float) vertexPositionsX[faceVertexIdx3] - triangleX;
|
||||
float f_895_ = (float) vertexPositionsY[faceVertexIdx3] - triangleY;
|
||||
float f_896_ = (float) vertexPositionsZ[faceVertexIdx3] - triangleZ;
|
||||
float f_882_ = (float) vertexX[triangleVertexIdx2] - triangleX;
|
||||
float f_883_ = (float) vertexY[triangleVertexIdx2] - triangleY;
|
||||
float f_884_ = (float) vertexZ[triangleVertexIdx2] - triangleZ;
|
||||
float f_885_ = (float) vertexX[triangleVertexIdx3] - triangleX;
|
||||
float f_886_ = (float) vertexY[triangleVertexIdx3] - triangleY;
|
||||
float f_887_ = (float) vertexZ[triangleVertexIdx3] - triangleZ;
|
||||
float f_888_ = (float) vertexX[faceVertexIdx1] - triangleX;
|
||||
float f_889_ = (float) vertexY[faceVertexIdx1] - triangleY;
|
||||
float f_890_ = (float) vertexZ[faceVertexIdx1] - triangleZ;
|
||||
float f_891_ = (float) vertexX[faceVertexIdx2] - triangleX;
|
||||
float f_892_ = (float) vertexY[faceVertexIdx2] - triangleY;
|
||||
float f_893_ = (float) vertexZ[faceVertexIdx2] - triangleZ;
|
||||
float f_894_ = (float) vertexX[faceVertexIdx3] - triangleX;
|
||||
float f_895_ = (float) vertexY[faceVertexIdx3] - triangleY;
|
||||
float f_896_ = (float) vertexZ[faceVertexIdx3] - triangleZ;
|
||||
|
||||
float f_897_ = f_883_ * f_887_ - f_884_ * f_886_;
|
||||
float f_898_ = f_884_ * f_885_ - f_882_ * f_887_;
|
||||
@@ -274,7 +269,7 @@ public class ModelDefinition
|
||||
|
||||
public void computeAnimationTables()
|
||||
{
|
||||
if (this.vertexSkins != null)
|
||||
if (this.packedVertexGroups != null)
|
||||
{
|
||||
int[] groupCounts = new int[256];
|
||||
int numGroups = 0;
|
||||
@@ -282,7 +277,7 @@ public class ModelDefinition
|
||||
|
||||
for (var3 = 0; var3 < this.vertexCount; ++var3)
|
||||
{
|
||||
var4 = this.vertexSkins[var3];
|
||||
var4 = this.packedVertexGroups[var3];
|
||||
++groupCounts[var4];
|
||||
if (var4 > numGroups)
|
||||
{
|
||||
@@ -300,10 +295,10 @@ public class ModelDefinition
|
||||
|
||||
for (var3 = 0; var3 < this.vertexCount; this.vertexGroups[var4][groupCounts[var4]++] = var3++)
|
||||
{
|
||||
var4 = this.vertexSkins[var3];
|
||||
var4 = this.packedVertexGroups[var3];
|
||||
}
|
||||
|
||||
this.vertexSkins = null;
|
||||
this.packedVertexGroups = null;
|
||||
}
|
||||
|
||||
// triangleSkinValues is here
|
||||
@@ -314,13 +309,13 @@ public class ModelDefinition
|
||||
int sin = CircularAngle.SINE[orientation];
|
||||
int cos = CircularAngle.COSINE[orientation];
|
||||
|
||||
assert vertexPositionsX.length == vertexPositionsY.length;
|
||||
assert vertexPositionsY.length == vertexPositionsZ.length;
|
||||
assert vertexX.length == vertexY.length;
|
||||
assert vertexY.length == vertexZ.length;
|
||||
|
||||
for (int i = 0; i < vertexPositionsX.length; ++i)
|
||||
for (int i = 0; i < vertexX.length; ++i)
|
||||
{
|
||||
vertexPositionsX[i] = vertexPositionsX[i] * cos + vertexPositionsZ[i] * sin >> 16;
|
||||
vertexPositionsZ[i] = vertexPositionsZ[i] * cos - vertexPositionsX[i] * sin >> 16;
|
||||
vertexX[i] = vertexX[i] * cos + vertexZ[i] * sin >> 16;
|
||||
vertexZ[i] = vertexZ[i] * cos - vertexX[i] * sin >> 16;
|
||||
}
|
||||
|
||||
reset();
|
||||
@@ -333,23 +328,23 @@ public class ModelDefinition
|
||||
return;
|
||||
}
|
||||
|
||||
System.arraycopy(origVX, 0, vertexPositionsX, 0, origVX.length);
|
||||
System.arraycopy(origVY, 0, vertexPositionsY, 0, origVY.length);
|
||||
System.arraycopy(origVZ, 0, vertexPositionsZ, 0, origVZ.length);
|
||||
System.arraycopy(origVX, 0, vertexX, 0, origVX.length);
|
||||
System.arraycopy(origVY, 0, vertexY, 0, origVY.length);
|
||||
System.arraycopy(origVZ, 0, vertexZ, 0, origVZ.length);
|
||||
}
|
||||
|
||||
public void animate(int type, int[] frameMap, int dx, int dy, int dz)
|
||||
{
|
||||
if (origVX == null)
|
||||
{
|
||||
origVX = Arrays.copyOf(vertexPositionsX, vertexPositionsX.length);
|
||||
origVY = Arrays.copyOf(vertexPositionsY, vertexPositionsY.length);
|
||||
origVZ = Arrays.copyOf(vertexPositionsZ, vertexPositionsZ.length);
|
||||
origVX = Arrays.copyOf(vertexX, vertexX.length);
|
||||
origVY = Arrays.copyOf(vertexY, vertexY.length);
|
||||
origVZ = Arrays.copyOf(vertexZ, vertexZ.length);
|
||||
}
|
||||
|
||||
final int[] verticesX = vertexPositionsX;
|
||||
final int[] verticesY = vertexPositionsY;
|
||||
final int[] verticesZ = vertexPositionsZ;
|
||||
final int[] verticesX = vertexX;
|
||||
final int[] verticesY = vertexY;
|
||||
final int[] verticesZ = vertexZ;
|
||||
int var6 = frameMap.length;
|
||||
int var7;
|
||||
int var8;
|
||||
@@ -512,14 +507,14 @@ public class ModelDefinition
|
||||
int var1;
|
||||
for (var1 = 0; var1 < this.vertexCount; ++var1)
|
||||
{
|
||||
this.vertexPositionsZ[var1] = -this.vertexPositionsZ[var1];
|
||||
this.vertexZ[var1] = -this.vertexZ[var1];
|
||||
}
|
||||
|
||||
for (var1 = 0; var1 < this.faceCount; ++var1)
|
||||
{
|
||||
int var2 = this.faceVertexIndices1[var1];
|
||||
this.faceVertexIndices1[var1] = this.faceVertexIndices3[var1];
|
||||
this.faceVertexIndices3[var1] = var2;
|
||||
int var2 = this.faceIndices1[var1];
|
||||
this.faceIndices1[var1] = this.faceIndices3[var1];
|
||||
this.faceIndices3[var1] = var2;
|
||||
}
|
||||
|
||||
reset();
|
||||
@@ -529,9 +524,9 @@ public class ModelDefinition
|
||||
{
|
||||
for (int var1 = 0; var1 < this.vertexCount; ++var1)
|
||||
{
|
||||
int var2 = this.vertexPositionsX[var1];
|
||||
this.vertexPositionsX[var1] = this.vertexPositionsZ[var1];
|
||||
this.vertexPositionsZ[var1] = -var2;
|
||||
int var2 = this.vertexX[var1];
|
||||
this.vertexX[var1] = this.vertexZ[var1];
|
||||
this.vertexZ[var1] = -var2;
|
||||
}
|
||||
|
||||
reset();
|
||||
@@ -541,8 +536,8 @@ public class ModelDefinition
|
||||
{
|
||||
for (int var1 = 0; var1 < this.vertexCount; ++var1)
|
||||
{
|
||||
this.vertexPositionsX[var1] = -this.vertexPositionsX[var1];
|
||||
this.vertexPositionsZ[var1] = -this.vertexPositionsZ[var1];
|
||||
this.vertexX[var1] = -this.vertexX[var1];
|
||||
this.vertexZ[var1] = -this.vertexZ[var1];
|
||||
}
|
||||
|
||||
reset();
|
||||
@@ -552,9 +547,9 @@ public class ModelDefinition
|
||||
{
|
||||
for (int var1 = 0; var1 < this.vertexCount; ++var1)
|
||||
{
|
||||
int var2 = this.vertexPositionsZ[var1];
|
||||
this.vertexPositionsZ[var1] = this.vertexPositionsX[var1];
|
||||
this.vertexPositionsX[var1] = -var2;
|
||||
int var2 = this.vertexZ[var1];
|
||||
this.vertexZ[var1] = this.vertexX[var1];
|
||||
this.vertexX[var1] = -var2;
|
||||
}
|
||||
|
||||
reset();
|
||||
@@ -571,9 +566,9 @@ public class ModelDefinition
|
||||
{
|
||||
for (int var4 = 0; var4 < this.vertexCount; ++var4)
|
||||
{
|
||||
this.vertexPositionsX[var4] = this.vertexPositionsX[var4] * var1 / 128;
|
||||
this.vertexPositionsY[var4] = var2 * this.vertexPositionsY[var4] / 128;
|
||||
this.vertexPositionsZ[var4] = var3 * this.vertexPositionsZ[var4] / 128;
|
||||
this.vertexX[var4] = this.vertexX[var4] * var1 / 128;
|
||||
this.vertexY[var4] = var2 * this.vertexY[var4] / 128;
|
||||
this.vertexZ[var4] = var3 * this.vertexZ[var4] / 128;
|
||||
}
|
||||
|
||||
reset();
|
||||
@@ -610,9 +605,9 @@ public class ModelDefinition
|
||||
{
|
||||
for (int i = 0; i < this.vertexCount; i++)
|
||||
{
|
||||
this.vertexPositionsX[i] += xOffset;
|
||||
this.vertexPositionsY[i] += yOffset;
|
||||
this.vertexPositionsZ[i] += zOffset;
|
||||
this.vertexX[i] += xOffset;
|
||||
this.vertexY[i] += yOffset;
|
||||
this.vertexZ[i] += zOffset;
|
||||
}
|
||||
this.reset();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -227,22 +227,22 @@ public class ItemSpriteFactory
|
||||
litModel.field1856 = new int[def.faceCount];
|
||||
litModel.field1854 = new int[def.faceCount];
|
||||
litModel.field1823 = new int[def.faceCount];
|
||||
if (def.textureTriangleCount > 0 && def.textureCoordinates != null)
|
||||
if (def.numTextureFaces > 0 && def.textureCoords != null)
|
||||
{
|
||||
int[] var9 = new int[def.textureTriangleCount];
|
||||
int[] var9 = new int[def.numTextureFaces];
|
||||
|
||||
int var10;
|
||||
for (var10 = 0; var10 < def.faceCount; ++var10)
|
||||
{
|
||||
if (def.textureCoordinates[var10] != -1)
|
||||
if (def.textureCoords[var10] != -1)
|
||||
{
|
||||
++var9[def.textureCoordinates[var10] & 255];
|
||||
++var9[def.textureCoords[var10] & 255];
|
||||
}
|
||||
}
|
||||
|
||||
litModel.field1852 = 0;
|
||||
|
||||
for (var10 = 0; var10 < def.textureTriangleCount; ++var10)
|
||||
for (var10 = 0; var10 < def.numTextureFaces; ++var10)
|
||||
{
|
||||
if (var9[var10] > 0 && def.textureRenderTypes[var10] == 0)
|
||||
{
|
||||
@@ -256,13 +256,13 @@ public class ItemSpriteFactory
|
||||
var10 = 0;
|
||||
|
||||
|
||||
for (int i = 0; i < def.textureTriangleCount; ++i)
|
||||
for (int i = 0; i < def.numTextureFaces; ++i)
|
||||
{
|
||||
if (var9[i] > 0 && def.textureRenderTypes[i] == 0)
|
||||
{
|
||||
litModel.field1844[var10] = def.textureTriangleVertexIndices1[i] & '\uffff';
|
||||
litModel.field1865[var10] = def.textureTriangleVertexIndices2[i] & '\uffff';
|
||||
litModel.field1846[var10] = def.textureTriangleVertexIndices3[i] & '\uffff';
|
||||
litModel.field1844[var10] = def.texIndices1[i] & '\uffff';
|
||||
litModel.field1865[var10] = def.texIndices2[i] & '\uffff';
|
||||
litModel.field1846[var10] = def.texIndices3[i] & '\uffff';
|
||||
var9[i] = var10++;
|
||||
}
|
||||
else
|
||||
@@ -275,9 +275,9 @@ public class ItemSpriteFactory
|
||||
|
||||
for (int i = 0; i < def.faceCount; ++i)
|
||||
{
|
||||
if (def.textureCoordinates[i] != -1)
|
||||
if (def.textureCoords[i] != -1)
|
||||
{
|
||||
litModel.field1840[i] = (byte) var9[def.textureCoordinates[i] & 255];
|
||||
litModel.field1840[i] = (byte) var9[def.textureCoords[i] & 255];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -299,13 +299,13 @@ public class ItemSpriteFactory
|
||||
}
|
||||
|
||||
byte faceAlpha;
|
||||
if (def.faceAlphas == null)
|
||||
if (def.faceTransparencies == null)
|
||||
{
|
||||
faceAlpha = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
faceAlpha = def.faceAlphas[faceIdx];
|
||||
faceAlpha = def.faceTransparencies[faceIdx];
|
||||
}
|
||||
|
||||
short faceTexture;
|
||||
@@ -355,15 +355,15 @@ public class ItemSpriteFactory
|
||||
else
|
||||
{
|
||||
int var15 = def.faceColors[faceIdx] & '\uffff';
|
||||
vertexNormal = def.vertexNormals[def.faceVertexIndices1[faceIdx]];
|
||||
vertexNormal = def.vertexNormals[def.faceIndices1[faceIdx]];
|
||||
|
||||
tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient;
|
||||
litModel.field1856[faceIdx] = method2608(var15, tmp);
|
||||
vertexNormal = def.vertexNormals[def.faceVertexIndices2[faceIdx]];
|
||||
vertexNormal = def.vertexNormals[def.faceIndices2[faceIdx]];
|
||||
|
||||
tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient;
|
||||
litModel.field1854[faceIdx] = method2608(var15, tmp);
|
||||
vertexNormal = def.vertexNormals[def.faceVertexIndices3[faceIdx]];
|
||||
vertexNormal = def.vertexNormals[def.faceIndices3[faceIdx]];
|
||||
|
||||
tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient;
|
||||
litModel.field1823[faceIdx] = method2608(var15, tmp);
|
||||
@@ -385,15 +385,15 @@ public class ItemSpriteFactory
|
||||
}
|
||||
else
|
||||
{
|
||||
vertexNormal = def.vertexNormals[def.faceVertexIndices1[faceIdx]];
|
||||
vertexNormal = def.vertexNormals[def.faceIndices1[faceIdx]];
|
||||
|
||||
tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient;
|
||||
litModel.field1856[faceIdx] = bound2to126(tmp);
|
||||
vertexNormal = def.vertexNormals[def.faceVertexIndices2[faceIdx]];
|
||||
vertexNormal = def.vertexNormals[def.faceIndices2[faceIdx]];
|
||||
|
||||
tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient;
|
||||
litModel.field1854[faceIdx] = bound2to126(tmp);
|
||||
vertexNormal = def.vertexNormals[def.faceVertexIndices3[faceIdx]];
|
||||
vertexNormal = def.vertexNormals[def.faceIndices3[faceIdx]];
|
||||
|
||||
tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient;
|
||||
litModel.field1823[faceIdx] = bound2to126(tmp);
|
||||
@@ -401,15 +401,15 @@ public class ItemSpriteFactory
|
||||
}
|
||||
|
||||
litModel.verticesCount = def.vertexCount;
|
||||
litModel.verticesX = def.vertexPositionsX;
|
||||
litModel.verticesY = def.vertexPositionsY;
|
||||
litModel.verticesZ = def.vertexPositionsZ;
|
||||
litModel.verticesX = def.vertexX;
|
||||
litModel.verticesY = def.vertexY;
|
||||
litModel.verticesZ = def.vertexZ;
|
||||
litModel.indicesCount = def.faceCount;
|
||||
litModel.indices1 = def.faceVertexIndices1;
|
||||
litModel.indices2 = def.faceVertexIndices2;
|
||||
litModel.indices3 = def.faceVertexIndices3;
|
||||
litModel.indices1 = def.faceIndices1;
|
||||
litModel.indices2 = def.faceIndices2;
|
||||
litModel.indices3 = def.faceIndices3;
|
||||
litModel.field1838 = def.faceRenderPriorities;
|
||||
litModel.field1882 = def.faceAlphas;
|
||||
litModel.field1882 = def.faceTransparencies;
|
||||
litModel.field1842 = def.priority;
|
||||
litModel.field1841 = def.faceTextures;
|
||||
return litModel;
|
||||
|
||||
@@ -53,9 +53,9 @@ public class ObjExporter
|
||||
|
||||
for (int i = 0; i < model.vertexCount; ++i)
|
||||
{
|
||||
objWriter.println("v " + model.vertexPositionsX[i] + " "
|
||||
+ model.vertexPositionsY[i] * -1 + " "
|
||||
+ model.vertexPositionsZ[i] * -1);
|
||||
objWriter.println("v " + model.vertexX[i] + " "
|
||||
+ model.vertexY[i] * -1 + " "
|
||||
+ model.vertexZ[i] * -1);
|
||||
}
|
||||
|
||||
if (model.faceTextures != null)
|
||||
@@ -78,9 +78,9 @@ public class ObjExporter
|
||||
|
||||
for (int i = 0; i < model.faceCount; ++i)
|
||||
{
|
||||
int x = model.faceVertexIndices1[i] + 1;
|
||||
int y = model.faceVertexIndices2[i] + 1;
|
||||
int z = model.faceVertexIndices3[i] + 1;
|
||||
int x = model.faceIndices1[i] + 1;
|
||||
int y = model.faceIndices2[i] + 1;
|
||||
int z = model.faceIndices3[i] + 1;
|
||||
|
||||
objWriter.println("usemtl m" + i);
|
||||
if (model.faceTextures != null)
|
||||
@@ -129,9 +129,9 @@ public class ObjExporter
|
||||
|
||||
int alpha = 0;
|
||||
|
||||
if (model.faceAlphas != null)
|
||||
if (model.faceTransparencies != null)
|
||||
{
|
||||
alpha = model.faceAlphas[i] & 0xFF;
|
||||
alpha = model.faceTransparencies[i] & 0xFF;
|
||||
}
|
||||
|
||||
if (alpha != 0)
|
||||
|
||||
Reference in New Issue
Block a user