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


Java TRSRTransformation.identity方法代碼示例

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


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

示例1: handlePerspective

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
public static Pair<? extends IBakedModel, Matrix4f> handlePerspective(IBakedModel model, IModelState state, TransformType cameraTransformType)
{
    TRSRTransformation tr = state.apply(Optional.of(cameraTransformType)).or(TRSRTransformation.identity());
    if(tr != TRSRTransformation.identity())
    {
        return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrix());
    }
    return Pair.of(model, null);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:10,代碼來源:IPerspectiveAwareModel.java

示例2: MBJoint

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
public MBJoint(String name, BlockPart part)
{
    this.name = name;
    if(part.partRotation != null)
    {
        float x = 0, y = 0, z = 0;
        switch(part.partRotation.axis)
        {
            case X:
                x = 1;
            case Y:
                y = 1;
            case Z:
                z = 1;
        }
        Quat4f rotation = new Quat4f();
        rotation.set(new AxisAngle4f(x, y, z, 0));
        Matrix4f m = new TRSRTransformation(
            TRSRTransformation.toVecmath(part.partRotation.origin),
            rotation,
            null,
            null).getMatrix();
        m.invert();
        invBindPose = new TRSRTransformation(m);
    }
    else
    {
        invBindPose = TRSRTransformation.identity();
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:31,代碼來源:ModelBlockAnimation.java

示例3: bake

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

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

	TRSRTransformation transform = (TRSRTransformation.identity());

	ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

	if (bladeTexture != null && handleTexture != null) {
		
		ImmutableList.Builder<ResourceLocation> texBuilder = ImmutableList.builder();
		if (bladeTexture != null) {
			texBuilder.add(bladeTexture);
		}
		if (handleTexture != null) {
			texBuilder.add(handleTexture);
		}
		if (adornmentTexture != null) {
			texBuilder.add(adornmentTexture);
		}
		ImmutableList<ResourceLocation> textures = texBuilder.build();
		
		IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
		builder.addAll(model.getQuads(null, null, 0));
	}

	return new BakedDaggerModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
			Maps.<String, IBakedModel>newHashMap());
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:32,代碼來源:DaggerModel.java

示例4: getPartTransform

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
public TRSRTransformation getPartTransform(IModelState state, BlockPart part, int i)
{
    ImmutableCollection<MBJointWeight> infos = getJoint(i);
    if(!infos.isEmpty())
    {
        Matrix4f m = new Matrix4f(), tmp;
        float weight = 0;
        for(MBJointWeight info : infos)
        {
            if(info.getWeights().containsKey(i))
            {
                ModelBlockAnimation.MBJoint joint = new ModelBlockAnimation.MBJoint(info.getName(), part);
                Optional<TRSRTransformation> trOp = state.apply(Optional.of(joint));
                if(trOp.isPresent() && trOp.get() != TRSRTransformation.identity())
                {
                    float w = info.getWeights().get(i)[0];
                    tmp = trOp.get().getMatrix();
                    tmp.mul(w);
                    m.add(tmp);
                    weight += w;
                }
            }
        }
        if(weight > 1e-5)
        {
            m.mul(1f / weight);
            return new TRSRTransformation(m);
        }
    }
    return null;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:32,代碼來源:ModelBlockAnimation.java

示例5: bake

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

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

	TRSRTransformation transform = (TRSRTransformation.identity());

	ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

	if (headTexture != null && haftTexture != null && handleTexture != null) {
		
		ImmutableList.Builder<ResourceLocation> texBuilder = ImmutableList.builder();
		if (haftTexture != null) {
			texBuilder.add(haftTexture);
		}
		if (headTexture != null) {
			texBuilder.add(headTexture);
		}
		if (handleTexture != null) {
			texBuilder.add(handleTexture);
		}
		if (adornmentTexture != null) {
			texBuilder.add(adornmentTexture);
		}
		ImmutableList<ResourceLocation> textures = texBuilder.build();
		
		IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
		builder.addAll(model.getQuads(null, null, 0));
	}

	return new BakedAxeModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
			Maps.<String, IBakedModel>newHashMap());
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:35,代碼來源:AxeModel.java

示例6: bake

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

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

	TRSRTransformation transform = (TRSRTransformation.identity());

	ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

	if (headTexture != null && haftTexture != null && handleTexture != null) {
		
		ImmutableList.Builder<ResourceLocation> texBuilder = ImmutableList.builder();
		if (haftTexture != null) {
			texBuilder.add(haftTexture);
		}
		if (headTexture != null) {
			texBuilder.add(headTexture);
		}
		if (handleTexture != null) {
			texBuilder.add(handleTexture);
		}
		if (adornmentTexture != null) {
			texBuilder.add(adornmentTexture);
		}
		ImmutableList<ResourceLocation> textures = texBuilder.build();
		
		IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
		builder.addAll(model.getQuads(null, null, 0));
	}

	return new BakedHammerModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
			Maps.<String, IBakedModel>newHashMap());
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:35,代碼來源:HammerModel.java

