Table of Contents

Class CompositeShape

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Holds shape data to create 3D representations of objects. Also allows shapes to be overlayed on top of one another recursively.

public class CompositeShape
Inheritance
CompositeShape
Inherited Members
Extension Methods

Examples

"shape": { "base": "block/basic/cube" },
"shapeInventory": {
 	"base": "block/plant/bamboo/{color}/{part}-1",
 	"overlays": [ { "base": "block/plant/bamboo/{color}/{part}lod0-1" } ]
},

Fields

Alternates

The block shape may consists of any amount of alternatives, one of which will be randomly chosen when the shape is chosen.

public CompositeShape[] Alternates

Field Value

CompositeShape[]

BakedAlternates

Includes the base shape

public CompositeShape[] BakedAlternates

Field Value

CompositeShape[]

Base

The path to this shape file.

public AssetLocation Base

Field Value

AssetLocation

Format

The format/filetype of this shape.

public EnumShapeFormat Format

Field Value

EnumShapeFormat

IgnoreElements

If set will not tesselate elements with given name

public string[] IgnoreElements

Field Value

string[]

InsertBakedTextures

Whether or not to insert baked in textures for mesh formats such as gltf into the texture atlas.

public bool InsertBakedTextures

Field Value

bool

Overlays

The shape will render all overlays on top of this shape. Can be used to group multiple shapes into one composite shape.

public CompositeShape[] Overlays

Field Value

CompositeShape[]

QuantityElements

If non zero will only tesselate the first n elements of the shape

public int? QuantityElements

Field Value

int?

Scale

The scale of this shape on all axes.

public float Scale

Field Value

float

SelectiveElements

If set will only tesselate elements with given name

public string[] SelectiveElements

Field Value

string[]

VoxelizeTexture

If true, the shape is created from a voxelized version of the first defined texture

public bool VoxelizeTexture

Field Value

bool

offsetX

How much should this shape be offset on X axis?

public float offsetX

Field Value

float

offsetY

How much should this shape be offset on Y axis?

public float offsetY

Field Value

float

offsetZ

How much should this shape be offset on Z axis?

public float offsetZ

Field Value

float

rotateX

How much, in degrees, should this shape be rotated around the X axis?

public float rotateX

Field Value

float

rotateY

How much, in degrees, should this shape be rotated around the Y axis?

public float rotateY

Field Value

float

rotateZ

How much, in degrees, should this shape be rotated around the Z axis?

public float rotateZ

Field Value

float

Properties

OffsetXYZCopy

public Vec3f OffsetXYZCopy { get; }

Property Value

Vec3f

RotateXYZCopy

public Vec3f RotateXYZCopy { get; }

Property Value

Vec3f

Methods

Clone()

Creates a deep copy of the composite shape

public CompositeShape Clone()

Returns

CompositeShape

CloneWithoutAlternates()

Creates a deep copy of the shape, but omitting its alternates (used to populate the alternates)

public CompositeShape CloneWithoutAlternates()

Returns

CompositeShape

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

LoadAlternates(IAssetManager, ILogger)

Expands the Composite Shape and populates the Baked field

public void LoadAlternates(IAssetManager assetManager, ILogger logger)

Parameters

assetManager IAssetManager
logger ILogger

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.