refactor(content): share EnvCell geometry identity
This commit is contained in:
parent
05a22dee99
commit
86fadf8661
3 changed files with 73 additions and 8 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System.Collections.Immutable;
|
||||
using System.Numerics;
|
||||
using AcDream.Core.Rendering.Wb;
|
||||
using DatReaderWriter.DBObjs;
|
||||
using DatReaderWriter.Enums;
|
||||
using DatReaderWriter.Types;
|
||||
|
|
@ -125,14 +126,7 @@ public sealed class EnvCellLandblockBuildBuilder
|
|||
uint environmentId,
|
||||
ushort cellStructure,
|
||||
IReadOnlyList<ushort> surfaces)
|
||||
{
|
||||
var hash = 17L;
|
||||
hash = hash * 31 + (int)environmentId;
|
||||
hash = hash * 31 + cellStructure;
|
||||
foreach (var surface in surfaces)
|
||||
hash = hash * 31 + surface;
|
||||
return (ulong)hash | 0x2_0000_0000UL;
|
||||
}
|
||||
=> EnvCellGeometryIdentity.Compute(environmentId, cellStructure, surfaces);
|
||||
|
||||
private static WbBoundingBox ComputeLocalBounds(CellStruct cellStruct)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue