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


Java IModelState.apply方法代码示例

本文整理汇总了Java中net.minecraftforge.common.model.IModelState.apply方法的典型用法代码示例。如果您正苦于以下问题:Java IModelState.apply方法的具体用法?Java IModelState.apply怎么用?Java IModelState.apply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.model.IModelState的用法示例。


在下文中一共展示了IModelState.apply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPartTransform

import net.minecraftforge.common.model.IModelState; //导入方法依赖的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

示例2: getTransforms

import net.minecraftforge.common.model.IModelState; //导入方法依赖的package包/类
public static ImmutableMap<TransformType, TRSRTransformation> getTransforms(IModelState state)
{
    ImmutableMap.Builder<TransformType, TRSRTransformation> builder = ImmutableMap.builder();
    for(TransformType type : TransformType.values())
    {
        Optional<TRSRTransformation> tr = state.apply(Optional.of(type));
        if(tr.isPresent())
        {
            builder.put(type, tr.get());
        }
    }
    return builder.build();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:IPerspectiveAwareModel.java

示例3: bake

import net.minecraftforge.common.model.IModelState; //导入方法依赖的package包/类
public IBakedModel bake(IModelState state, final VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
    Optional<TRSRTransformation> transform = state.apply(Optional.<IModelPart>absent());
    for(int i = 0; i < textures.size(); i++)
    {
        TextureAtlasSprite sprite = bakedTextureGetter.apply(textures.get(i));
        builder.addAll(getQuadsForSprite(i, sprite, format, transform));
    }
    TextureAtlasSprite particle = bakedTextureGetter.apply(textures.isEmpty() ? new ResourceLocation("missingno") : textures.get(0));
    ImmutableMap<TransformType, TRSRTransformation> map = IPerspectiveAwareModel.MapWrapper.getTransforms(state);
    return new BakedItemModel(builder.build(), particle, map, overrides, null);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:ItemLayerModel.java

示例4: bake

import net.minecraftforge.common.model.IModelState; //导入方法依赖的package包/类
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
    ImmutableMap<TransformType, TRSRTransformation> map = IPerspectiveAwareModel.MapWrapper.getTransforms(state);
    return new BakedFluid(state.apply(Optional.<IModelPart>absent()), map, format, fluid.getColor(), bakedTextureGetter.apply(fluid.getStill()), bakedTextureGetter.apply(fluid.getFlowing()), fluid.isGaseous(), Optional.<IExtendedBlockState>absent());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:ModelFluid.java


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