2018-04-25 12:59:18 +02:00
|
|
|
package com.minelittlepony.model.components;
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2018-04-25 12:59:18 +02:00
|
|
|
import com.minelittlepony.model.AbstractPonyModel;
|
2018-04-25 13:02:10 +02:00
|
|
|
import com.minelittlepony.pony.data.PonyGender;
|
2018-04-25 12:59:18 +02:00
|
|
|
import com.minelittlepony.renderer.plane.PlaneRenderer;
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2018-04-25 12:59:18 +02:00
|
|
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
2016-11-25 05:40:19 +01:00
|
|
|
|
2018-04-25 12:59:18 +02:00
|
|
|
public class PonySnout {
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2018-04-25 12:59:18 +02:00
|
|
|
private PlaneRenderer mare, stallion;
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2016-11-25 05:40:19 +01:00
|
|
|
public PonySnout(AbstractPonyModel pony, float yOffset, float stretch) {
|
|
|
|
mare = new PlaneRenderer(pony);
|
2016-11-22 22:19:18 +01:00
|
|
|
mare.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
|
|
|
|
2017-06-13 05:55:50 +02:00
|
|
|
mare.setTextureOffset(10, 14).addBackPlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 2, stretch);
|
|
|
|
mare.setTextureOffset(11, 13).addBackPlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 2, 1, stretch);
|
|
|
|
mare.setTextureOffset(9, 14).addTopPlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 1, 1, stretch);
|
|
|
|
mare.setTextureOffset(14, 14).addTopPlane(1.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 1, 1, stretch);
|
|
|
|
mare.setTextureOffset(11, 12).addTopPlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 2, 1, stretch);
|
|
|
|
mare.setTextureOffset(18, 7).addBottomPlane(-2.0F + HEAD_CENTRE_X, 4.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 1, stretch);
|
|
|
|
mare.setTextureOffset(9, 14).addWestPlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 2, 1, stretch);
|
|
|
|
mare.setTextureOffset(14, 14).addEastPlane(2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 2, 1, stretch);
|
|
|
|
mare.setTextureOffset(11, 12).addWestPlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 1, 1, stretch);
|
|
|
|
mare.setTextureOffset(12, 12).addEastPlane(1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 1, 1, stretch);
|
2016-11-22 22:19:18 +01:00
|
|
|
|
2016-11-25 05:40:19 +01:00
|
|
|
pony.bipedHead.addChild(mare);
|
|
|
|
|
|
|
|
stallion = new PlaneRenderer(pony);
|
2016-11-22 22:19:18 +01:00
|
|
|
stallion.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
|
|
|
|
2017-06-13 05:55:50 +02:00
|
|
|
stallion.setTextureOffset(10, 13).addBackPlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 3, stretch);
|
|
|
|
stallion.setTextureOffset(10, 13).addTopPlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 1, stretch);
|
|
|
|
stallion.setTextureOffset(18, 7).addBottomPlane(-2.0F + HEAD_CENTRE_X, 4.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 1, stretch);
|
|
|
|
stallion.setTextureOffset(10, 13).addWestPlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 3, 1, stretch);
|
|
|
|
stallion.setTextureOffset(13, 13).addEastPlane(2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 3, 1, stretch);
|
2016-11-25 05:40:19 +01:00
|
|
|
|
|
|
|
pony.bipedHead.addChild(stallion);
|
2015-12-14 09:29:10 +01:00
|
|
|
}
|
|
|
|
|
2018-04-25 12:59:18 +02:00
|
|
|
public void setGender(PonyGender gender) {
|
2016-11-25 05:40:19 +01:00
|
|
|
mare.isHidden = gender != PonyGender.MARE;
|
|
|
|
stallion.isHidden = gender != PonyGender.STALLION;
|
2015-12-14 09:29:10 +01:00
|
|
|
}
|
|
|
|
}
|