• 论坛

导航

  • 主页
  • 样式指南
  • 入门
    • 概述
    • Mod的结构
    • Forge更新检查器
    • 依赖管理
    • 调试分析器
  • 概念
    • Sides
    • 资源
    • 注册表
    • Jar签名
    • 国际化和本地化
  • 方块
    • 概述
    • 介绍方块状态
    • 方块互动
  • 动画 API
    • 概述
    • 骨骼
    • 动画状态机
    • 使用API
  • TileEntity
    • 概述
    • 特殊渲染器
  • 物品
    • 主页
    • 战利品表
  • 模型
    • 模型概述
    • 模型文件
    • 方块状态
      • 方块状态JSON概述
      • Forge方块状态JSON
    • 绑定模型到方块和物品
    • 彩色纹理
    • 物品属性概述
    • 高级模型(未翻译)
      • 高级模型介绍
      • IModel
      • IModelState and IModelPart
      • IBakedModel
      • Extended Blockstates
      • Perspective
      • ItemOverrideList
      • ICustomModelLoader
  • 渲染
    • TileEntityItemStackRenderer
  • 事件
    • 基本用法
  • 网络
    • 主页
    • 概述
    • SimpleImpl
    • 实体
  • 数据储存
    • 能力系统
    • World Saved Data
    • 拓展实体属性
    • Config注解
  • 工具
    • 合成
    • 矿物词典
    • 权限API
  • 效果
    • 音效
  • 惯例
    • 版本命名
    • 文件位置
    • 加载阶段
  • 参与Forge开发
    • 入门
    • PR指南

IModelState and IModelPart

IModelState and IModelPart are a way to transform models (or parts thereof). An IModelPart represents the part of the model being transformed. An IModelState represents a function IModelPart → TRSRTransform. By applying the IModelState to an IModelPart, we get a TRSRTransform representing how to transform that part. Note that passing Optional.absent() to IModelState::apply has a different meaning than usual. Doing so means getting the transform for the entire model, instead of just a part of it.

One of the uses of this is animation. An IModelState can represent a certain frame of the animation and supply transforms to turn the original model into the current frame. By supplying different IModelStates over time, an animation can be performed. For example, the B3D model format supports this kind of animation directly through its nodes; however, the animation system is still WIP. Another, more common use case is Forge blockstate JSONs. The models within the blockstates can be transformed with transform tags, which translate into simple IModelStates that are passed into the contained models. Finally, another use case is perspective aware models.

Which IModelParts a certain model will use is dependent on the model itself. If I had a B3DState that dealt with B3D NodeJoints and tried to use it on a vanilla JSON model, it wouldn’t work as vanilla models have no idea what a NodeJoint is and will not even ask about them.

基于 MkDocs 使用自定义主题构建. 托管于 Read the Docs.
启用夜间模式