2018-04-25 12:59:18 +02:00
|
|
|
package com.minelittlepony.model.components;
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2018-04-25 13:02:10 +02:00
|
|
|
import com.minelittlepony.pony.data.PonyGender;
|
2018-04-25 16:40:47 +02:00
|
|
|
import com.minelittlepony.render.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 16:40:47 +02:00
|
|
|
import com.minelittlepony.model.AbstractPonyModel;
|
|
|
|
|
2018-04-25 12:59:18 +02:00
|
|
|
public class PonySnout {
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2018-04-26 23:55:09 +02:00
|
|
|
private PlaneRenderer mare;
|
|
|
|
private PlaneRenderer stallion;
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2018-04-29 11:56:26 +02:00
|
|
|
public PonySnout(AbstractPonyModel pony) {
|
2016-11-25 05:40:19 +01:00
|
|
|
mare = new PlaneRenderer(pony);
|
2018-04-29 11:56:26 +02:00
|
|
|
stallion = new PlaneRenderer(pony);
|
2018-04-29 14:20:13 +02:00
|
|
|
|
2018-04-29 11:56:26 +02:00
|
|
|
pony.bipedHead.addChild(stallion);
|
2018-04-29 14:20:13 +02:00
|
|
|
pony.bipedHead.addChild(mare);
|
2018-04-29 11:56:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void init(float yOffset, float stretch) {
|
2018-04-26 23:55:09 +02:00
|
|
|
mare.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
|
|
|
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
|
|
|
.tex(10, 14) .addBackPlane(-2, 2, -5, 4, 2, stretch)
|
|
|
|
.tex(11, 13) .addBackPlane(-1, 1, -5, 2, 1, stretch)
|
|
|
|
.tex(9, 14) .addTopPlane(-2, 2, -5, 1, 1, stretch)
|
|
|
|
.tex(14, 14) .addTopPlane( 1, 2, -5, 1, 1, stretch)
|
|
|
|
.tex(11, 12) .addTopPlane(-1, 1, -5, 2, 1, stretch)
|
|
|
|
.tex(18, 7).addBottomPlane(-2, 4, -5, 4, 1, stretch)
|
|
|
|
.tex(9, 14) .addWestPlane(-2, 2, -5, 2, 1, stretch)
|
|
|
|
.tex(14, 14) .addEastPlane( 2, 2, -5, 2, 1, stretch)
|
|
|
|
.tex(11, 12) .addWestPlane(-1, 1, -5, 1, 1, stretch)
|
|
|
|
.tex(12, 12) .addEastPlane( 1, 1, -5, 1, 1, stretch);
|
|
|
|
stallion.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
|
|
|
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
|
|
|
.tex(10, 13) .addBackPlane(-2, 1, -5, 4, 3, stretch)
|
|
|
|
.tex(10, 13) .addTopPlane(-2, 1, -5, 4, 1, stretch)
|
|
|
|
.tex(18, 7).addBottomPlane(-2, 4, -5, 4, 1, stretch)
|
|
|
|
.tex(10, 13) .addWestPlane(-2, 1, -5, 3, 1, stretch)
|
|
|
|
.tex(13, 13) .addEastPlane( 2, 1, -5, 3, 1, stretch);
|
2015-12-14 09:29:10 +01:00
|
|
|
}
|
|
|
|
|
2018-04-25 12:59:18 +02:00
|
|
|
public void setGender(PonyGender gender) {
|
2018-04-29 14:20:13 +02:00
|
|
|
mare.isHidden = gender == PonyGender.STALLION;
|
|
|
|
stallion.isHidden = !mare.isHidden;
|
2015-12-14 09:29:10 +01:00
|
|
|
}
|
|
|
|
}
|