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
capiICoreClientAPIrendererNamestringshapePathstringgetYawFunc<float>getPitchFunc<float>getScaleFunc<float>getScreenPositionFunc<(float x, float y)>flipYboolcenterModelOriginboolisInteractiveHitboxFunc<string, bool>getZOffsetFunc<float>
Properties
Animator
public ClientAnimator Animator { get; }
Property Value
AtlasSize
This returns the size of the atlas this texture resides in.
public Size2i AtlasSize { get; }
Property Value
AtlasTextureId
public int AtlasTextureId { get; }
Property Value
this[string]
public TextureAtlasPosition this[string textureCode] { get; }
Parameters
textureCodestring
Property Value
MeshRef
public MultiTextureMeshRef MeshRef { get; }
Property Value
RayCaster
public ModelRayCaster RayCaster { get; }
Property Value
Shape
public Shape Shape { get; }
Property Value
Methods
BuildModelMatrix()
public Matrixf BuildModelMatrix()
Returns
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
elementsShapeElement[]namestring
Returns
Load()
public bool Load()
Returns
RayCastToHitbox(int, int, out ElementHitbox, out Vec3d)
public bool RayCastToHitbox(int x, int y, out ElementHitbox hitbox, out Vec3d hitPosition)
Parameters
xintyinthitboxElementHitboxhitPositionVec3d
Returns
RenderMeshInline(IShaderProgram, MultiTextureMeshRef, bool)
public void RenderMeshInline(IShaderProgram prog, MultiTextureMeshRef mesh = null, bool applyAnimation = true)
Parameters
progIShaderProgrammeshMultiTextureMeshRefapplyAnimationbool
RenderMeshStandalone(IShaderProgram, MultiTextureMeshRef, bool)
public void RenderMeshStandalone(IShaderProgram prog, MultiTextureMeshRef mesh = null, bool applyAnimation = true)
Parameters
progIShaderProgrammeshMultiTextureMeshRefapplyAnimationbool
ReplaceMesh(MultiTextureMeshRef)
public void ReplaceMesh(MultiTextureMeshRef mesh)
Parameters
meshMultiTextureMeshRef
StartAnimation(string, float, bool, EnumAnimationBlendMode)
public bool StartAnimation(string code, float speed = 1, bool stopOthers = false, EnumAnimationBlendMode blendMode = EnumAnimationBlendMode.Average)
Parameters
codestringspeedfloatstopOthersboolblendModeEnumAnimationBlendMode
Returns
StopAnimation(string)
public void StopAnimation(string code)
Parameters
codestring
StopAnimationsWithPrefix(string)
public void StopAnimationsWithPrefix(string prefix)
Parameters
prefixstring
TessellateElementWithTemporaryFaceTexture(string, string, string, int)
public MultiTextureMeshRef TessellateElementWithTemporaryFaceTexture(string elementName, string elementPath, string faceTextureCode, int faceIndex = 4)
Parameters
Returns
TessellateFiltered(string[], string[])
public MultiTextureMeshRef TessellateFiltered(string[] selectiveElements = null, string[] ignoreElements = null)
Parameters
Returns
UpdateAnimations(float)
public void UpdateAnimations(float deltaTime)
Parameters
deltaTimefloat