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.Tint, SceneNode.Alpha, SceneNode.TintAlpha, SceneNode.Transform, SceneNode.LayerName, SceneNode.LayerEnabled, SceneNode.Visible, SceneNode.BoundingBox, SceneNode.LocalBoundingBox, SceneNode.Name, SceneNode.Id, SceneNode.IsSelected, SceneNode.IsPointMarker, SceneNode.Flags, SceneNode.AdditionalFlags, SceneNode.RenderPasses, SceneNode.UpdateBuffers(Camera), SceneNode.Scene, SceneNode.KeepsMarkerSize, SceneNode.Parent, SceneNode.Children, SceneNode.ParentAttachment, SceneNode.LocalTransform, SceneNode.SetParent(SceneNode?, string?, Matrix4x4?), SceneNode.GetChildFrame(string?), SceneNode.UpdateHierarchy(Scene.UpdateContext), SceneNode.GetRigidTransform(Matrix4x4), SceneNode.ShaderEnvMapVisibility, SceneNode.LightingOrigin, SceneNode.OverlayRenderOrder, SceneNode.CubeMapPrecomputedHandshake, SceneNode.LightProbeVolumePrecomputedHandshake, SceneNode.LightProbeBinding, SceneNode.EnvMapBinding, SceneNode.EntityData, SceneNode.EntityInstance, SceneNode.Update(Scene.UpdateContext), SceneNode.Simulation, SceneNode.Render(Scene.RenderContext), SceneNode.GetSupportedRenderModes(), SceneNode.SetRenderMode(string), SceneNode.Delete(), SceneNode.GetCameraDistance(Camera)
Fields
BoxLineVertexCount
Number of line vertices ShapeSceneNode.AddBox(List<SimpleVertex>, in AABB, Color32) appends, two per edge.
public const int BoxLineVertexCount = 24Field Value
int
CapsuleTriangles
Number of triangles in a full capsule (two hemispheres plus the connecting cylinder band).
public const int CapsuleTriangles = 160Field Value
int
HemisphereTriangles
Number of triangles in one hemisphere.
public const int HemisphereTriangles = 72Field Value
int
HemisphereVerts
Number of vertices in one hemisphere (used for sphere and capsule allocation).
public const int HemisphereVerts = 41Field Value
int
Properties
IsDoubleSided
Gets whether this shape draws its back faces when translucent.
protected virtual bool IsDoubleSided { get; }Property Value
bool
IsTranslucent
Gets whether this shape renders with transparency.
public virtual bool IsTranslucent { get; }Property Value
bool
IsTranslucentRenderMode
Gets or sets whether the current render mode allows translucent rendering.
public bool IsTranslucentRenderMode { get; set; }Property Value
bool
Shaded
Gets whether this shape uses normal-based shading.
protected virtual bool Shaded { get; }Property Value
bool
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 triangle indices at the start of the GPU index buffer.
protected int indexCount { get; }Property Value
int
shader
Gets the shader used to render this shape.
protected Shader shader { get; init; }Property Value
vao
Gets the vertex array state for this shape.
protected int vao { get; }Property Value
int
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>
inds List<int>
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>
inds List<int>
c0 Vector3
c1 Vector3
radius float
color Color32
AddCapsuleLines(List<int>, int)
Appends line index pairs along a capsule from ShapeSceneNode.AddCapsule(List<SimpleVertexNormal>, List<int>, Vector3, Vector3, float, Color32) that starts at baseVertex: both rims, and four lines along its length that go on over the caps.
protected static void AddCapsuleLines(List<int> lines, int baseVertex)Parameters
lines List<int>
baseVertex 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>
inds List<int>
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>
inds List<int>
center Vector3
radius float
color Color32
AddSphere(List<SimpleVertex>, Vector3, float, Color32)
Appends a wireframe sphere as three orthogonal circles of line segments to the given vertex list.
public static void AddSphere(List<SimpleVertex> vertices, Vector3 center, float radius, Color32 color)Parameters
vertices List<SimpleVertex>
center Vector3
radius float
color Color32
AddSphereLines(List<int>, int)
Appends line index pairs along a sphere from ShapeSceneNode.AddSphere(List<SimpleVertexNormal>, List<int>, Vector3, float, Color32) that starts at baseVertex: its equator and two circles through its poles.
protected static void AddSphereLines(List<int> lines, int baseVertex)Parameters
lines List<int>
baseVertex int
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
inds List<int>
baseVertex int
a int
b int
c int
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
IEnumerable<string>
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.

