当前位置: 首页>>代码示例>>Java>>正文


Java OBJModel类代码示例

本文整理汇总了Java中net.minecraftforge.client.model.obj.OBJModel的典型用法代码示例。如果您正苦于以下问题:Java OBJModel类的具体用法?Java OBJModel怎么用?Java OBJModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OBJModel类属于net.minecraftforge.client.model.obj包,在下文中一共展示了OBJModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getModelsForGroups

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public static HashMap<String, IBakedModel> getModelsForGroups(OBJModel objModel) {

		HashMap<String, IBakedModel> modelParts = new HashMap<String, IBakedModel>();

		if (!objModel.getMatLib().getGroups().keySet().isEmpty()) {
			for (String key : objModel.getMatLib().getGroups().keySet()) {
				String k = key;
				if (!modelParts.containsKey(key)) {
					// public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)

					modelParts.put(k, objModel.bake(new OBJModel.OBJState(ImmutableList.of(k), false), MYFORMAT, textureGetterFlipV));
					// can use a list strings as a OBJModel.OBJState Turning those group objects on or off accordngly
				}
			}
		}

		modelParts.put(ALL_PARTS, objModel.bake(objModel.getDefaultState(), MYFORMAT, textureGetterFlipV));

		return modelParts;
	}
 
开发者ID:TechStack,项目名称:TechStack-s-HeavyMachineryMod,代码行数:21,代码来源:MachineModModelHelper.java

