Skip to content

Commit

Permalink
fix: remove entities dependency (#1903)
Browse files Browse the repository at this point in the history
* fix: remove entities dependency

* include manifest changes
  • Loading branch information
m3taphysics authored Aug 27, 2024
1 parent 2513be8 commit dc13600
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;

namespace DCL.Landscape.Jobs
{
public struct VisibleBounds
{
public AABB Bounds;
public Bounds Bounds;
public bool IsVisible;
public bool IsAtDistance;
public bool IsDirty;
Expand Down Expand Up @@ -41,7 +42,7 @@ public void Execute(int i)

if (isVisible)
{
float sqrDist = terrain.Bounds.DistanceSq(cameraPosition);
float sqrDist = terrain.Bounds.SqrDistance(cameraPosition);
isAtDistance = sqrDist < detailDistanceSqr;
}

Expand All @@ -54,15 +55,15 @@ public void Execute(int i)

// got this one from https://forum.unity.com/threads/managed-version-of-geometryutility-testplanesaabb.473575/
// thanks kind internet fellow :)
private bool TestPlanesAABB(AABB bounds)
private bool TestPlanesAABB(Bounds bounds)
{
for (var i = 0; i < cameraPlanes.Length; i++)
{
float4 plane = cameraPlanes[i];
float3 planeNormal = plane.xyz;
float planeDistance = plane.w;
float3 normalSign = math.sign(planeNormal);
float3 testPoint = bounds.Center + (bounds.Extents * normalSign);
float3 testPoint = new float3(bounds.center) + (bounds.extents * normalSign);

float dot = math.dot(testPoint, planeNormal);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ private void InitializeMiscVisibility()

var cliffsBoundary = new VisibleBounds
{
Bounds = new AABB
Bounds = new Bounds()
{
Center = bounds.center,
Extents = bounds.extents + Vector3.one,
center = bounds.center,
extents = bounds.extents + Vector3.one,
},
};

Expand Down Expand Up @@ -157,10 +157,10 @@ private void InitializeWaterVisibility()

waterBoundaries[i] = new VisibleBounds
{
Bounds = new AABB
Bounds = new Bounds()
{
Center = bounds.center,
Extents = bounds.extents + Vector3.one,
center = bounds.center,
extents = bounds.extents + Vector3.one,
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ private void InitializeTerrainVisibility()

terrainVisibilities[i] = new VisibleBounds
{
Bounds = new AABB
Bounds = new Bounds
{
Center = bounds.center,
Extents = bounds.extents,
center = bounds.center,
extents = bounds.extents,
},
};
}
Expand Down
1 change: 0 additions & 1 deletion Explorer/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"com.unity.code-analysis": "0.1.2-preview",
"com.unity.collab-proxy": "2.4.4",
"com.unity.collections": "2.1.4",
"com.unity.entities": "1.0.16",
"com.unity.feature.development": "1.0.1",
"com.unity.ide.rider": "3.0.31",
"com.unity.inputsystem": "1.7.0",
Expand Down

0 comments on commit dc13600

Please sign in to comment.