Search in sources :

Example 6 with Vertex

use of net.runelite.api.model.Vertex in project runelite by runelite.

the class RSPlayerMixin method rotate.

@Inject
private List<Triangle> rotate(List<Triangle> triangles, int orientation) {
    List<Triangle> rotatedTriangles = new ArrayList<Triangle>();
    for (Triangle triangle : triangles) {
        Vertex a = triangle.getA();
        Vertex b = triangle.getB();
        Vertex c = triangle.getC();
        Triangle rotatedTriangle = new Triangle(a.rotate(orientation), b.rotate(orientation), c.rotate(orientation));
        rotatedTriangles.add(rotatedTriangle);
    }
    return rotatedTriangles;
}
Also used : Vertex(net.runelite.api.model.Vertex) Triangle(net.runelite.api.model.Triangle) ArrayList(java.util.ArrayList) Inject(net.runelite.api.mixins.Inject)

Example 7 with Vertex

use of net.runelite.api.model.Vertex in project runelite by runelite.

the class RSModelMixin method getTriangles.

@Override
@Inject
public List<Triangle> getTriangles() {
    int[] trianglesX = getTrianglesX();
    int[] trianglesY = getTrianglesY();
    int[] trianglesZ = getTrianglesZ();
    List<Vertex> vertices = getVertices();
    List<Triangle> triangles = new ArrayList<Triangle>(getTrianglesCount());
    for (int i = 0; i < getTrianglesCount(); ++i) {
        int triangleX = trianglesX[i];
        int triangleY = trianglesY[i];
        int triangleZ = trianglesZ[i];
        Triangle triangle = new Triangle(vertices.get(triangleX), vertices.get(triangleY), vertices.get(triangleZ));
        triangles.add(triangle);
    }
    return triangles;
}
Also used : Vertex(net.runelite.api.model.Vertex) Triangle(net.runelite.api.model.Triangle) ArrayList(java.util.ArrayList) Point(net.runelite.api.Point) Inject(net.runelite.api.mixins.Inject)

Example 8 with Vertex

use of net.runelite.api.model.Vertex in project runelite by runelite.

the class RSModelMixin method getVertices.

@Override
@Inject
public List<Vertex> getVertices() {
    int[] verticesX = getVerticesX();
    int[] verticesY = getVerticesY();
    int[] verticesZ = getVerticesZ();
    List<Vertex> vertices = new ArrayList<Vertex>();
    for (int i = 0; i < getVerticesCount(); ++i) {
        Vertex v = new Vertex(verticesX[i], verticesY[i], verticesZ[i]);
        vertices.add(v);
    }
    return vertices;
}
Also used : Vertex(net.runelite.api.model.Vertex) ArrayList(java.util.ArrayList) Point(net.runelite.api.Point) Inject(net.runelite.api.mixins.Inject)

Aggregations

Vertex (net.runelite.api.model.Vertex)8 ArrayList (java.util.ArrayList)7 Inject (net.runelite.api.mixins.Inject)5 Triangle (net.runelite.api.model.Triangle)5 Polygon (java.awt.Polygon)4 Point (net.runelite.api.Point)4 Area (java.awt.geom.Area)3 LocalPoint (net.runelite.api.coords.LocalPoint)3 Rectangle (java.awt.Rectangle)2 FontMetrics (java.awt.FontMetrics)1 Graphics2D (java.awt.Graphics2D)1 Rectangle2D (java.awt.geom.Rectangle2D)1 BufferedImage (java.awt.image.BufferedImage)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Model (net.runelite.api.Model)1 Jarvis (net.runelite.api.model.Jarvis)1