Class ShapeSceneNode
Namespace: ValveResourceFormat.Renderer.SceneNodes
Assembly: Renderer.dll
Base class for scene nodes that render primitive shapes like boxes, spheres, and capsules.
public abstract class ShapeSceneNode : SceneNodeInheritance
object ← SceneNode ← ShapeSceneNode
Derived
NavMeshSceneNode, PhysSceneNode
Inherited Members
SceneNode.Transform, SceneNode.LayerName, SceneNode.LayerEnabled, SceneNode.BoundingBox, SceneNode.LocalBoundingBox, SceneNode.Name, SceneNode.Id, SceneNode.IsSelected, SceneNode.Flags, SceneNode.Scene, SceneNode.EnvMaps, SceneNode.ShaderEnvMapVisibility, SceneNode.LightingOrigin, SceneNode.OverlayRenderOrder, SceneNode.CubeMapPrecomputedHandshake, SceneNode.LightProbeVolumePrecomputedHandshake, SceneNode.LightProbeBinding, SceneNode.EntityData, SceneNode.Update(Scene.UpdateContext), SceneNode.Render(Scene.RenderContext), SceneNode.GetSupportedRenderModes(), SceneNode.SetRenderMode(string), SceneNode.Delete(), SceneNode.GetCameraDistance(Camera)
Fields
CapsuleTriangles
Number of triangles in a full capsule (two hemispheres plus the connecting cylinder band).
public const int CapsuleTriangles = 160Field Value
HemisphereTriangles
Number of triangles in one hemisphere.
public const int HemisphereTriangles = 72Field Value
HemisphereVerts
Number of vertices in one hemisphere (used for sphere and capsule allocation).
public const int HemisphereVerts = 41Field Value
Properties
CubemapResource
Lazily loaded env_cubemap sphere model used for light probe and env map debug visualization.
public static Lazy<Resource> CubemapResource { get; }Property Value
IsTranslucent
Gets whether this shape renders with transparency.
public virtual bool IsTranslucent { get; }Property Value
IsTranslucentRenderMode
Gets or sets whether the current render mode allows translucent rendering.
public bool IsTranslucentRenderMode { get; set; }Property Value
Shaded
Gets whether this shape uses normal-based shading.
protected virtual bool Shaded { get; }Property Value
ToolTexture
Gets or sets an optional tool texture overlay rendered on top of the shape.
protected RenderTexture? ToolTexture { get; set; }Property Value
indexCount
Gets the number of indices uploaded to the GPU index buffer.
protected int indexCount { get; }Property Value
shader
Gets the shader used to render this shape.
protected Shader shader { get; init; }Property Value
vaoHandle
Gets the OpenGL vertex array object handle.
protected int vaoHandle { get; }Property Value
Methods
AddBox(List<SimpleVertexNormal>, List<int>, Vector3, Vector3, Color32)
Appends solid box geometry to the given vertex and index lists.
protected static void AddBox(List<SimpleVertexNormal> verts, List<int> inds, Vector3 minBounds, Vector3 maxBounds, Color32 color)Parameters
verts List<SimpleVertexNormal>
minBounds Vector3
maxBounds Vector3
color Color32
AddBox(List<SimpleVertex>, in AABB, Color32)
Appends the 12 wireframe edges of an AABB as line segments to the given vertex list.
public static void AddBox(List<SimpleVertex> vertices, in AABB box, Color32 color)Parameters
vertices List<SimpleVertex>
box AABB
color Color32
AddCapsule(List<SimpleVertexNormal>, List<int>, Vector3, Vector3, float, Color32)
Appends capsule geometry (two hemispheres and a cylinder band) to the given vertex and index lists.
protected static void AddCapsule(List<SimpleVertexNormal> verts, List<int> inds, Vector3 c0, Vector3 c1, float radius, Color32 color)Parameters
verts List<SimpleVertexNormal>
c0 Vector3
c1 Vector3
radius float
color Color32
AddFace(List<int>, int, int, int, int)
Appends two triangles forming a quad face from four vertex indices.
protected static void AddFace(List<int> inds, int a, int b, int c, int d)Parameters
a int
b int
c int
d int
AddHemisphere(List<SimpleVertexNormal>, List<int>, Vector3, float, Vector3, Color32)
Appends hemisphere geometry oriented along up to the given vertex and index lists.
protected static void AddHemisphere(List<SimpleVertexNormal> verts, List<int> inds, Vector3 center, float radius, Vector3 up, Color32 color)Parameters
verts List<SimpleVertexNormal>
center Vector3
radius float
up Vector3
color Color32
AddLine(List<SimpleVertex>, Vector3, Vector3, Color32)
Appends a line segment as two colored vertices to the given list.
public static void AddLine(List<SimpleVertex> vertices, Vector3 from, Vector3 to, Color32 color)Parameters
vertices List<SimpleVertex>
from Vector3
to Vector3
color Color32
AddSphere(List<SimpleVertexNormal>, List<int>, Vector3, float, Color32)
Appends full sphere geometry (two hemispheres) to the given vertex and index lists.
protected static void AddSphere(List<SimpleVertexNormal> verts, List<int> inds, Vector3 center, float radius, Color32 color)Parameters
verts List<SimpleVertexNormal>
center Vector3
radius float
color Color32
AddTriangle(List<int>, int, int, int, int)
Appends a single triangle (three absolute indices offset by baseVertex) to the index list.
protected static void AddTriangle(List<int> inds, int baseVertex, int a, int b, int c)Parameters
baseVertex int
a int
b int
c int
CreateEnvCubemapSphere(Scene)
Creates a using the embedded env_cubemap sphere model.
public static ModelSceneNode CreateEnvCubemapSphere(Scene scene)Parameters
scene Scene
Returns
GetOrthogonal(Vector3)
Returns a unit vector perpendicular to a.
protected static Vector3 GetOrthogonal(Vector3 a)Parameters
a Vector3
Returns
GetOrthogonal(Vector3, Vector3)
Returns a unit vector perpendicular to both a and b.
protected static Vector3 GetOrthogonal(Vector3 a, Vector3 b)Parameters
a Vector3
b Vector3
Returns
GetSupportedRenderModes()
Returns the render modes supported by this node.
public override IEnumerable<string> GetSupportedRenderModes()Returns
Render(RenderContext)
Called each frame to render this node.
public override void Render(Scene.RenderContext context)Parameters
context Scene.RenderContext
The current render context.
SetRenderMode(string)
Sets the active render mode for this node.
public override void SetRenderMode(string mode)Parameters
mode string
The render mode name to activate.

