-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.GLTF.Classes
Represents a single merged draw unit: the geometry of many GLTFNode instances sharing the same alpha mode, packed into contiguous vertex and index buffers.
Per-object styling is baked into the vertex colors and per-object identity is encoded in the object id vertex attribute, so the whole batch renders as one WebGL draw call while individual objects remain selectable.
public class GLTFBatchInheritance System.Object → GLTFBatch
Initializes a new instance of the GLTFBatch class.
public GLTFBatch(bool blended, float[] positions, byte[] colors, float[] objectIds, int[] indexes, float[] min, float[] max);blended System.Boolean
A value indicating whether the batch requires alpha blending (any contained object is semi-transparent).
positions System.Single[]
The packed vertex positions (3 floats per vertex).
colors System.Byte[]
The packed vertex colors (4 bytes RGBA per vertex, normalized).
objectIds System.Single[]
The packed per-vertex object identifiers (1 float per vertex) indexing the batch entry list.
indexes System.Int32[]
The packed triangle indices (3 ints per triangle).
min System.Single[]
The component-wise minimum of the positions (3 floats).
max System.Single[]
The component-wise maximum of the positions (3 floats).
Gets a value indicating whether the batch requires alpha blending.
public bool Blended { get; }Gets the packed vertex colors (4 bytes RGBA per vertex, normalized).
public byte[] Colors { get; }Gets the packed triangle indices (3 ints per triangle).
public int[] Indexes { get; }Gets the component-wise maximum of the positions (3 floats).
public float[] Max { get; }Gets the component-wise minimum of the positions (3 floats).
public float[] Min { get; }Gets the packed per-vertex object identifiers (1 float per vertex) indexing the batch entry list.
public float[] ObjectIds { get; }Gets the packed vertex positions (3 floats per vertex).
public float[] Positions { get; }Represents the identity of a single object inside a GLTFBatch: its reference, its serialized properties and its contiguous vertex and index ranges within the merged buffers.
The index of the entry in the entry list is the object id encoded in the batch vertex attribute, allowing viewers to map a picked vertex back to the original object.
public class GLTFBatchEntryInheritance System.Object → GLTFBatchEntry
Initializes a new instance of the GLTFBatchEntry class.
public GLTFBatchEntry(string? reference, string? name, string? properties, int batchIndex, int vertexStart, int vertexCount, int indexStart, int indexCount);reference System.String
The unique reference identifying the source object.
name System.String
The display name of the source object.
properties System.String
The JSON string with the properties of the source object. This value can be null.
batchIndex System.Int32
The index of the GLTFBatch containing the object geometry.
vertexStart System.Int32
The first vertex of the object within the merged vertex buffers.
vertexCount System.Int32
The number of vertices of the object.
indexStart System.Int32
The first index of the object within the merged index buffer.
indexCount System.Int32
The number of indices of the object.
Gets the index of the GLTFBatch containing the object geometry.
public int BatchIndex { get; }Gets the number of indices of the object.
public int IndexCount { get; }Gets the first index of the object within the merged index buffer.
public int IndexStart { get; }Gets the display name of the source object.
public string? Name { get; }Gets the JSON string with the properties of the source object.
public string? Properties { get; }Gets the unique reference identifying the source object.
public string? Reference { get; }Gets the number of vertices of the object.
public int VertexCount { get; }Gets the first vertex of the object within the merged vertex buffers.
public int VertexStart { get; }Represents a camera within a GLTFScene, defined by its position, target, field of view and automatic framing behavior.
public class GLTFCamera : DiGi.Core.Classes.SerializableObject, DiGi.GLTF.Interfaces.IGLTFSerializableObject, DiGi.GLTF.Interfaces.IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → GLTFCamera
Implements IGLTFSerializableObject, IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject
Initializes a new instance of the GLTFCamera class by copying an existing GLTFCamera instance.
public GLTFCamera(DiGi.GLTF.Classes.GLTFCamera? gLTFCamera);gLTFCamera GLTFCamera
The GLTFCamera instance to copy from. This value can be null.
Initializes a new instance of the GLTFCamera class.
public GLTFCamera(string? name, DiGi.Geometry.Spatial.Classes.Point3D? position, DiGi.Geometry.Spatial.Classes.Point3D? target, double fieldOfView, bool autoFrame);name System.String
The display name of the camera.
position DiGi.Geometry.Spatial.Classes.Point3D
The DiGi.Geometry.Spatial.Classes.Point3D position of the camera. This value can be null when autoFrame is true.
target DiGi.Geometry.Spatial.Classes.Point3D
The DiGi.Geometry.Spatial.Classes.Point3D the camera looks at. This value can be null when autoFrame is true.
fieldOfView System.Double
The vertical field of view in degrees.
autoFrame System.Boolean
A value indicating whether the camera automatically frames the whole scene bounding box on load.
Initializes a new instance of the GLTFCamera class using the specified System.Text.Json.Nodes.JsonObject.
public GLTFCamera(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject containing the data to initialize the camera. This value can be null.
Gets a value indicating whether the camera automatically frames the whole scene bounding box on load.
public bool AutoFrame { get; }Gets the vertical field of view in degrees.
public double FieldOfView { get; }Gets the display name of the camera.
public string? Name { get; }Gets the DiGi.Geometry.Spatial.Classes.Point3D position of the camera.
public DiGi.Geometry.Spatial.Classes.Point3D? Position { get; }DiGi.Geometry.Spatial.Classes.Point3D
Gets the DiGi.Geometry.Spatial.Classes.Point3D the camera looks at.
public DiGi.Geometry.Spatial.Classes.Point3D? Target { get; }DiGi.Geometry.Spatial.Classes.Point3D
Represents a light source within a GLTFScene, defined by its type, color, intensity, direction and position.
public class GLTFLight : DiGi.Core.Classes.SerializableObject, DiGi.GLTF.Interfaces.IGLTFSerializableObject, DiGi.GLTF.Interfaces.IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → GLTFLight
Implements IGLTFSerializableObject, IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject
Initializes a new instance of the GLTFLight class by copying an existing GLTFLight instance.
public GLTFLight(DiGi.GLTF.Classes.GLTFLight? gLTFLight);gLTFLight GLTFLight
The GLTFLight instance to copy from. This value can be null.
Initializes a new instance of the GLTFLight class.
public GLTFLight(string? name, DiGi.GLTF.Enums.LightType lightType, DiGi.Core.Classes.Color? color, double intensity, DiGi.Geometry.Spatial.Classes.Vector3D? direction, DiGi.Geometry.Spatial.Classes.Point3D? position);name System.String
The display name of the light.
lightType LightType
The LightType of the light.
color DiGi.Core.Classes.Color
The Color of the emitted light. This value can be null.
intensity System.Double
The intensity of the light where 1 is the default full intensity.
direction DiGi.Geometry.Spatial.Classes.Vector3D
The DiGi.Geometry.Spatial.Classes.Vector3D direction of the light rays for directional lights. This value can be null.
position DiGi.Geometry.Spatial.Classes.Point3D
The DiGi.Geometry.Spatial.Classes.Point3D position of the light for point lights. This value can be null.
Initializes a new instance of the GLTFLight class using the specified System.Text.Json.Nodes.JsonObject.
public GLTFLight(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject containing the data to initialize the light. This value can be null.
Gets the Color of the emitted light.
public DiGi.Core.Classes.Color? Color { get; }Gets the DiGi.Geometry.Spatial.Classes.Vector3D direction of the light rays for directional lights.
public DiGi.Geometry.Spatial.Classes.Vector3D? Direction { get; }DiGi.Geometry.Spatial.Classes.Vector3D
Gets the intensity of the light where 1 is the default full intensity.
public double Intensity { get; }Gets the LightType of the light.
public DiGi.GLTF.Enums.LightType LightType { get; }Gets the display name of the light.
public string? Name { get; }Gets the DiGi.Geometry.Spatial.Classes.Point3D position of the light for point lights.
public DiGi.Geometry.Spatial.Classes.Point3D? Position { get; }DiGi.Geometry.Spatial.Classes.Point3D
Represents a model holding multiple GLTFScene instances together with general model properties.
public class GLTFModel : DiGi.Core.Classes.SerializableObject, DiGi.GLTF.Interfaces.IGLTFSerializableObject, DiGi.GLTF.Interfaces.IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → GLTFModel
Implements IGLTFSerializableObject, IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject
Initializes a new instance of the GLTFModel class by copying an existing GLTFModel instance.
public GLTFModel(DiGi.GLTF.Classes.GLTFModel? gLTFModel);gLTFModel GLTFModel
The GLTFModel instance to copy from. This value can be null.
Initializes a new instance of the GLTFModel class.
public GLTFModel(string? name, string? description, System.Collections.Generic.IEnumerable<DiGi.GLTF.Classes.GLTFScene>? scenes);name System.String
The display name of the model.
description System.String
The description of the model.
scenes System.Collections.Generic.IEnumerable<GLTFScene>
The GLTFScene instances contained in the model. This value can be null.
Initializes a new instance of the GLTFModel class using the specified System.Text.Json.Nodes.JsonObject.
public GLTFModel(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject containing the data to initialize the model. This value can be null.
Gets the description of the model.
public string? Description { get; }Gets the display name of the model.
public string? Name { get; }Gets the GLTFScene instances contained in the model.
public System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFScene>? Scenes { get; }System.Collections.Generic.List<GLTFScene>
Represents a single displayable and selectable object within a GLTFScene, holding triangulated geometry, styling and the serialized properties of the source object.
public class GLTFNode : DiGi.Core.Classes.SerializableObject, DiGi.GLTF.Interfaces.IGLTFSerializableObject, DiGi.GLTF.Interfaces.IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → GLTFNode
Implements IGLTFSerializableObject, IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject
Initializes a new instance of the GLTFNode class adopting the given instances without cloning.
Performance path for large scene generation: the caller transfers ownership of mesh3D and color and must not mutate them afterwards.
internal GLTFNode(bool adopt, string? name, string? reference, DiGi.Geometry.Spatial.Classes.Mesh3D? mesh3D, DiGi.Core.Classes.Color? color, double opacity, string? properties);adopt System.Boolean
Signature discriminator; always pass true.
name System.String
The display name of the node.
reference System.String
The unique reference identifying the source object of the node.
mesh3D DiGi.Geometry.Spatial.Classes.Mesh3D
The triangulated DiGi.Geometry.Spatial.Classes.Mesh3D geometry adopted by the node. This value can be null.
color DiGi.Core.Classes.Color
The DiGi.Core.Classes.Color adopted by the node. This value can be null.
opacity System.Double
The opacity of the node where 1 is fully opaque and 0 is fully transparent.
properties System.String
The JSON string with the properties of the source object. This value can be null.
Initializes a new instance of the GLTFNode class by copying an existing GLTFNode instance.
public GLTFNode(DiGi.GLTF.Classes.GLTFNode? gLTFNode);gLTFNode GLTFNode
The GLTFNode instance to copy from. This value can be null.
Initializes a new instance of the GLTFNode class.
public GLTFNode(string? name, string? reference, DiGi.Geometry.Spatial.Classes.Mesh3D? mesh3D, DiGi.Core.Classes.Color? color, double opacity, string? properties);name System.String
The display name of the node.
reference System.String
The unique reference identifying the source object of the node.
mesh3D DiGi.Geometry.Spatial.Classes.Mesh3D
The triangulated Mesh3D geometry of the node. This value can be null.
color DiGi.Core.Classes.Color
The Color used to render the node. This value can be null.
opacity System.Double
The opacity of the node where 1 is fully opaque and 0 is fully transparent.
properties System.String
The JSON string with the properties of the source object displayed in the properties panel. This value can be null.
Initializes a new instance of the GLTFNode class using the specified System.Text.Json.Nodes.JsonObject.
public GLTFNode(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject containing the data to initialize the node. This value can be null.
Gets the Color used to render the node.
public DiGi.Core.Classes.Color? Color { get; }Gets the DiGi.Core.Classes.Color of the node without cloning.
Performance path for large scene generation: the returned instance must not be mutated.
internal DiGi.Core.Classes.Color? Color_Direct { internal get; }Gets the triangulated Mesh3D geometry of the node.
public DiGi.Geometry.Spatial.Classes.Mesh3D? Mesh3D { get; }DiGi.Geometry.Spatial.Classes.Mesh3D
Gets the triangulated DiGi.Geometry.Spatial.Classes.Mesh3D geometry of the node without cloning.
Performance path for large scene generation: the returned instance must not be mutated.
internal DiGi.Geometry.Spatial.Classes.Mesh3D? Mesh3D_Direct { internal get; }DiGi.Geometry.Spatial.Classes.Mesh3D
Gets the display name of the node.
public string? Name { get; }Gets the opacity of the node where 1 is fully opaque and 0 is fully transparent.
public double Opacity { get; }Gets the JSON string with the properties of the source object displayed in the properties panel.
public string? Properties { get; }Gets the unique reference identifying the source object of the node.
public string? Reference { get; }Convenience base class for IGLTFNodeConverter implementations handling a single domain type.
Derive from this class in the consuming project, implement Convert(TSerializableObject, double) and register the converter (see Register(IGLTFNodeConverter)).
public abstract class GLTFNodeConverter<TSerializableObject> : DiGi.GLTF.Interfaces.IGLTFNodeConverter, DiGi.GLTF.Interfaces.IGLTFObject, DiGi.Core.Interfaces.IObject
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObjectTSerializableObject
The domain type handled by the converter.
Inheritance System.Object → GLTFNodeConverter<TSerializableObject>
Implements IGLTFNodeConverter, IGLTFObject, DiGi.Core.Interfaces.IObject
Determines whether this converter can convert the specified object.
public bool CanConvert(DiGi.Core.Interfaces.ISerializableObject serializableObject);serializableObject DiGi.Core.Interfaces.ISerializableObject
The domain object to be checked.
Implements CanConvert(ISerializableObject)
System.Boolean
True if the object is a TSerializableObject; otherwise, false.
Converts the specified object into GLTFNode instances holding geometry in world coordinates.
public System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFNode>? Convert(DiGi.Core.Interfaces.ISerializableObject serializableObject, double tolerance);serializableObject DiGi.Core.Interfaces.ISerializableObject
The domain object to be converted.
tolerance System.Double
The distance tolerance used during triangulation.
Implements Convert(ISerializableObject, double)
System.Collections.Generic.List<GLTFNode>
A list of GLTFNode instances, or null if the object cannot be converted.
Converts the specified TSerializableObject into GLTFNode instances holding geometry in world coordinates.
public abstract System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFNode>? Convert(TSerializableObject serializableObject, double tolerance);serializableObject TSerializableObject
The domain object to be converted.
tolerance System.Double
The distance tolerance used during triangulation.
System.Collections.Generic.List<GLTFNode>
A list of GLTFNode instances, or null if the object cannot be converted.
Represents a renderable scene holding GLTFNode objects, light configuration and camera position.
All node geometry is expressed in local coordinates around the origin (0, 0, 0). The original world offset removed from the geometry is stored in ReferencePoint to avoid floating-point precision issues in WebGL rendering of GIS coordinates.
public class GLTFScene : DiGi.Core.Classes.SerializableObject, DiGi.GLTF.Interfaces.IGLTFSerializableObject, DiGi.GLTF.Interfaces.IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → GLTFScene
Implements IGLTFSerializableObject, IGLTFObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject
Initializes a new instance of the GLTFScene class adopting the given instances without cloning.
Performance path for large scene generation: the caller transfers ownership of all provided instances and must not mutate them afterwards.
internal GLTFScene(bool adopt, string? name, DiGi.Geometry.Spatial.Classes.Point3D? referencePoint, System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFNode>? nodes, System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFLight>? lights, DiGi.GLTF.Classes.GLTFCamera? camera);adopt System.Boolean
Signature discriminator; always pass true.
name System.String
The display name of the scene.
referencePoint DiGi.Geometry.Spatial.Classes.Point3D
The DiGi.Geometry.Spatial.Classes.Point3D world offset adopted by the scene. This value can be null.
nodes System.Collections.Generic.List<GLTFNode>
The GLTFNode list adopted by the scene. This value can be null.
lights System.Collections.Generic.List<GLTFLight>
The GLTFLight list adopted by the scene. This value can be null.
camera GLTFCamera
The GLTFCamera adopted by the scene. This value can be null.
Initializes a new instance of the GLTFScene class by copying an existing GLTFScene instance.
public GLTFScene(DiGi.GLTF.Classes.GLTFScene? gLTFScene);gLTFScene GLTFScene
The GLTFScene instance to copy from. This value can be null.
Initializes a new instance of the GLTFScene class.
public GLTFScene(string? name, DiGi.Geometry.Spatial.Classes.Point3D? referencePoint, System.Collections.Generic.IEnumerable<DiGi.GLTF.Classes.GLTFNode>? nodes, System.Collections.Generic.IEnumerable<DiGi.GLTF.Classes.GLTFLight>? lights, DiGi.GLTF.Classes.GLTFCamera? camera);name System.String
The display name of the scene.
referencePoint DiGi.Geometry.Spatial.Classes.Point3D
The DiGi.Geometry.Spatial.Classes.Point3D world offset removed from the node geometry during conversion to local coordinates. This value can be null.
nodes System.Collections.Generic.IEnumerable<GLTFNode>
The GLTFNode objects to be displayed. This value can be null.
lights System.Collections.Generic.IEnumerable<GLTFLight>
The GLTFLight configuration of the scene. This value can be null.
camera GLTFCamera
The GLTFCamera of the scene. This value can be null.
Initializes a new instance of the GLTFScene class using the specified System.Text.Json.Nodes.JsonObject.
public GLTFScene(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject containing the data to initialize the scene. This value can be null.
Gets the GLTFCamera of the scene.
public DiGi.GLTF.Classes.GLTFCamera? Camera { get; }Gets the GLTFLight configuration of the scene.
public System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFLight>? Lights { get; }System.Collections.Generic.List<GLTFLight>
Gets the display name of the scene.
public string? Name { get; }Gets the GLTFNode objects to be displayed.
public System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFNode>? Nodes { get; }System.Collections.Generic.List<GLTFNode>
Gets the GLTFNode list of the scene without cloning.
Performance path for large scene generation: the returned list and its items must not be mutated.
internal System.Collections.Generic.List<DiGi.GLTF.Classes.GLTFNode>? Nodes_Direct { internal get; }System.Collections.Generic.List<GLTFNode>
Gets the DiGi.Geometry.Spatial.Classes.Point3D world offset removed from the node geometry during conversion to local coordinates.
public DiGi.Geometry.Spatial.Classes.Point3D? ReferencePoint { get; }