Class ShapeElement
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
A shape element built from JSON data within the model.
[JsonObject(MemberSerialization.OptIn)]
public class ShapeElement
- Inheritance
-
ShapeElement
- Inherited Members
- Extension Methods
Fields
AttachmentPoints
The attachment points for this shape.
[JsonProperty]
public AttachmentPoint[] AttachmentPoints
Field Value
Children
The child shapes of this shape element
[JsonProperty]
public ShapeElement[] Children
Field Value
ClimateColorMap
[JsonProperty]
public string ClimateColorMap
Field Value
Color
For entity animations
public int Color
Field Value
DamageEffect
public float DamageEffect
Field Value
DisableRandomDrawOffset
Set this to true to disable randomDrawOffset and randomRotations on this specific element (e.g. used for the ice element of Coopers Reeds in Ice)
[JsonProperty]
public bool DisableRandomDrawOffset
Field Value
Faces
The faces of the shape element by name (will normally be null except during object deserialization: use FacesResolved instead!)
[JsonProperty]
[Obsolete("Use FacesResolved instead")]
public Dictionary<string, ShapeElementFace> Faces
Field Value
FacesResolved
An array holding the faces of this shape element in BlockFacing order: North, East, South, West, Up, Down. May be null if not present or not enabled.
public ShapeElementFace[] FacesResolved
Field Value
From
[JsonProperty]
public double[] From
Field Value
- double[]
GradientShade
[JsonProperty]
public bool GradientShade
Field Value
JointId
The id of the joint attached to the parent element.
public int JointId
Field Value
Logger
A static reference to the logger (null on a server) - we don't want to hold a reference to the platform or api in every ShapeElement
public static ILogger Logger
Field Value
Name
The name of the ShapeElement
[JsonProperty]
public string Name
Field Value
ParentElement
The parent element reference for this shape.
public ShapeElement ParentElement
Field Value
RenderPass
[JsonProperty]
public short RenderPass
Field Value
RotationOrigin
The origin point for rotation.
[JsonProperty]
public double[] RotationOrigin
Field Value
- double[]
RotationX
The forward vertical rotation of the shape element.
[JsonProperty]
public double RotationX
Field Value
RotationY
The forward vertical rotation of the shape element.
[JsonProperty]
public double RotationY
Field Value
RotationZ
The left/right tilt of the shape element
[JsonProperty]
public double RotationZ
Field Value
ScaleX
How far away are the left/right sides of the shape from the center
[JsonProperty]
public double ScaleX
Field Value
ScaleY
How far away are the top/bottom sides of the shape from the center
[JsonProperty]
public double ScaleY
Field Value
ScaleZ
How far away are the front/back sides of the shape from the center.
[JsonProperty]
public double ScaleZ
Field Value
SeasonColorMap
[JsonProperty]
public string SeasonColorMap
Field Value
Shade
Whether or not the shape element is shaded.
[JsonProperty]
public bool Shade
Field Value
StepParentName
The "remote" parent for this element
[JsonProperty]
public string StepParentName
Field Value
To
[JsonProperty]
public double[] To
Field Value
- double[]
ZOffset
[JsonProperty]
public short ZOffset
Field Value
inverseModelTransform
public float[] inverseModelTransform
Field Value
- float[]
locationForLogging
public static object locationForLogging
Field Value
Methods
CacheInverseTransformMatrix()
public void CacheInverseTransformMatrix()
CacheInverseTransformMatrixRecursive()
public void CacheInverseTransformMatrixRecursive()
Clone()
public ShapeElement Clone()
Returns
GetInverseModelMatrix()
Returns the full inverse model matrix (includes all parent transforms)
public float[] GetInverseModelMatrix()
Returns
- float[]
GetLocalTransformMatrix(int, float[], ElementPose)
public float[] GetLocalTransformMatrix(int animVersion, float[] output = null, ElementPose tf = null)
Parameters
animVersion
intoutput
float[]tf
ElementPose
Returns
- float[]
GetParentPath()
Walks the element tree and collects all parents, starting with the root element
public List<ShapeElement> GetParentPath()
Returns
SetJointIdRecursive(int)
public void SetJointIdRecursive(int jointId)
Parameters
jointId
int
WalkRecursive(Action<ShapeElement>)
public void WalkRecursive(Action<ShapeElement> onElem)
Parameters
onElem
Action<ShapeElement>