當前位置: 首頁>>代碼示例>>Java>>正文


Java TRSRTransformation.blockCenterToCorner方法代碼示例

本文整理匯總了Java中net.minecraftforge.common.model.TRSRTransformation.blockCenterToCorner方法的典型用法代碼示例。如果您正苦於以下問題:Java TRSRTransformation.blockCenterToCorner方法的具體用法?Java TRSRTransformation.blockCenterToCorner怎麽用?Java TRSRTransformation.blockCenterToCorner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.common.model.TRSRTransformation的用法示例。


在下文中一共展示了TRSRTransformation.blockCenterToCorner方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: get

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s)
{
    return TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
        new Vector3f(tx / 16, ty / 16, tz / 16),
        TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)),
        new Vector3f(s, s, s),
        null));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:9,代碼來源:ForgeBlockStateV1.java

示例2: get

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
protected TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s) {
	return TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
			new Vector3f(tx / 16, ty / 16, tz / 16),
			TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)), new Vector3f(s, s, s), null));
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:6,代碼來源:BakedToolModel.java

示例3: get

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s) {
	return TRSRTransformation.blockCenterToCorner(new TRSRTransformation(
			new Vector3f(tx / 16, ty / 16, tz / 16),
			TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)), new Vector3f(s, s, s), null));
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:6,代碼來源:AxeModel.java

示例4: leftify

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
private static TRSRTransformation leftify(TRSRTransformation transform) {
	return TRSRTransformation.blockCenterToCorner(
			flipX.compose(TRSRTransformation.blockCornerToCenter(transform)).compose(flipX));
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:5,代碼來源:ToolHeadModel.java

示例5: apply

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
public TRSRTransformation apply(float time)
{
    time -= Math.floor(time);
    Vector3f translation = new Vector3f(0, 0, 0);
    Vector3f scale = new Vector3f(1, 1, 1);
    AxisAngle4f rotation = new AxisAngle4f(0, 0, 0, 0);
    for(MBVariableClip var : variables)
    {
        int length = loop ? var.samples.length : (var.samples.length - 1);
        float timeScaled = time * length;
        int s1 = MathHelper.clamp_int((int)Math.round(Math.floor(timeScaled)), 0, length - 1);
        float progress = timeScaled - s1;
        int s2 = s1 + 1;
        if(s2 == length && loop) s2 = 0;
        float value = 0;
        switch(var.interpolation)
        {
            case LINEAR:
                if(var.variable == Variable.ANGLE)
                {
                    float v1 = var.samples[s1];
                    float v2 = var.samples[s2];
                    float diff = ((v2 - v1) % 360 + 540) % 360 - 180;
                    value = v1 + diff * progress;
                }
                else
                {
                    value = var.samples[s1] * (1 - progress) + var.samples[s2] * progress;
                }
                break;
            case NEAREST:
                value = var.samples[progress < .5f ? s1 : s2];
                break;
        }
        switch(var.variable)
        {
            case X:
                translation.x = value;
                break;
            case Y:
                translation.y = value;
                break;
            case Z:
                translation.z = value;
                break;
            case XROT:
                rotation.x = value;
                break;
            case YROT:
                rotation.y = value;
                break;
            case ZROT:
                rotation.z = value;
                break;
            case ANGLE:
                rotation.angle = (float)Math.toRadians(value);
                break;
            case SCALE:
                scale.x = scale.y = scale.z = value;
                break;
            case XS:
                scale.x = value;
                break;
            case YS:
                scale.y = value;
                break;
            case ZS:
                scale.z = value;
                break;
        }
    }
    Quat4f rot = new Quat4f();
    rot.set(rotation);
    return TRSRTransformation.blockCenterToCorner(new TRSRTransformation(translation, rot, scale, null));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:76,代碼來源:ModelBlockAnimation.java

示例6: bake

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
@Override
public IBakedModel bake(IModelState state, VertexFormat format,
                                Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{

    ImmutableMap<TransformType, TRSRTransformation> transformMap = IPerspectiveAwareModel.MapWrapper.getTransforms(state);

    // if the fluid is a gas wi manipulate the initial state to be rotated 180? to turn it upside down
    if (flipGas && fluid != null && fluid.isGaseous())
    {
        state = new ModelStateComposition(state, TRSRTransformation.blockCenterToCorner(new TRSRTransformation(null, new Quat4f(0, 0, 1, 0), null, null)));
    }

    TRSRTransformation transform = state.apply(Optional.<IModelPart>absent()).or(TRSRTransformation.identity());
    TextureAtlasSprite fluidSprite = null;
    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

    if(fluid != null) {
        fluidSprite = bakedTextureGetter.apply(fluid.getStill());
    }

    if (baseLocation != null)
    {
        // build base (insidest)
        IBakedModel model = (new ItemLayerModel(ImmutableList.of(baseLocation))).bake(state, format, bakedTextureGetter);
        builder.addAll(model.getQuads(null, null, 0));
    }
    if (liquidLocation != null && fluidSprite != null)
    {
        TextureAtlasSprite liquid = bakedTextureGetter.apply(liquidLocation);
        // build liquid layer (inside)
        builder.addAll(ItemTextureQuadConverter.convertTexture(format, transform, liquid, fluidSprite, NORTH_Z_FLUID, EnumFacing.NORTH, fluid.getColor()));
        builder.addAll(ItemTextureQuadConverter.convertTexture(format, transform, liquid, fluidSprite, SOUTH_Z_FLUID, EnumFacing.SOUTH, fluid.getColor()));
    }
    if (coverLocation != null)
    {
        // cover (the actual item around the other two)
        TextureAtlasSprite base = bakedTextureGetter.apply(coverLocation);
        builder.add(ItemTextureQuadConverter.genQuad(format, transform, 0, 0, 16, 16, NORTH_Z_BASE, base, EnumFacing.NORTH, 0xffffffff));
        builder.add(ItemTextureQuadConverter.genQuad(format, transform, 0, 0, 16, 16, SOUTH_Z_BASE, base, EnumFacing.SOUTH, 0xffffffff));
    }


    return new BakedDynBucket(this, builder.build(), fluidSprite, format, Maps.immutableEnumMap(transformMap), Maps.<String, IBakedModel>newHashMap());
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:46,代碼來源:ModelDynBucket.java

示例7: leftify

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
private static TRSRTransformation leftify(TRSRTransformation transform)
{
    return TRSRTransformation.blockCenterToCorner(flipX.compose(TRSRTransformation.blockCornerToCenter(transform)).compose(flipX));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:5,代碼來源:ForgeBlockStateV1.java

示例8: toBlockTransformation

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
public TRSRTransformation toBlockTransformation() {
	return TRSRTransformation.blockCenterToCorner(new TRSRTransformation(position, TRSRTransformation.quatFromXYZDegrees(rotation), scale, null));

}
 
開發者ID:oMilkyy,項目名稱:SimpleTubes,代碼行數:5,代碼來源:ModelTransform.java


注:本文中的net.minecraftforge.common.model.TRSRTransformation.blockCenterToCorner方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。