Starting switch to bounding sphere

This commit is contained in:
Dynamitos
2024-03-29 08:49:03 +01:00
parent 05eff8ca6f
commit 82baf898a6
2 changed files with 28 additions and 3 deletions
@@ -1,5 +1,30 @@
import Common; import Common;
struct BoundingSphere
{
float4 centerRadius;
float3 getCenter()
{
return centerRadius.xyz;
}
float getRadius()
{
return centerRadius.w;
}
bool pointInside(float3 p)
{
if(abs(getCenter() - p) > getRadius())
{
return false;
}
return true;
}
bool insideFrustum(float4x4 transform, Frustum frustum)
{
}
};
struct AABB struct AABB
{ {
float3 min; float3 min;
+3 -3
View File
@@ -1,8 +1,8 @@
import AABB; import Bounding;
struct MeshletDescription struct MeshletDescription
{ {
AABB boundingBox; BoundingSphere bounding;
uint32_t vertexCount; uint32_t vertexCount;
uint32_t primitiveCount; uint32_t primitiveCount;
uint32_t vertexOffset; uint32_t vertexOffset;
@@ -13,7 +13,7 @@ struct MeshletDescription
struct MeshData struct MeshData
{ {
AABB boundingBox; BoundingSphere bounding;
uint32_t numMeshlets; uint32_t numMeshlets;
uint32_t meshletOffset; uint32_t meshletOffset;
uint32_t firstIndex; uint32_t firstIndex;