Skip to content

SceneObject

Namespace: Hex1b.Scene.Core

Assembly: Hex1b.dll

Base class for all objects in the 3D scene graph. Supports position, rotation, scale, and parent-child hierarchy.

csharp
[Experimental("HEX1B_SCENE", UrlFormat = "https://github.com/hex1b/hex1b/blob/main/docs/experimental/scene.md")]
public class SceneObject

Inheritance

ObjectSceneObject

Constructors

SceneObject()

csharp
public SceneObject()

SceneObject(string?)

Parameters:

csharp
public SceneObject(string? name)

Properties

Children

Returns: IReadOnlyList<SceneObject>

csharp
public IReadOnlyList<SceneObject> Children { get; }

LocalMatrix

Get the local transformation matrix (position, rotation, scale).

Returns: Matrix4

csharp
public Matrix4 LocalMatrix { get; }

Name

Returns: String

csharp
public string? Name { get; set; }

Parent

Returns: SceneObject

csharp
public SceneObject? Parent { get; set; }

Position

Returns: Vector3

csharp
public Vector3 Position { get; set; }

Rotation

Returns: Quaternion

csharp
public Quaternion Rotation { get; set; }

Scale

Returns: Vector3

csharp
public Vector3 Scale { get; set; }

WorldMatrix

Get the world transformation matrix (accounting for parent transforms).

Returns: Matrix4

csharp
public Matrix4 WorldMatrix { get; }

Methods

AddChild(SceneObject)

Parameters:

csharp
public void AddChild(SceneObject child)

ComputeLocalMatrix()

Returns: Matrix4

csharp
protected virtual Matrix4 ComputeLocalMatrix()

GetForward()

Returns: Vector3

csharp
public Vector3 GetForward()

GetPositionWorldSpace()

Returns: Vector3

csharp
public Vector3 GetPositionWorldSpace()

GetRight()

Returns: Vector3

csharp
public Vector3 GetRight()

GetUp()

Returns: Vector3

csharp
public Vector3 GetUp()

InvalidateChildMatrices()

csharp
protected void InvalidateChildMatrices()

InvalidateMatrices()

csharp
protected virtual void InvalidateMatrices()

RemoveChild(SceneObject)

Parameters:

csharp
public void RemoveChild(SceneObject child)

SetPositionWorldSpace(Vector3)

Parameters:

csharp
public void SetPositionWorldSpace(Vector3 worldPosition)

Released under the MIT License.