Table of Contents

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 ModelTransformNoDefaults
defaults ModelTransform

Properties

NoTransform

Gets a new model with all values set to default.

public static ModelTransform NoTransform { get; }

Property Value

ModelTransform

Methods

BlockDefaultFp()

Scale = 1, No Translation, Rotation by -45 deg in Y-Axis

public static ModelTransform BlockDefaultFp()

Returns

ModelTransform

BlockDefaultGround()

Scale = 1, No Translation, Rotation by -45 deg in Y-Axis, 1.5x scale

public static ModelTransform BlockDefaultGround()

Returns

ModelTransform

BlockDefaultGui()

Scale = 1, No Translation, Rotation by -45 deg in Y-Axis

public static ModelTransform BlockDefaultGui()

Returns

ModelTransform

BlockDefaultTp()

Scale = 1, No Translation, Rotation by -45 deg in Y-Axis

public static ModelTransform BlockDefaultTp()

Returns

ModelTransform

Clone()

Clones this specific transform.

public ModelTransform Clone()

Returns

ModelTransform

EnsureDefaultValues()

Makes sure that Translation and Rotation is not null

public ModelTransform EnsureDefaultValues()

Returns

ModelTransform

ItemDefaultFp()

Scale = 1, No Translation, Rotation by 180 deg in X-Axis

public static ModelTransform ItemDefaultFp()

Returns

ModelTransform

ItemDefaultGround()

Creates a default transform for a model that is now on the ground

public static ModelTransform ItemDefaultGround()

Returns

ModelTransform

ItemDefaultGui()

Scale = 1, No Translation, No Rotation

public static ModelTransform ItemDefaultGui()

Returns

ModelTransform

ItemDefaultTp()

Scale = 1, No Translation, Rotation by 180 deg in X-Axis

public static ModelTransform ItemDefaultTp()

Returns

ModelTransform

WithRotation(Vec3f)

public ModelTransform WithRotation(Vec3f rot)

Parameters

rot Vec3f

Returns

ModelTransform