旋转AABB值

时间:2017-08-31 19:53:04

标签: java button minecraft aabb

Minecraft按钮类的按钮的各个面板具有以下AABB值。

    protected static final AxisAlignedBB AABB_DOWN_OFF = new AxisAlignedBB(0.3125D, 0.875D, 0.375D, 0.6875D, 1.0D, 0.625D);
    protected static final AxisAlignedBB AABB_UP_OFF = new AxisAlignedBB(0.3125D, 0.0D, 0.375D, 0.6875D, 0.125D, 0.625D);
    protected static final AxisAlignedBB AABB_NORTH_OFF = new AxisAlignedBB(0.3125D, 0.375D, 0.875D, 0.6875D, 0.625D, 1.0D);
    protected static final AxisAlignedBB AABB_SOUTH_OFF = new AxisAlignedBB(0.3125D, 0.375D, 0.0D, 0.6875D, 0.625D, 0.125D);
    protected static final AxisAlignedBB AABB_WEST_OFF = new AxisAlignedBB(0.875D, 0.375D, 0.3125D, 1.0D, 0.625D, 0.6875D);
    protected static final AxisAlignedBB AABB_EAST_OFF = new AxisAlignedBB(0.0D, 0.375D, 0.3125D, 0.125D, 0.625D, 0.6875D);
    protected static final AxisAlignedBB AABB_DOWN_ON = new AxisAlignedBB(0.3125D, 0.9375D, 0.375D, 0.6875D, 1.0D, 0.625D);
    protected static final AxisAlignedBB AABB_UP_ON = new AxisAlignedBB(0.3125D, 0.0D, 0.375D, 0.6875D, 0.0625D, 0.625D);
    protected static final AxisAlignedBB AABB_NORTH_ON = new AxisAlignedBB(0.3125D, 0.375D, 0.9375D, 0.6875D, 0.625D, 1.0D);
    protected static final AxisAlignedBB AABB_SOUTH_ON = new AxisAlignedBB(0.3125D, 0.375D, 0.0D, 0.6875D, 0.625D, 0.0625D);
    protected static final AxisAlignedBB AABB_WEST_ON = new AxisAlignedBB(0.9375D, 0.375D, 0.3125D, 1.0D, 0.625D, 0.6875D);
    protected static final AxisAlignedBB AABB_EAST_ON = new AxisAlignedBB(0.0D, 0.375D, 0.3125D, 0.0625D, 0.625D, 0.6875D);

然后我创建了一个更大的按钮,就像OpenBlocks BigButtonClass中的那个按钮,并借用了它的边界框数据,面向上的按钮(我认为它是向上的)。

    protected final AxisAlignedBB NORMAL = new AxisAlignedBB(0.0625, 0, 0.0625, 0.9375, 0.125, 0.9375);
    protected final AxisAlignedBB PRESSED = new AxisAlignedBB( 0.0625, 0, 0.0625, 0.9375, 0.0625, 0.9375);

按钮几乎是一个块的宽度,而AABB用于NORMAL& PRESSED制作你可以放置在一个块的顶部看起来很漂亮与一个很好地围绕它的边界框。然而,我的其他按钮在正常按钮的中间有一个边界框。

我想知道的是有一种方法可以轻松获取工作边界框值NORMAL和amp; PRESSED并将其各种元素应用于按钮类AABB值的其余元素?我想这样做而不为OpenModsLib添加依赖项。

Source Code

0 个答案:

没有答案