示例2: getResourceLocation

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public ResourceLocation getResourceLocation()
{
    try
    {
        if (f_modelLocation == null)
        {
            f_modelLocation = OBJModel.class.getDeclaredField("modelLocation");
            f_modelLocation.setAccessible(true);
        }
        if (f_modelLocation != null)
            return (ResourceLocation) f_modelLocation.get(this);
    } catch (Exception e)
    {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:18,代码来源:QBarOBJModel.java

示例3: getCustomData

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public Object getCustomData()
{
    try
    {
        if (f_customData == null)
        {
            f_customData = OBJModel.class.getDeclaredField("customData");
            f_customData.setAccessible(true);
        }
        if (f_customData != null)
            return f_customData.get(this);
    } catch (Exception e)
    {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:18,代码来源:QBarOBJModel.java

示例4: setCustomData

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public void setCustomData(Object data)
{
    try
    {
        if (f_customData == null)
        {
            f_customData = OBJModel.class.getDeclaredField("customData");
            f_customData.setAccessible(true);
        }
        if (f_customData != null)
            f_customData.set(this, data);
    } catch (Exception e)
    {
        e.printStackTrace();
    }
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:17,代码来源:QBarOBJModel.java

示例5: getModelsForGroups

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public static HashMap<String, IBakedModel> getModelsForGroups (OBJModel objModel) {

        HashMap<String, IBakedModel> modelParts = new HashMap<String, IBakedModel>();

        if (!objModel.getMatLib().getGroups().keySet().isEmpty()) {
        	for (String key : objModel.getMatLib().getGroups().keySet()) {
        		if (!modelParts.containsKey(key)) { 
        			modelParts.put(key, objModel.bake(new OBJModel.OBJState(ImmutableList.of(key), false), Attributes.DEFAULT_BAKED_FORMAT, ModelHelper.textureGetterFlipV));
        		}
        	}
        }

        modelParts.put(ALL_PARTS, objModel.bake(objModel.getDefaultState(), Attributes.DEFAULT_BAKED_FORMAT, textureGetterFlipV));

        return modelParts;
    }
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:17,代码来源:ModelHelper.java

示例6: loadModel

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public IBakedModel loadModel(String modelname) {
	IBakedModel ret = null;

	try {
		ret = bake((OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation(Thelta.MODID, modelname)));
	} catch (Exception e) {
		e.printStackTrace();
	}

	return ret;
}
 
开发者ID:Error22,项目名称:Thelta,代码行数:12,代码来源:TileEntityRendererMachineArm.java

示例7: loadModel

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public static OBJModel loadModel(String suffix){
    OBJModel model;

    try {
        model = ((OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation("tombmanygraves:models/block/" + suffix + ".obj")));
        return model;
    } catch (Exception e)
    {
        throw new ReportedException(new CrashReport("Error making the model for " + suffix + "!", e));
    }
}
 
开发者ID:M4thG33k,项目名称:TombManyGraves,代码行数:12,代码来源:ModelHelper.java

示例8: putVertexData

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
private final void putVertexData(UnpackedBakedQuad.Builder builder, OBJModel.Vertex v, OBJModel.Normal faceNormal,
                                 OBJModel.TextureCoordinate defUV, TextureAtlasSprite sprite)
{
    for (int e = 0; e < format.getElementCount(); e++)
    {
        switch (format.getElement(e).getUsage())
        {
            case POSITION:
                builder.put(e, v.getPos().x, v.getPos().y, v.getPos().z, v.getPos().w);
                break;
            case COLOR:
                if (v.getMaterial() != null)
                    builder.put(e, v.getMaterial().getColor().x, v.getMaterial().getColor().y,
                            v.getMaterial().getColor().z, v.getMaterial().getColor().w);
                else
                    builder.put(e, 1, 1, 1, 1);
                break;
            case UV:
                if (!v.hasTextureCoordinate())
                    builder.put(e, sprite.getInterpolatedU(defUV.u * 16),
                            sprite.getInterpolatedV((1 - defUV.v) * 16), 0, 1);
                else
                    builder.put(e, sprite.getInterpolatedU(v.getTextureCoordinate().u * 16),
                            sprite.getInterpolatedV((1 - v.getTextureCoordinate().v) * 16), 0, 1);
                break;
            case NORMAL:
                if (!v.hasNormal())
                    builder.put(e, faceNormal.x, faceNormal.y, faceNormal.z, 0);
                else
                    builder.put(e, v.getNormal().x, v.getNormal().y, v.getNormal().z, 0);
                break;
            default:
                builder.put(e);
        }
    }
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:37,代码来源:QBarBakedOBJModel.java

示例9: loadModel

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
@Override
public IModel loadModel(ResourceLocation modelLocation) throws IOException {
    IModel model = super.loadModel(modelLocation);
    if (model instanceof OBJModel) {
        ImmutableMap<String, String> flip = new ImmutableMap.Builder<String, String>().put("flip-v", "true").build();
        return ((OBJModel) model).process(flip);
    } else {
        return model;
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:11,代码来源:FactorizationClientProxy.java

示例10: ModelEternalFlames

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public ModelEternalFlames () {
    try {
        model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation("kk:models/item/eternalflames.obj"));
        modelParts = ModelHelper.getModelsForGroups(model);
    } catch (Exception e) {

    }
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:9,代码来源:ModelEternalFlames.java

示例11: ModelBurnout

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public ModelBurnout() {
    try {
        model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation("kk:models/item/burnout.obj"));
        modelParts = ModelHelper.getModelsForGroups(model);
    } catch (Exception e) {

    }
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:9,代码来源:ModelBurnout.java

示例12: ModelFerrisWheel

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public ModelFerrisWheel () {
    try {
        model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation("kk:models/item/ferriswheel.obj"));
        modelParts = ModelHelper.getModelsForGroups(model);
    } catch (Exception e) {

    }
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:9,代码来源:ModelFerrisWheel.java

示例13: ModelSizzlingEdge

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public ModelSizzlingEdge () {
    try {
        model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation("kk:models/item/sizzlingedge.obj"));
        modelParts = ModelHelper.getModelsForGroups(model);
    } catch (Exception e) {

    }
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:9,代码来源:ModelSizzlingEdge.java

示例14: ModelPrometheus

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public ModelPrometheus () {
    try {
        model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation("kk:models/item/prometheus.obj"));
        modelParts = ModelHelper.getModelsForGroups(model);
    } catch (Exception e) {

    }
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:9,代码来源:ModelPrometheus.java

示例15: ModelIfrit

import net.minecraftforge.client.model.obj.OBJModel; //导入依赖的package包/类
public ModelIfrit () {
    try {
        model = (OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation("kk:models/item/ifrit.obj"));
        modelParts = ModelHelper.getModelsForGroups(model);
    } catch (Exception e) {

    }
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:9,代码来源:ModelIfrit.java


注:本文中的net.minecraftforge.client.model.obj.OBJModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。