refactor(render): move look-in dynamics onto walk turns
This commit is contained in:
parent
966836895f
commit
f9a80fbc44
9 changed files with 190 additions and 113 deletions
|
|
@ -97,6 +97,33 @@ internal sealed class WalkStaticStreamPopulator
|
|||
stream, WalkDrawStage.OutdoorStatic, cellId, records,
|
||||
tupleLandblockId, cameraWorldPosition, viewProjection);
|
||||
|
||||
internal void PopulateCellDynamics(
|
||||
OrderedDrawStream stream,
|
||||
uint cellId,
|
||||
ReadOnlySpan<RenderProjectionRecord> records,
|
||||
uint tupleLandblockId,
|
||||
Vector3 cameraWorldPosition,
|
||||
Matrix4x4 viewProjection,
|
||||
IWalkLookInViewSource? lookInViews = null,
|
||||
int lookInRouteIndex = -1)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(stream);
|
||||
for (int i = 0; i < records.Length; i++)
|
||||
{
|
||||
ClassifyAndAppend(
|
||||
stream,
|
||||
WalkDrawStage.Dynamic,
|
||||
cellId,
|
||||
in records[i],
|
||||
tupleLandblockId,
|
||||
cameraWorldPosition,
|
||||
viewProjection,
|
||||
liveDynamic: true,
|
||||
lookInViews,
|
||||
lookInRouteIndex);
|
||||
}
|
||||
}
|
||||
|
||||
private void ClassifyAndAppend(
|
||||
OrderedDrawStream stream,
|
||||
WalkDrawStage stage,
|
||||
|
|
@ -104,12 +131,22 @@ internal sealed class WalkStaticStreamPopulator
|
|||
in RenderProjectionRecord record,
|
||||
uint tupleLandblockId,
|
||||
Vector3 cameraWorldPosition,
|
||||
Matrix4x4 viewProjection)
|
||||
Matrix4x4 viewProjection,
|
||||
bool liveDynamic = false,
|
||||
IWalkLookInViewSource? lookInViews = null,
|
||||
int lookInRouteIndex = -1)
|
||||
{
|
||||
_batchScratch.Clear();
|
||||
_selectionScratch.Clear();
|
||||
_dispatcher.ClassifyEntityForWalk(
|
||||
in record, tupleLandblockId, _batchScratch, _selectionScratch);
|
||||
in record,
|
||||
tupleLandblockId,
|
||||
_batchScratch,
|
||||
_selectionScratch,
|
||||
liveDynamic,
|
||||
lookInViews,
|
||||
lookInRouteIndex,
|
||||
cellId);
|
||||
|
||||
for (int i = 0; i < _batchScratch.Count; i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue