From 6eb9902c8438a5553d3d647a84f0a81b28a3eae5 Mon Sep 17 00:00:00 2001 From: zamtmn Date: Fri, 24 Jan 2025 10:41:44 +0500 Subject: [PATCH] =?UTF-8?q?*=20=D0=91=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=BD=D0=B0=D1=8F=20CalcAABBInFrustum=20(=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=80=D1=8B=D0=B9=20=D0=B2=D0=B0=D1=80=D0=B8=D0=B0?= =?UTF-8?q?=D0=BD=D1=82,=20=D1=85=D0=B7=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0?= =?UTF-8?q?=20=D0=B8=20=D0=B7=D0=B0=D1=87=D0=B5=D0=BC=20=D1=8F=20=D0=BE?= =?UTF-8?q?=D1=82=20=D0=BD=D0=B5=D0=B3=D0=BE=20=D0=BE=D1=82=D0=BA=D0=B0?= =?UTF-8?q?=D0=B7=D0=B0=D0=BB=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cad_source/components/zmath/uzegeometry.pas | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/cad_source/components/zmath/uzegeometry.pas b/cad_source/components/zmath/uzegeometry.pas index cbe99ed9a..26f3434a1 100644 --- a/cad_source/components/zmath/uzegeometry.pas +++ b/cad_source/components/zmath/uzegeometry.pas @@ -671,7 +671,7 @@ function CalcPointTrueInFrustum (const lbegin:GDBvertex; const frustum:ClipArray function CalcAABBInFrustum (const AABB:TBoundingBox; const frustum:ClipArray):TInBoundingVolume; var - i{,Count}:integer; + i,Count:integer; p1,p2,p3,p4,p5,p6,p7,p8:GDBvertex; d1,d2,d3,d4,d5,d6,d7,d8:double; begin @@ -684,7 +684,7 @@ function CalcAABBInFrustum (const AABB:TBoundingBox; p7:=AABB.RTF; p8:=CreateVertex(AABB.LBN.x,AABB.RTF.y,AABB.RTF.Z); - //Count:=0; + Count:=0; for i:=0 to 5 do begin with frustum[i] do begin d1:=v[0] * p1.x + v[1] * p1.y + v[2] * p1.z + v[3]; @@ -703,26 +703,26 @@ function CalcAABBInFrustum (const AABB:TBoundingBox; system.exit; end; - if (d1<0)or(d2<0)or(d3<0)or(d4<0)or(d5<0)or(d6<0)or + {if (d1<0)or(d2<0)or(d3<0)or(d4<0)or(d5<0)or(d6<0)or (d7<0)or(d8<0) then begin Result:=IRPartially; system.exit; - end; - - //if d1>=0 then Inc(Count); - //if d2>=0 then Inc(Count); - //if d3>=0 then Inc(Count); - //if d4>=0 then Inc(Count); - //if d5>=0 then Inc(Count); - //if d6>=0 then Inc(Count); - //if d7>=0 then Inc(Count); - //if d8>=0 then Inc(Count); + end;} + + if d1>=0 then Inc(Count); + if d2>=0 then Inc(Count); + if d3>=0 then Inc(Count); + if d4>=0 then Inc(Count); + if d5>=0 then Inc(Count); + if d6>=0 then Inc(Count); + if d7>=0 then Inc(Count); + if d8>=0 then Inc(Count); + end; + //Result:=irfully; + Result:=IRPartially; + if Count=48 then begin + Result:=irfully; end; - Result:=irfully; - //if Count=48 then begin - // Result:=irfully; - // exit; - //end; //Result:=IRPartially; end; function PointOf3PlaneIntersect(const P1,P2,P3:DVector4D):GDBvertex;