Add getModel to Renderable
This commit is contained in:
65
runelite-api/src/main/java/net/runelite/api/Model.java
Normal file
65
runelite-api/src/main/java/net/runelite/api/Model.java
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package net.runelite.api;
|
||||||
|
|
||||||
|
public class Model
|
||||||
|
{
|
||||||
|
private final net.runelite.rs.api.Model model;
|
||||||
|
|
||||||
|
public Model(net.runelite.rs.api.Model model)
|
||||||
|
{
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getVerticesX()
|
||||||
|
{
|
||||||
|
return model.getVerticesX();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getVerticesY()
|
||||||
|
{
|
||||||
|
return model.getVerticesY();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getVerticesZ()
|
||||||
|
{
|
||||||
|
return model.getVerticesZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getTrianglesX()
|
||||||
|
{
|
||||||
|
return model.getTrianglesX();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getTrianglesY()
|
||||||
|
{
|
||||||
|
return model.getTrianglesY();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getTrianglesZ()
|
||||||
|
{
|
||||||
|
return model.getTrianglesZ();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,6 @@ package net.runelite.api;
|
|||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.runelite.rs.api.Model;
|
|
||||||
|
|
||||||
public class Player extends Actor
|
public class Player extends Actor
|
||||||
{
|
{
|
||||||
@@ -59,11 +58,6 @@ public class Player extends Actor
|
|||||||
return new PlayerComposition(player.getComposition());
|
return new PlayerComposition(player.getComposition());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Model getModel()
|
|
||||||
{
|
|
||||||
return player.getModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Polygon[] getPolygons()
|
public Polygon[] getPolygons()
|
||||||
{
|
{
|
||||||
List<Polygon> polys = new ArrayList<>();
|
List<Polygon> polys = new ArrayList<>();
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ public class Renderable extends Node
|
|||||||
this.renderable = renderable;
|
this.renderable = renderable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Model getModel()
|
||||||
|
{
|
||||||
|
return new Model(renderable.getModel());
|
||||||
|
}
|
||||||
|
|
||||||
public static Renderable of(net.runelite.rs.api.Renderable renderable)
|
public static Renderable of(net.runelite.rs.api.Renderable renderable)
|
||||||
{
|
{
|
||||||
return (Renderable) Node.of(renderable);
|
return (Renderable) Node.of(renderable);
|
||||||
|
|||||||
@@ -35,9 +35,6 @@ public interface Player extends Actor
|
|||||||
@Import("name")
|
@Import("name")
|
||||||
String getName();
|
String getName();
|
||||||
|
|
||||||
@Import("getModel")
|
|
||||||
Model getModel();
|
|
||||||
|
|
||||||
@Import("combatLevel")
|
@Import("combatLevel")
|
||||||
int getCombatLevel();
|
int getCombatLevel();
|
||||||
|
|
||||||
|
|||||||
@@ -31,4 +31,7 @@ public interface Renderable extends Node
|
|||||||
{
|
{
|
||||||
@Import("modelHeight")
|
@Import("modelHeight")
|
||||||
int getModelHeight();
|
int getModelHeight();
|
||||||
|
|
||||||
|
@Import("getModel")
|
||||||
|
Model getModel();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user