rl-api: use less confusing names for model indices
This commit is contained in:
@@ -27,6 +27,6 @@ package net.runelite.api;
|
|||||||
/**
|
/**
|
||||||
* Represents an animation of a renderable
|
* Represents an animation of a renderable
|
||||||
*/
|
*/
|
||||||
public interface Sequence
|
public interface Animation
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1089,7 +1089,7 @@ public interface Client extends GameEngine
|
|||||||
* @param id the ID of the animation. Any int is allowed, but implementations in the client
|
* @param id the ID of the animation. Any int is allowed, but implementations in the client
|
||||||
* should be defined in {@link AnimationID}
|
* should be defined in {@link AnimationID}
|
||||||
*/
|
*/
|
||||||
Sequence loadAnimation(int id);
|
Animation loadAnimation(int id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the music volume
|
* Gets the music volume
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ public interface Model extends Renderable
|
|||||||
|
|
||||||
int[] getVerticesZ();
|
int[] getVerticesZ();
|
||||||
|
|
||||||
int getTrianglesCount();
|
int getFaceCount();
|
||||||
|
|
||||||
int[] getTrianglesX();
|
int[] getFaceIndices1();
|
||||||
|
|
||||||
int[] getTrianglesY();
|
int[] getFaceIndices2();
|
||||||
|
|
||||||
int[] getTrianglesZ();
|
int[] getFaceIndices3();
|
||||||
|
|
||||||
int[] getFaceColors1();
|
int[] getFaceColors1();
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ public interface Model extends Renderable
|
|||||||
|
|
||||||
int[] getFaceColors3();
|
int[] getFaceColors3();
|
||||||
|
|
||||||
byte[] getTriangleTransparencies();
|
byte[] getFaceTransparencies();
|
||||||
|
|
||||||
int getSceneId();
|
int getSceneId();
|
||||||
void setSceneId(int sceneId);
|
void setSceneId(int sceneId);
|
||||||
|
|||||||
@@ -781,9 +781,9 @@ public class Perspective
|
|||||||
final int radius = 5;
|
final int radius = 5;
|
||||||
|
|
||||||
int[][] tris = new int[][]{
|
int[][] tris = new int[][]{
|
||||||
m.getTrianglesX(),
|
m.getFaceIndices1(),
|
||||||
m.getTrianglesY(),
|
m.getFaceIndices2(),
|
||||||
m.getTrianglesZ()
|
m.getFaceIndices3()
|
||||||
};
|
};
|
||||||
|
|
||||||
int vpX1 = client.getViewportXOffset();
|
int vpX1 = client.getViewportXOffset();
|
||||||
@@ -791,10 +791,10 @@ public class Perspective
|
|||||||
int vpX2 = vpX1 + client.getViewportWidth();
|
int vpX2 = vpX1 + client.getViewportWidth();
|
||||||
int vpY2 = vpY1 + client.getViewportHeight();
|
int vpY2 = vpY1 + client.getViewportHeight();
|
||||||
|
|
||||||
List<RectangleUnion.Rectangle> rects = new ArrayList<>(m.getTrianglesCount());
|
List<RectangleUnion.Rectangle> rects = new ArrayList<>(m.getFaceCount());
|
||||||
|
|
||||||
nextTri:
|
nextTri:
|
||||||
for (int tri = 0; tri < m.getTrianglesCount(); tri++)
|
for (int tri = 0; tri < m.getFaceCount(); tri++)
|
||||||
{
|
{
|
||||||
if (faceColors3[tri] == -2)
|
if (faceColors3[tri] == -2)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public interface RuneLiteObject extends GraphicsObject
|
|||||||
* Sets the animation of the RuneLiteObject
|
* Sets the animation of the RuneLiteObject
|
||||||
* If animation is null model will be static
|
* If animation is null model will be static
|
||||||
*/
|
*/
|
||||||
void setAnimation(Sequence animation);
|
void setAnimation(Animation animation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether the animation of the RuneLiteObject should loop when the animation ends.
|
* Sets whether the animation of the RuneLiteObject should loop when the animation ends.
|
||||||
|
|||||||
@@ -1608,7 +1608,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
modelY = y + client.getCameraY2();
|
modelY = y + client.getCameraY2();
|
||||||
modelZ = z + client.getCameraZ2();
|
modelZ = z + client.getCameraZ2();
|
||||||
modelOrientation = orientation;
|
modelOrientation = orientation;
|
||||||
int triangleCount = model.getTrianglesCount();
|
int triangleCount = model.getFaceCount();
|
||||||
vertexBuffer.ensureCapacity(12 * triangleCount);
|
vertexBuffer.ensureCapacity(12 * triangleCount);
|
||||||
uvBuffer.ensureCapacity(12 * triangleCount);
|
uvBuffer.ensureCapacity(12 * triangleCount);
|
||||||
|
|
||||||
@@ -1632,7 +1632,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
model.calculateExtreme(orientation);
|
model.calculateExtreme(orientation);
|
||||||
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||||
|
|
||||||
int tc = Math.min(MAX_TRIANGLE, model.getTrianglesCount());
|
int tc = Math.min(MAX_TRIANGLE, model.getFaceCount());
|
||||||
int uvOffset = model.getUvBufferOffset();
|
int uvOffset = model.getUvBufferOffset();
|
||||||
|
|
||||||
GpuIntBuffer b = bufferForTriangles(tc);
|
GpuIntBuffer b = bufferForTriangles(tc);
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ class SceneUploader
|
|||||||
|
|
||||||
public int pushModel(Model model, GpuIntBuffer vertexBuffer, GpuFloatBuffer uvBuffer)
|
public int pushModel(Model model, GpuIntBuffer vertexBuffer, GpuFloatBuffer uvBuffer)
|
||||||
{
|
{
|
||||||
final int triangleCount = Math.min(model.getTrianglesCount(), GpuPlugin.MAX_TRIANGLE);
|
final int triangleCount = Math.min(model.getFaceCount(), GpuPlugin.MAX_TRIANGLE);
|
||||||
|
|
||||||
vertexBuffer.ensureCapacity(triangleCount * 12);
|
vertexBuffer.ensureCapacity(triangleCount * 12);
|
||||||
uvBuffer.ensureCapacity(triangleCount * 12);
|
uvBuffer.ensureCapacity(triangleCount * 12);
|
||||||
@@ -388,15 +388,15 @@ class SceneUploader
|
|||||||
final int[] vertexY = model.getVerticesY();
|
final int[] vertexY = model.getVerticesY();
|
||||||
final int[] vertexZ = model.getVerticesZ();
|
final int[] vertexZ = model.getVerticesZ();
|
||||||
|
|
||||||
final int[] trianglesX = model.getTrianglesX();
|
final int[] indices1 = model.getFaceIndices1();
|
||||||
final int[] trianglesY = model.getTrianglesY();
|
final int[] indices2 = model.getFaceIndices2();
|
||||||
final int[] trianglesZ = model.getTrianglesZ();
|
final int[] indices3 = model.getFaceIndices3();
|
||||||
|
|
||||||
final int[] color1s = model.getFaceColors1();
|
final int[] color1s = model.getFaceColors1();
|
||||||
final int[] color2s = model.getFaceColors2();
|
final int[] color2s = model.getFaceColors2();
|
||||||
final int[] color3s = model.getFaceColors3();
|
final int[] color3s = model.getFaceColors3();
|
||||||
|
|
||||||
final byte[] transparencies = model.getTriangleTransparencies();
|
final byte[] transparencies = model.getFaceTransparencies();
|
||||||
final short[] faceTextures = model.getFaceTextures();
|
final short[] faceTextures = model.getFaceTextures();
|
||||||
final byte[] facePriorities = model.getFaceRenderPriorities();
|
final byte[] facePriorities = model.getFaceRenderPriorities();
|
||||||
|
|
||||||
@@ -432,9 +432,9 @@ class SceneUploader
|
|||||||
|
|
||||||
int packAlphaPriority = packAlphaPriority(faceTextures, transparencies, facePriorities, face);
|
int packAlphaPriority = packAlphaPriority(faceTextures, transparencies, facePriorities, face);
|
||||||
|
|
||||||
int triangleA = trianglesX[face];
|
int triangleA = indices1[face];
|
||||||
int triangleB = trianglesY[face];
|
int triangleB = indices2[face];
|
||||||
int triangleC = trianglesZ[face];
|
int triangleC = indices3[face];
|
||||||
|
|
||||||
vertexBuffer.put(vertexX[triangleA], vertexY[triangleA], vertexZ[triangleA], packAlphaPriority | color1);
|
vertexBuffer.put(vertexX[triangleA], vertexY[triangleA], vertexZ[triangleA], packAlphaPriority | color1);
|
||||||
vertexBuffer.put(vertexX[triangleB], vertexY[triangleB], vertexZ[triangleB], packAlphaPriority | color2);
|
vertexBuffer.put(vertexX[triangleB], vertexY[triangleB], vertexZ[triangleB], packAlphaPriority | color2);
|
||||||
@@ -458,21 +458,21 @@ class SceneUploader
|
|||||||
final int[] vertexY = model.getVerticesY();
|
final int[] vertexY = model.getVerticesY();
|
||||||
final int[] vertexZ = model.getVerticesZ();
|
final int[] vertexZ = model.getVerticesZ();
|
||||||
|
|
||||||
final int[] trianglesX = model.getTrianglesX();
|
final int[] indices1 = model.getFaceIndices1();
|
||||||
final int[] trianglesY = model.getTrianglesY();
|
final int[] indices2 = model.getFaceIndices2();
|
||||||
final int[] trianglesZ = model.getTrianglesZ();
|
final int[] indices3 = model.getFaceIndices3();
|
||||||
|
|
||||||
final int[] color1s = model.getFaceColors1();
|
final int[] color1s = model.getFaceColors1();
|
||||||
final int[] color2s = model.getFaceColors2();
|
final int[] color2s = model.getFaceColors2();
|
||||||
final int[] color3s = model.getFaceColors3();
|
final int[] color3s = model.getFaceColors3();
|
||||||
|
|
||||||
final byte[] transparencies = model.getTriangleTransparencies();
|
final byte[] transparencies = model.getFaceTransparencies();
|
||||||
final short[] faceTextures = model.getFaceTextures();
|
final short[] faceTextures = model.getFaceTextures();
|
||||||
final byte[] facePriorities = model.getFaceRenderPriorities();
|
final byte[] facePriorities = model.getFaceRenderPriorities();
|
||||||
|
|
||||||
int triangleA = trianglesX[face];
|
int triangleA = indices1[face];
|
||||||
int triangleB = trianglesY[face];
|
int triangleB = indices2[face];
|
||||||
int triangleC = trianglesZ[face];
|
int triangleC = indices3[face];
|
||||||
|
|
||||||
int color1 = color1s[face];
|
int color1 = color1s[face];
|
||||||
int color2 = color2s[face];
|
int color2 = color2s[face];
|
||||||
|
|||||||
@@ -564,11 +564,11 @@ public class ModelOutlineRenderer
|
|||||||
*/
|
*/
|
||||||
private void simulateModelRasterizationForOutline(Model model)
|
private void simulateModelRasterizationForOutline(Model model)
|
||||||
{
|
{
|
||||||
final int triangleCount = model.getTrianglesCount();
|
final int triangleCount = model.getFaceCount();
|
||||||
final int[] indices1 = model.getTrianglesX();
|
final int[] indices1 = model.getFaceIndices1();
|
||||||
final int[] indices2 = model.getTrianglesY();
|
final int[] indices2 = model.getFaceIndices2();
|
||||||
final int[] indices3 = model.getTrianglesZ();
|
final int[] indices3 = model.getFaceIndices3();
|
||||||
final byte[] triangleTransparencies = model.getTriangleTransparencies();
|
final byte[] triangleTransparencies = model.getFaceTransparencies();
|
||||||
|
|
||||||
for (int i = 0; i < triangleCount; i++)
|
for (int i = 0; i < triangleCount; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user