Class ModelTransform
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Used for transformations applied to a block or item model. Uses values from ModelTransformNoDefaults but will assign defaults if not included.
public class ModelTransform : ModelTransformNoDefaults
- Inheritance
-
ModelTransform
- Inherited Members
- Extension Methods
Examples
Use '.tfedit' in game to help customize these values, just make sure to copy them into your json file when you finish.
"tpHandTransform": {
"translation": {
"x": -0.87,
"y": -0.01,
"z": -0.56
},
"rotation": {
"x": -90,
"y": 0,
"z": 0
},
"origin": {
"x": 0.5,
"y": 0,
"z": 0.5
},
"scale": 0.8
},
Constructors
ModelTransform()
public ModelTransform()
ModelTransform(ModelTransformNoDefaults, ModelTransform)
public ModelTransform(ModelTransformNoDefaults baseTf, ModelTransform defaults)
Parameters
baseTf
ModelTransformNoDefaultsdefaults
ModelTransform
Properties
NoTransform
Gets a new model with all values set to default.
public static ModelTransform NoTransform { get; }
Property Value
Methods
BlockDefaultFp()
Scale = 1, No Translation, Rotation by -45 deg in Y-Axis
public static ModelTransform BlockDefaultFp()
Returns
BlockDefaultGround()
Scale = 1, No Translation, Rotation by -45 deg in Y-Axis, 1.5x scale
public static ModelTransform BlockDefaultGround()
Returns
BlockDefaultGui()
Scale = 1, No Translation, Rotation by -45 deg in Y-Axis
public static ModelTransform BlockDefaultGui()
Returns
BlockDefaultTp()
Scale = 1, No Translation, Rotation by -45 deg in Y-Axis
public static ModelTransform BlockDefaultTp()
Returns
Clone()
Clones this specific transform.
public ModelTransform Clone()
Returns
EnsureDefaultValues()
Makes sure that Translation and Rotation is not null
public ModelTransform EnsureDefaultValues()
Returns
ItemDefaultFp()
Scale = 1, No Translation, Rotation by 180 deg in X-Axis
public static ModelTransform ItemDefaultFp()
Returns
ItemDefaultGround()
Creates a default transform for a model that is now on the ground
public static ModelTransform ItemDefaultGround()
Returns
ItemDefaultGui()
Scale = 1, No Translation, No Rotation
public static ModelTransform ItemDefaultGui()
Returns
ItemDefaultTp()
Scale = 1, No Translation, Rotation by 180 deg in X-Axis
public static ModelTransform ItemDefaultTp()
Returns
WithRotation(Vec3f)
public ModelTransform WithRotation(Vec3f rot)
Parameters
rot
Vec3f