Table of Contents

Class Hud3DPanelScene

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll

Reusable 3D panel scene that owns a shape, mesh, animator, raycaster, and scene-local tessellation state. This avoids mutating shared dialog texture source state when a dialog needs multiple independently rendered shapes. Open in GitHub

public class Hud3DPanelScene : ITexPositionSource, IDisposable
Inheritance
Hud3DPanelScene
Implements
Inherited Members
Extension Methods

Constructors

Hud3DPanelScene(ICoreClientAPI, string, string, Func<float>, Func<float>, Func<float>, Func<(float x, float y)>, bool, bool, Func<string, bool>, Func<float>)

public Hud3DPanelScene(ICoreClientAPI capi, string rendererName, string shapePath, Func<float> getYaw, Func<float> getPitch, Func<float> getScale, Func<(float x, float y)> getScreenPosition, bool flipY, bool centerModelOrigin, Func<string, bool> isInteractiveHitbox, Func<float> getZOffset = null)

Parameters

capi ICoreClientAPI
rendererName string
shapePath string
getYaw Func<float>
getPitch Func<float>
getScale Func<float>
getScreenPosition Func<(float x, float y)>
flipY bool
centerModelOrigin bool
isInteractiveHitbox Func<string, bool>
getZOffset Func<float>

Properties

Animator

public ClientAnimator Animator { get; }

Property Value

ClientAnimator

AtlasSize

This returns the size of the atlas this texture resides in.

public Size2i AtlasSize { get; }

Property Value

Size2i

AtlasTextureId

public int AtlasTextureId { get; }

Property Value

int

this[string]

public TextureAtlasPosition this[string textureCode] { get; }

Parameters

textureCode string

Property Value

TextureAtlasPosition

MeshRef

public MultiTextureMeshRef MeshRef { get; }

Property Value

MultiTextureMeshRef

RayCaster

public ModelRayCaster RayCaster { get; }

Property Value

ModelRayCaster

Shape

public Shape Shape { get; }

Property Value

Shape

Methods

BuildModelMatrix()

public Matrixf BuildModelMatrix()

Returns

Matrixf

CreateRayCaster()

public void CreateRayCaster()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FindElementByName(ShapeElement[], string)

public static ShapeElement FindElementByName(ShapeElement[] elements, string name)

Parameters

elements ShapeElement[]
name string

Returns

ShapeElement

Load()

public bool Load()

Returns

bool

RayCastToHitbox(int, int, out ElementHitbox, out Vec3d)

public bool RayCastToHitbox(int x, int y, out ElementHitbox hitbox, out Vec3d hitPosition)

Parameters

x int
y int
hitbox ElementHitbox
hitPosition Vec3d

Returns

bool

RenderMeshInline(IShaderProgram, MultiTextureMeshRef, bool)

public void RenderMeshInline(IShaderProgram prog, MultiTextureMeshRef mesh = null, bool applyAnimation = true)

Parameters

prog IShaderProgram
mesh MultiTextureMeshRef
applyAnimation bool

RenderMeshStandalone(IShaderProgram, MultiTextureMeshRef, bool)

public void RenderMeshStandalone(IShaderProgram prog, MultiTextureMeshRef mesh = null, bool applyAnimation = true)

Parameters

prog IShaderProgram
mesh MultiTextureMeshRef
applyAnimation bool

ReplaceMesh(MultiTextureMeshRef)

public void ReplaceMesh(MultiTextureMeshRef mesh)

Parameters

mesh MultiTextureMeshRef

StartAnimation(string, float, bool, EnumAnimationBlendMode)

public bool StartAnimation(string code, float speed = 1, bool stopOthers = false, EnumAnimationBlendMode blendMode = EnumAnimationBlendMode.Average)

Parameters

code string
speed float
stopOthers bool
blendMode EnumAnimationBlendMode

Returns

bool

StopAnimation(string)

public void StopAnimation(string code)

Parameters

code string

StopAnimationsWithPrefix(string)

public void StopAnimationsWithPrefix(string prefix)

Parameters

prefix string

TessellateElementWithTemporaryFaceTexture(string, string, string, int)

public MultiTextureMeshRef TessellateElementWithTemporaryFaceTexture(string elementName, string elementPath, string faceTextureCode, int faceIndex = 4)

Parameters

elementName string
elementPath string
faceTextureCode string
faceIndex int

Returns

MultiTextureMeshRef

TessellateFiltered(string[], string[])

public MultiTextureMeshRef TessellateFiltered(string[] selectiveElements = null, string[] ignoreElements = null)

Parameters

selectiveElements string[]
ignoreElements string[]

Returns

MultiTextureMeshRef

UpdateAnimations(float)

public void UpdateAnimations(float deltaTime)

Parameters

deltaTime float