Starting switch to bounding sphere
This commit is contained in:
@@ -1,5 +1,30 @@
|
||||
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
|
||||
{
|
||||
float3 min;
|
||||
@@ -1,8 +1,8 @@
|
||||
import AABB;
|
||||
import Bounding;
|
||||
|
||||
struct MeshletDescription
|
||||
{
|
||||
AABB boundingBox;
|
||||
BoundingSphere bounding;
|
||||
uint32_t vertexCount;
|
||||
uint32_t primitiveCount;
|
||||
uint32_t vertexOffset;
|
||||
@@ -13,7 +13,7 @@ struct MeshletDescription
|
||||
|
||||
struct MeshData
|
||||
{
|
||||
AABB boundingBox;
|
||||
BoundingSphere bounding;
|
||||
uint32_t numMeshlets;
|
||||
uint32_t meshletOffset;
|
||||
uint32_t firstIndex;
|
||||
|
||||
Reference in New Issue
Block a user