Files
GhostEngine/doc/_site/api/Ghost.Entities.ChunkView.html
Misaki d8a7b07624 feat(graphics): improve rendering pipeline and docs
- Refactor D3D12 backend and RenderGraph module
- Update graphics RHI and core rendering components
- Add Random.hlsl shader include
- Regenerate API documentation and update user guides
2026-03-27 22:23:44 +09:00

634 lines
21 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Struct ChunkView | GhostEngine </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Struct ChunkView | GhostEngine ">
<meta name="description" content="Provides a read-only view over a chunk of entities and their component data within an archetype.">
<link rel="icon" href="../favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="GhostEngine">
GhostEngine
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="Ghost.Entities.ChunkView">
<h1 id="Ghost_Entities_ChunkView" data-uid="Ghost.Entities.ChunkView" class="text-break">
Struct ChunkView
</h1>
<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="Ghost.html">Ghost</a>.<a class="xref" href="Ghost.Entities.html">Entities</a></dd></dl>
<dl><dt>Assembly</dt><dd>Ghost.Entities.dll</dd></dl>
</div>
<div class="markdown summary"><p>Provides a read-only view over a chunk of entities and their component data within an archetype.</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public readonly ref struct ChunkView</code></pre>
</div>
<dl class="typelist inheritedMembers">
<dt>Inherited Members</dt>
<dd>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.equals">ValueType.Equals(object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode">ValueType.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.tostring">ValueType.ToString()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
</div>
</dd></dl>
<h2 id="Ghost_Entities_ChunkView_remarks">Remarks</h2>
<div class="markdown level0 remarks"><p>This does not filter disabled/enabled components. You must handle that manually.</p>
</div>
<h2 class="section" id="properties">Properties
</h2>
<a id="Ghost_Entities_ChunkView_EntityCount_" data-uid="Ghost.Entities.ChunkView.EntityCount*"></a>
<h3 id="Ghost_Entities_ChunkView_EntityCount" data-uid="Ghost.Entities.ChunkView.EntityCount">
EntityCount
</h3>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public int EntityCount { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="methods">Methods
</h2>
<a id="Ghost_Entities_ChunkView_GetComponentDataRW_" data-uid="Ghost.Entities.ChunkView.GetComponentDataRW*"></a>
<h3 id="Ghost_Entities_ChunkView_GetComponentDataRW__1" data-uid="Ghost.Entities.ChunkView.GetComponentDataRW``1">
GetComponentDataRW&lt;T&gt;()
</h3>
<div class="markdown level1 summary"><p>Gets a span providing direct access to the component data of space T0 for structuralAll entities in the chunk.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Span&lt;T&gt; GetComponentDataRW&lt;T&gt;() where T : unmanaged, IComponent</code></pre>
</div>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.span-1">Span</a>&lt;T&gt;</dt>
<dd><p>A span of space &lt;T&gt; containing the component data for each entity in the chunk.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>The space of component to access. Must be an unmanaged space that implements Component.</p>
</dd>
</dl>
<h4 class="section">Exceptions</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></dt>
<dd><p>Thrown if the specified component space is not present in the archetype.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_GetComponentData_" data-uid="Ghost.Entities.ChunkView.GetComponentData*"></a>
<h3 id="Ghost_Entities_ChunkView_GetComponentData__1" data-uid="Ghost.Entities.ChunkView.GetComponentData``1">
GetComponentData&lt;T&gt;()
</h3>
<div class="markdown level1 summary"><p>Gets a readonly span providing direct access to the component data of space T0 for structuralAll entities in the chunk.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public ReadOnlySpan&lt;T&gt; GetComponentData&lt;T&gt;() where T : unmanaged, IComponent</code></pre>
</div>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.readonlyspan-1">ReadOnlySpan</a>&lt;T&gt;</dt>
<dd><p>A readonly span of space &lt;T&gt; containing the component data for each entity in the chunk.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>The space of component to access. Must be an unmanaged space that implements Component.</p>
</dd>
</dl>
<h4 class="section">Exceptions</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></dt>
<dd><p>Thrown if the specified component space is not present in the archetype.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_GetComponentVersion_" data-uid="Ghost.Entities.ChunkView.GetComponentVersion*"></a>
<h3 id="Ghost_Entities_ChunkView_GetComponentVersion_Ghost_Core_Identifier_Ghost_Entities_IComponent__" data-uid="Ghost.Entities.ChunkView.GetComponentVersion(Ghost.Core.Identifier{Ghost.Entities.IComponent})">
GetComponentVersion(Identifier&lt;IComponent&gt;)
</h3>
<div class="markdown level1 summary"><p>Gets the current version number associated with the specified component identifier.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public int GetComponentVersion(Identifier&lt;IComponent&gt; id)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>id</code> <span class="xref">Identifier</span>&lt;<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>&gt;</dt>
<dd><p>The identifier of the component for which to retrieve the version number. Must reference a valid component.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The version number of the specified component.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_GetComponentVersion_" data-uid="Ghost.Entities.ChunkView.GetComponentVersion*"></a>
<h3 id="Ghost_Entities_ChunkView_GetComponentVersion__1" data-uid="Ghost.Entities.ChunkView.GetComponentVersion``1">
GetComponentVersion&lt;T&gt;()
</h3>
<div class="markdown level1 summary"><p>Gets the current version number associated with the specified component space.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public int GetComponentVersion&lt;T&gt;() where T : unmanaged, IComponent</code></pre>
</div>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The version number of the component space <code class="typeparamref">T</code>.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>The component space for which to retrieve the version. Must be an unmanaged space that implements <a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_GetEnableBits_" data-uid="Ghost.Entities.ChunkView.GetEnableBits*"></a>
<h3 id="Ghost_Entities_ChunkView_GetEnableBits__1" data-uid="Ghost.Entities.ChunkView.GetEnableBits``1">
GetEnableBits&lt;T&gt;()
</h3>
<div class="markdown level1 summary"><p>Gets a bit set representing the enabled state of each instance of the specified enableable component
space within the current chunk.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public SpanBitSet GetEnableBits&lt;T&gt;() where T : unmanaged, IEnableableComponent</code></pre>
</div>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><span class="xref">SpanBitSet</span></dt>
<dd><p>A <span class="xref">Misaki.HighPerformance.LowLevel.Collections.SpanBitSet</span> that provides access to the enablement bits for all instances of the specified component space in the chunk.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>The component space for which to retrieve enablement bits. Must be unmanaged and implement <a class="xref" href="Ghost.Entities.IEnableableComponent.html">IEnableableComponent</a>.</p>
</dd>
</dl>
<h4 class="section">Exceptions</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></dt>
<dd><p>Thrown if the specified component space does not support enablement.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_GetEntities_" data-uid="Ghost.Entities.ChunkView.GetEntities*"></a>
<h3 id="Ghost_Entities_ChunkView_GetEntities" data-uid="Ghost.Entities.ChunkView.GetEntities">
GetEntities()
</h3>
<div class="markdown level1 summary"><p>Returns a read-only span containing structuralAll entities stored in the current chunk.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public ReadOnlySpan&lt;Entity&gt; GetEntities()</code></pre>
</div>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.readonlyspan-1">ReadOnlySpan</a>&lt;<a class="xref" href="Ghost.Entities.Entity.html">Entity</a>&gt;</dt>
<dd><p>A read-only span of <a class="xref" href="Ghost.Entities.Entity.html">Entity</a> values representing the entities in the chunk.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_HasChanged_" data-uid="Ghost.Entities.ChunkView.HasChanged*"></a>
<h3 id="Ghost_Entities_ChunkView_HasChanged_Ghost_Core_Identifier_Ghost_Entities_IComponent__System_Int32_" data-uid="Ghost.Entities.ChunkView.HasChanged(Ghost.Core.Identifier{Ghost.Entities.IComponent},System.Int32)">
HasChanged(Identifier&lt;IComponent&gt;, int)
</h3>
<div class="markdown level1 summary"><p>Determines whether the specified component has changed since the given version.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool HasChanged(Identifier&lt;IComponent&gt; id, int version)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>id</code> <span class="xref">Identifier</span>&lt;<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>&gt;</dt>
<dd><p>The identifier of the component to check for changes.</p>
</dd>
<dt><code>version</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The version number to compare against the component's current version. Must be greater than or equal to zero.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>true if the component's current version is less than or equal to the specified version; otherwise, false.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_HasChanged_" data-uid="Ghost.Entities.ChunkView.HasChanged*"></a>
<h3 id="Ghost_Entities_ChunkView_HasChanged__1_System_Int32_" data-uid="Ghost.Entities.ChunkView.HasChanged``1(System.Int32)">
HasChanged&lt;T&gt;(int)
</h3>
<div class="markdown level1 summary"><p>Determines whether the specified version indicates that the component of space <code class="typeparamref">T</code> has
changed since the last recorded version.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool HasChanged&lt;T&gt;(int version) where T : unmanaged, IComponent</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>version</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The version number to compare against the current version of the component.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>true if the component of space T has changed since the specified version; otherwise, false.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>The space of component to check for changes. Must be an unmanaged space that implements <a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_HasStructuralChanged_" data-uid="Ghost.Entities.ChunkView.HasStructuralChanged*"></a>
<h3 id="Ghost_Entities_ChunkView_HasStructuralChanged_System_Int32_" data-uid="Ghost.Entities.ChunkView.HasStructuralChanged(System.Int32)">
HasStructuralChanged(int)
</h3>
<div class="markdown level1 summary"><p>Determines whether the chunk's structure has changed since the specified version.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool HasStructuralChanged(int version)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>version</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The version number to compare against the chunk's structural version.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>true if the chunk's structure has changed since the specified version; otherwise, false.</p>
</dd>
</dl>
<a id="Ghost_Entities_ChunkView_IsComponentEnabled_" data-uid="Ghost.Entities.ChunkView.IsComponentEnabled*"></a>
<h3 id="Ghost_Entities_ChunkView_IsComponentEnabled__1_System_Int32_" data-uid="Ghost.Entities.ChunkView.IsComponentEnabled``1(System.Int32)">
IsComponentEnabled&lt;T&gt;(int)
</h3>
<div class="markdown level1 summary"><p>Determines whether the specified component of space <code class="typeparamref">T</code> at the given index is currently enabled.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool IsComponentEnabled&lt;T&gt;(int index) where T : unmanaged, IEnableableComponent</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>index</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The zero-based index of the component instance to check within the chunk.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>true if the component at the specified index is enabled; otherwise, false.</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>The space of the component to check. Must be an unmanaged space that implements <a class="xref" href="Ghost.Entities.IEnableableComponent.html">IEnableableComponent</a>.</p>
</dd>
</dl>
<h4 class="section">Exceptions</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></dt>
<dd><p>Thrown if the specified component space <code class="typeparamref">T</code> does not support enable/disable functionality.</p>
</dd>
</dl>
</article>
<div class="contribution d-print-none">
</div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
</div>
</div>
</footer>
</body>
</html>