mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-29 06:28:25 +01:00
SOURCE DUMP v1
This commit is contained in:
parent
bd62d51ec9
commit
fb20299e9d
1 changed files with 768360 additions and 0 deletions
25
brutal.gltf/Brutal.Gltf/GltfApi/Node.cs
Normal file
25
brutal.gltf/Brutal.Gltf/GltfApi/Node.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System.Text.Json;
|
||||
|
||||
namespace Brutal.GltfApi;
|
||||
|
||||
public partial class Node : IExtensionGltfObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a light index if the node is associated with a light source.
|
||||
/// This is used when the "KHR_lights_punctual" extension is present.
|
||||
/// If the extension is not present or the light index is not defined, returns null.
|
||||
/// </summary>
|
||||
public int? LightIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Extensions == null || !Extensions.TryGetValue("KHR_lights_punctual", out var ext))
|
||||
return null;
|
||||
if (ext is JsonElement extElement && extElement.TryGetProperty("light"u8, out var lightIndex))
|
||||
{
|
||||
return lightIndex.GetInt32();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue