near plane clipping partial

This commit is contained in:
2026-02-21 16:28:09 +01:00
parent 7c03b1b81d
commit 7ca48a5080
9 changed files with 271 additions and 37 deletions
+14
View File
@@ -36,11 +36,25 @@ class DeltaVector3 {
};
float getDeterminant(const DeltaVector2 &pointA, const DeltaVector2 &pointB, const DeltaVector2 &candidate);
DeltaVector2 barycentricToScreen(const DeltaVector3 &baryPoint, const DeltaVector2 &a, const DeltaVector2 &b, const DeltaVector2 &c);
DeltaVector3 intersect(DeltaVector3 a, DeltaVector3 b, float nearZ);
struct DeltaTriangle {
DeltaVector3 a, b, c;
};
struct DeltaTriangle2D {
DeltaVector2 a, b, c;
};
struct DeltaRenderTriangle {
DeltaVector3 a, b, c;
DeltaVector2 uva, uvb, uvc;
};
int clipTriangleAgainstNearPlane(float nearY, const DeltaRenderTriangle &in, DeltaRenderTriangle &out1, DeltaRenderTriangle &out2);
uint32_t SDLColorToUint32(SDL_Color color);
#endif