mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-26 00:43:00 +08:00
Fixed LODs culling issue
This commit is contained in:
parent
968a611aa9
commit
2b02ad0091
@ -1475,11 +1475,10 @@ namespace CodeWalker.GameFiles
|
||||
BSRadius = Archetype.BSRadius * Math.Max(Scale.X, Scale.Z);
|
||||
if (Orientation == Quaternion.Identity)
|
||||
{
|
||||
BBMin = (Archetype.BBMin * Scale) + Position;
|
||||
BBMax = (Archetype.BBMax * Scale) + Position;
|
||||
BBMin = (Vector3.Min(Archetype.BBMin, Archetype.BBMax) * Scale) + Position;
|
||||
BBMax = (Vector3.Max(Archetype.BBMin, Archetype.BBMax) * Scale) + Position;
|
||||
BBCenter = (BBMax + BBMin) * 0.5f;
|
||||
BBExtent = (BBMax - BBMin) * 0.5f;
|
||||
BBExtent = BBExtent.Abs();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1492,7 +1491,7 @@ namespace CodeWalker.GameFiles
|
||||
var bbcenter = (Archetype.BBMax + Archetype.BBMin) * 0.5f;
|
||||
var bbextent = (Archetype.BBMax - Archetype.BBMin) * 0.5f;
|
||||
var ncenter = Vector3.TransformCoordinate(bbcenter, mat);
|
||||
var nextent = Vector3.TransformNormal(bbextent, matabs);
|
||||
var nextent = Vector3.TransformNormal(bbextent, matabs).Abs();
|
||||
BBCenter = ncenter;
|
||||
BBExtent = nextent;
|
||||
BBMin = ncenter - nextent;
|
||||
|
@ -3651,7 +3651,7 @@ namespace CodeWalker.Rendering
|
||||
foreach (var kvp in RootEntities)
|
||||
{
|
||||
var ent = kvp.Key;
|
||||
if (EntityVisibleAtMaxLodLevel(ent) && EntityVisible(ent))
|
||||
if (EntityVisibleAtMaxLodLevel(ent))
|
||||
{
|
||||
ent.Distance = MapViewEnabled ? MapViewDist : (ent.Position - Position).Length();
|
||||
if (ent.Distance <= (ent.LodDist * LodDistMult))
|
||||
@ -3676,7 +3676,7 @@ namespace CodeWalker.Rendering
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((ent.Parent == null) || EntityVisible(ent))
|
||||
if (EntityVisible(ent))
|
||||
{
|
||||
VisibleLeaves.Add(ent);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user