runelite-api: add getConvexHull to Actor

This commit is contained in:
Adam
2018-03-20 17:44:50 -04:00
parent 6f61780e68
commit da29e3560f
2 changed files with 15 additions and 0 deletions

View File

@@ -68,4 +68,6 @@ public interface Actor extends Renderable
* Returns the logical height of the actor's model. This is roughly where the health bar is drawn.
*/
int getLogicalHeight();
Polygon getConvexHull();
}

View File

@@ -48,6 +48,7 @@ import net.runelite.rs.api.RSCombatInfo1;
import net.runelite.rs.api.RSCombatInfo2;
import net.runelite.rs.api.RSCombatInfoList;
import net.runelite.rs.api.RSCombatInfoListHolder;
import net.runelite.rs.api.RSModel;
import net.runelite.rs.api.RSNode;
@Mixin(RSActor.class)
@@ -188,4 +189,16 @@ public abstract class RSActorMixin implements RSActor
graphicChanged.setActor(this);
eventBus.post(graphicChanged);
}
@Inject
@Override
public Polygon getConvexHull()
{
RSModel model = getModel();
if (model == null)
{
return null;
}
return model.getConvexHull(getX(), getY(), getOrientation());
}
}