Table of Contents

Class ModelTransformNoDefaults

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Controls the transformations of 3D shapes. Note that defaults change depending on where this class is used.

[JsonObject(MemberSerialization.OptIn)]
public class ModelTransformNoDefaults
Inheritance
ModelTransformNoDefaults
Derived
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
},

Fields

Origin

Rotation/Scaling Origin

[JsonProperty]
public Vec3f Origin

Field Value

Vec3f

Rotate

For Gui Transform: Whether to slowly spin in gui item preview For Ground Transform: Whether to apply a random rotation to the dropped item No effect on other transforms

[JsonProperty]
public bool Rotate

Field Value

bool

Rotation

Rotation in degrees

[JsonProperty]
public Vec3f Rotation

Field Value

Vec3f

ScaleXYZ

Scaling per axis

[JsonProperty]
public Vec3f ScaleXYZ

Field Value

Vec3f

Translation

Offsetting

[JsonProperty]
public Vec3f Translation

Field Value

Vec3f

Properties

AsMatrix

Converts the transform into a matrix.

public float[] AsMatrix { get; }

Property Value

float[]

Scale

Sets the same scale of an object for all axes.

[JsonProperty]
public float Scale { set; }

Property Value

float

Methods

Clear()

Clears the transformation values.

public void Clear()