示例7: bake

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

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

	TRSRTransformation transform = (TRSRTransformation.identity());

	ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

	if (headTexture != null && haftTexture != null && handleTexture != null) {
		
		ImmutableList.Builder<ResourceLocation> texBuilder = ImmutableList.builder();
		if (haftTexture != null) {
			texBuilder.add(haftTexture);
		}
		if (headTexture != null) {
			texBuilder.add(headTexture);
		}
		if (handleTexture != null) {
			texBuilder.add(handleTexture);
		}
		if (adornmentTexture != null) {
			texBuilder.add(adornmentTexture);
		}
		ImmutableList<ResourceLocation> textures = texBuilder.build();
		
		IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
		builder.addAll(model.getQuads(null, null, 0));
	}

	return new BakedShovelModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
			Maps.<String, IBakedModel>newHashMap());
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:35,代碼來源:ShovelModel.java

示例8: convertCuboidToQuads

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
public static List<BakedQuad> convertCuboidToQuads(VertexFormat format, TexturedCuboid cuboid, boolean cull) {
	List<BakedQuad> list = new ArrayList<BakedQuad>();

	float x = cuboid.getX();
	float y = cuboid.getY();
	float z = cuboid.getZ();
	float width = cuboid.getWidth();
	float height = cuboid.getHeight();
	float depth = cuboid.getDepth();

	for (EnumFacing facing : EnumFacing.VALUES) {
		if (cuboid.getSidesToIgnore().contains(facing))
			continue;

		if (cuboid != null && cuboid.getTextureForSide(facing) != null && facing != null) {
			TextureAtlasSprite tex = cuboid.getTextureForSide(facing).getTexture();
			TRSRTransformation transform = cuboid.getTransform();
			float minU = getInterpU(cuboid.getTextureForSide(facing).getMinU(), tex);
			float minV = getInterpV(cuboid.getTextureForSide(facing).getMinV(), tex);
			float maxU = getInterpU(cuboid.getTextureForSide(facing).getMaxU(), tex);
			float maxV = getInterpV(cuboid.getTextureForSide(facing).getMaxV(), tex);
			Color col = cuboid.getColor();

			if (transform == null)
				transform = TRSRTransformation.identity();

			list.add(buildQuad(facing, x, y, z, width, height, depth, col, tex, minU, minV, maxU, maxV, false, transform));
			if (!cull)
				list.add(buildQuad(facing, x, y, z, width, height, depth, col, tex, minU, minV, maxU, maxV, true, transform));

		}
	}

	return list;
}
 
開發者ID:oMilkyy,項目名稱:SimpleTubes,代碼行數:36,代碼來源:ModelFactory.java

示例9: bake

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
@Override
public IBakedModel bake(IModelState state, VertexFormat format,
		java.util.function.Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
	
	ImmutableMap<TransformType, TRSRTransformation> transformMap = PerspectiveMapWrapper.getTransforms(state);
	
	TRSRTransformation transform = (TRSRTransformation.identity());
	
	ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
	ImmutableList<ResourceLocation> textures = ImmutableList.<ResourceLocation>of(new ResourceLocation(modid, "items/" + toolName + "/" + partName + "_" + matName));
	builder.addAll(new ItemLayerModel(textures).bake(state, format, bakedTextureGetter).getQuads(null, null, 0));
	return new BakedToolHeadModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
			Maps.<String, IBakedModel>newHashMap());
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:15,代碼來源:ToolHeadModel.java

示例10: OBJState

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
public OBJState(List<String> visibleGroups, boolean visibility)
{
    this(visibleGroups, visibility, TRSRTransformation.identity());
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:5,代碼來源:TintedOBJModel.java

示例11: getDefaultState

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
@Override
public IModelState getDefaultState() {
	return TRSRTransformation.identity();
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:5,代碼來源:DummyModel.java

示例12: bake

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

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

	TRSRTransformation transform = (TRSRTransformation.identity());

	ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();

	if (headTexture != null && haftTexture != null && handleTexture != null) {
		
		ImmutableList.Builder<ResourceLocation> texBuilder = ImmutableList.builder();
		if (haftTexture != null) {
			texBuilder.add(haftTexture);
		}
		if (headTexture != null) {
			texBuilder.add(headTexture);
		}
		if (handleTexture != null) {
			texBuilder.add(handleTexture);
		}
		if (adornmentTexture != null) {
			texBuilder.add(adornmentTexture);
		}
		ImmutableList<ResourceLocation> textures = texBuilder.build();
		
		IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
		builder.addAll(model.getQuads(null, null, 0));
	}

	return new BakedHandpickModel(this, builder.build(), format, Maps.immutableEnumMap(transformMap),
			Maps.<String, IBakedModel>newHashMap());
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:35,代碼來源:HandpickModel.java

示例13: apply

import net.minecraftforge.common.model.TRSRTransformation; //導入方法依賴的package包/類
public TRSRTransformation apply(float time)
{
    return TRSRTransformation.identity();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:5,代碼來源:JointClips.java


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