本文整理汇总了Java中net.minecraftforge.client.model.IPerspectiveAwareModel类的典型用法代码示例。如果您正苦于以下问题:Java IPerspectiveAwareModel类的具体用法?Java IPerspectiveAwareModel怎么用?Java IPerspectiveAwareModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPerspectiveAwareModel类属于net.minecraftforge.client.model包,在下文中一共展示了IPerspectiveAwareModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
if (baseSpellPageModel instanceof IPerspectiveAwareModel) {
Matrix4f matrix4f = ((IPerspectiveAwareModel) baseSpellPageModel).handlePerspective(cameraTransformType)
.getRight();
return Pair.of(this, matrix4f);
}
ItemCameraTransforms itemCameraTransforms = baseSpellPageModel.getItemCameraTransforms();
ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType);
TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f);
Matrix4f mat = null;
if (tr != null) {
mat = tr.getMatrix();
}
return Pair.of(this, mat);
}
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:17,代码来源:ModelSpellPage.java
示例2: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
if (baseKnowledgeBookModel instanceof IPerspectiveAwareModel) {
Matrix4f matrix4f = ((IPerspectiveAwareModel) baseKnowledgeBookModel).handlePerspective(cameraTransformType)
.getRight();
return Pair.of(this, matrix4f);
}
ItemCameraTransforms itemCameraTransforms = baseKnowledgeBookModel.getItemCameraTransforms();
ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType);
TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f);
Matrix4f mat = null;
if (tr != null) {
mat = tr.getMatrix();
}
return Pair.of(this, mat);
}
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:17,代码来源:ModelKnowledgeBook.java
示例3: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
if (parentModel instanceof IPerspectiveAwareModel) {
Matrix4f matrix4f = ((IPerspectiveAwareModel) parentModel).handlePerspective(cameraTransformType)
.getRight();
return Pair.of(this, matrix4f);
}
ItemCameraTransforms itemCameraTransforms = parentModel.getItemCameraTransforms();
ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType);
TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f);
Matrix4f mat = null;
if (tr != null) {
mat = tr.getMatrix();
}
return Pair.of(this, mat);
}
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:17,代码来源:BakedModelKnowledgeBook.java
示例4: bake
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public IBakedModel bake(IModelState state, 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++)
{
ResourceLocation tex = textures.get(i);
if(tex.toString().equals("minecraft:missingno"))
continue;
TextureAtlasSprite sprite = bakedTextureGetter.apply(tex);
String breakLocation = new ResourceLocation(Reference.MOD_ID,"items/breakmask").toString();
TextureAtlasSprite breakTemplate = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(breakLocation);
builder.addAll(getQuadsForSprite(i, breakTemplate, sprite, format, transform));
//builder.addAll(ItemTextureQuadConverter.convertTexture(format, transform, breakTemplate, sprite, NORTH_Z + Z_OFFSET * i, EnumFacing.NORTH, 0xffffffff));
// builder.addAll(ItemTextureQuadConverter.convertTexture(format, transform, breakTemplate, sprite, SOUTH_Z - Z_OFFSET * i, EnumFacing.SOUTH, 0xffffffff));
}
TextureAtlasSprite particle = bakedTextureGetter.apply(textures.isEmpty() ? new ResourceLocation("missingno") : textures.get(0));
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> map = IPerspectiveAwareModel.MapWrapper.getTransforms(state);
return new BakedItemModel(builder.build(), particle, map, null);
}
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:23,代码来源:ModelToolShardInner.java
示例5: handleCameraTransforms
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public static IBakedModel handleCameraTransforms(IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType, boolean leftHandHackery)
{
if(model instanceof IPerspectiveAwareModel)
{
Pair<? extends IBakedModel, Matrix4f> pair = ((IPerspectiveAwareModel)model).handlePerspective(cameraTransformType);
if(pair.getRight() != null)
{
Matrix4f matrix = new Matrix4f(pair.getRight());
if(leftHandHackery)
{
matrix.mul(flipX, matrix);
matrix.mul(matrix, flipX);
}
multiplyCurrentGlMatrix(matrix);
}
return pair.getLeft();
}
else
{
//if(leftHandHackery) GlStateManager.scale(-1, 1, 1);
ItemCameraTransforms.applyTransformSide(model.getItemCameraTransforms().getTransform(cameraTransformType), leftHandHackery);
//if(leftHandHackery) GlStateManager.scale(-1, 1, 1);
}
return model;
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:ForgeHooksClient.java
示例6: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType type) {
Pair<? extends IBakedModel, Matrix4f> pair = IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, type);
if(type == TransformType.GUI && !isCulled && pair.getRight() == null)
{
return Pair.of(otherModel, null);
}
else if(type != TransformType.GUI && isCulled)
{
return Pair.of(otherModel, pair.getRight());
}
return pair;
}
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:14,代码来源:ModelToolShardInner.java
示例7: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType type)
{
Pair<? extends IBakedModel, Matrix4f> pair = IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, type);
if(type == TransformType.GUI && !isCulled && pair.getRight() == null)
{
return Pair.of(otherModel, null);
}
else if(type != TransformType.GUI && isCulled)
{
return Pair.of(otherModel, pair.getRight());
}
return pair;
}
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:15,代码来源:ModelCustomLayers.java
示例8: getBasicTransforms
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
/**
* Creates the basic TRSRTransformations for a perspective aware model.
*
* @param model The model to get the transforms for.
* @return An immutable map of all the transforms.
*/
public static ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> getBasicTransforms (IPerspectiveAwareModel model) {
final ImmutableMap.Builder<ItemCameraTransforms.TransformType, TRSRTransformation> builder = ImmutableMap.builder();
for (final ItemCameraTransforms.TransformType type : ItemCameraTransforms.TransformType.values()) {
final TRSRTransformation transformation = new TRSRTransformation(model.handlePerspective(type).getRight());
if (!transformation.equals(TRSRTransformation.identity()))
builder.put(type, TRSRTransformation.blockCenterToCorner(transformation));
}
return builder.build();
}
开发者ID:MinecraftModDevelopmentMods,项目名称:MMDLib-old,代码行数:16,代码来源:RenderUtils.java
示例9: getTransforms
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
public static ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> getTransforms(IPerspectiveAwareModel model) {
ImmutableMap.Builder<ItemCameraTransforms.TransformType, TRSRTransformation> builder = ImmutableMap.builder();
for(ItemCameraTransforms.TransformType type : ItemCameraTransforms.TransformType.values()) {
TRSRTransformation transformation = new TRSRTransformation(model.handlePerspective(type).getRight());
if(!transformation.equals(TRSRTransformation.identity())) {
builder.put(type, TRSRTransformation.blockCenterToCorner(transformation));
}
}
return builder.build();
}
开发者ID:Deadrik,项目名称:TFC2,代码行数:11,代码来源:BakedSmallVesselModel.java
示例10: replaceAnvilModel
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
public static void replaceAnvilModel(ModelResourceLocation modelVariantLocation, ResourceLocation modelLocation, ModelBakeEvent event) {
try {
IModel model = ModelLoaderRegistry.getModel(modelLocation);
IBakedModel standard = event.getModelRegistry().getObject(modelVariantLocation);
if(standard instanceof IPerspectiveAwareModel) {
IBakedModel finalModel = new BakedAnvilModel((IPerspectiveAwareModel) standard, DefaultVertexFormats.BLOCK);
event.getModelRegistry().putObject(modelVariantLocation, finalModel);
}
} catch(Exception e) {
e.printStackTrace();
}
}
开发者ID:Deadrik,项目名称:TFC2,代码行数:15,代码来源:ModelBakeHandler.java
示例11: replacePitKilnModel
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
public static void replacePitKilnModel(ModelResourceLocation modelVariantLocation, ResourceLocation modelLocation, ModelBakeEvent event) {
try {
IModel model = ModelLoaderRegistry.getModel(modelLocation);
IBakedModel standard = event.getModelRegistry().getObject(modelVariantLocation);
if(standard instanceof IPerspectiveAwareModel) {
IBakedModel finalModel = new BakedPitKilnModel((IPerspectiveAwareModel) standard, DefaultVertexFormats.BLOCK);
event.getModelRegistry().putObject(modelVariantLocation, finalModel);
}
} catch(Exception e) {
e.printStackTrace();
}
}
开发者ID:Deadrik,项目名称:TFC2,代码行数:15,代码来源:ModelBakeHandler.java
示例12: replaceSmallVesselModel
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
public static void replaceSmallVesselModel(ModelResourceLocation modelVariantLocation, ResourceLocation modelLocation, ModelBakeEvent event) {
try {
IModel model = ModelLoaderRegistry.getModel(modelLocation);
IBakedModel standard = event.getModelRegistry().getObject(modelVariantLocation);
if(standard instanceof IPerspectiveAwareModel) {
IBakedModel finalModel = new BakedSmallVesselModel((IPerspectiveAwareModel) standard, DefaultVertexFormats.BLOCK);
event.getModelRegistry().putObject(modelVariantLocation, finalModel);
}
} catch(Exception e) {
e.printStackTrace();
}
}
开发者ID:Deadrik,项目名称:TFC2,代码行数:15,代码来源:ModelBakeHandler.java
示例13: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
if (parent instanceof IPerspectiveAwareModel) {
Pair<? extends IBakedModel, Matrix4f> perspective = ((IPerspectiveAwareModel) parent).handlePerspective(cameraTransformType);
return Pair.of(this, perspective.getRight());
}
return Pair.of(this, null);
}
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:9,代码来源:CollectedItemQuadBakedBlockModel.java
示例14: handleItemState
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public @Nonnull IBakedModel handleItemState(@Nonnull IBakedModel originalModel, @Nonnull ItemStack stack, @Nullable World world,
@Nullable EntityLivingBase entity) {
if (originalModel != RotatingSmartItemModel.this) {
return originalModel;
}
IBakedModel newBase = parent.getOverrides().handleItemState(parent, stack, world, entity);
if (parent != newBase && newBase instanceof IPerspectiveAwareModel) {
return new RotatingSmartItemModel((IPerspectiveAwareModel) newBase, speed);
}
return RotatingSmartItemModel.this;
}
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:14,代码来源:RotatingSmartItemModel.java
示例15: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
if (getDefaults() instanceof IPerspectiveAwareModel) {
Pair<? extends IBakedModel, Matrix4f> perspective = ((IPerspectiveAwareModel) getDefaults()).handlePerspective(cameraTransformType);
return Pair.of(this, perspective.getRight());
}
return Pair.of(this, null);
}
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:9,代码来源:RelayingBakedModel.java
示例16: registerRotating
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
public static void registerRotating(@Nonnull String resource, final int speed) {
register(resource, new Registry() {
@Override
public @Nonnull IBakedModel wrap(@Nonnull IBakedModel model) {
return new RotatingSmartItemModel((IPerspectiveAwareModel) model, speed);
}
});
}
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:9,代码来源:ItemModelRegistry.java
示例17: registerFacade
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
public static void registerFacade(@Nonnull ModelResourceLocation resource) {
register(resource, new Registry() {
@Override
public @Nonnull IBakedModel wrap(@Nonnull IBakedModel model) {
return new FacadeSmartItemModel((IPerspectiveAwareModel) model);
}
});
}
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:9,代码来源:ItemModelRegistry.java
示例18: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType)
{
return IPerspectiveAwareModel.MapWrapper.handlePerspective(this, state, cameraTransformType);
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:B3DLoader.java
示例19: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
{
return IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, cameraTransformType);
}
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:6,代码来源:ModelToolShard.java
示例20: handlePerspective
import net.minecraftforge.client.model.IPerspectiveAwareModel; //导入依赖的package包/类
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
return IPerspectiveAwareModel.MapWrapper.handlePerspective(this, DynamicBaseModel.DEFAULT_PERSPECTIVE_TRANSFORMS, cameraTransformType);
}
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:5,代码来源:ModelCoral.java
注:本文中的net.minecraftforge.client.model.IPerspectiveAwareModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论