UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
QuadricError.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "MathUtil.h"
6#include "VectorTypes.h"
7#include "MatrixTypes.h"
9
10namespace UE
11{
12namespace Geometry
13{
14
15using namespace UE::Math;
16
22template<typename RealType>
24{
25 typedef RealType ScalarType;
26
27 RealType Axx, Axy, Axz, Ayy, Ayz, Azz;
28 RealType bx, by, bz; //d = -normal.dot(c); b = d*normal
29 RealType c; // d*d
30
31 inline static TQuadricError Zero() { return TQuadricError(); };
32
34 {
35 Axx = Axy = Axz = Ayy = Ayz = Azz = bx = by = bz = c = 0;
36 }
37
42 {
43 Axx = Normal.X * Normal.X;
44 Axy = Normal.X * Normal.Y;
45 Axz = Normal.X * Normal.Z;
46 Ayy = Normal.Y * Normal.Y;
47 Ayz = Normal.Y * Normal.Z;
48 Azz = Normal.Z * Normal.Z;
49 bx = by = bz = c = 0;
51 bx = -v.X; by = -v.Y; bz = -v.Z; // b = -Normal.Dot(Point) Normal
52 c = Point.Dot(v); // note this is the same as Normal.Dot(Point) ^2
53 }
54
59 {
60 Axx = a.Axx + b.Axx;
61 Axy = a.Axy + b.Axy;
62 Axz = a.Axz + b.Axz;
63 Ayy = a.Ayy + b.Ayy;
64 Ayz = a.Ayz + b.Ayz;
65 Azz = a.Azz + b.Azz;
66 bx = a.bx + b.bx;
67 by = a.by + b.by;
68 bz = a.bz + b.bz;
69 c = a.c + b.c;
70 }
71
72
76 void Add(RealType w, const TQuadricError& b)
77 {
78 Axx += w * b.Axx;
79 Axy += w * b.Axy;
80 Axz += w * b.Axz;
81 Ayy += w * b.Ayy;
82 Ayz += w * b.Ayz;
83 Azz += w * b.Azz;
84 bx += w * b.bx;
85 by += w * b.by;
86 bz += w * b.bz;
87 c += w * b.c;
88 }
89
90 void Add(const TQuadricError& b)
91 {
92 Axx += b.Axx;
93 Axy += b.Axy;
94 Axz += b.Axz;
95 Ayy += b.Ayy;
96 Ayz += b.Ayz;
97 Azz += b.Azz;
98 bx += b.bx;
99 by += b.by;
100 bz += b.bz;
101 c += b.c;
102 }
103
104 void Subtract(const TQuadricError& b)
105 {
106 Axx -= b.Axx;
107 Axy -= b.Axy;
108 Axz -= b.Axz;
109 Ayy -= b.Ayy;
110 Ayz -= b.Ayz;
111 Azz -= b.Azz;
112 bx -= b.bx;
113 by -= b.by;
114 bz -= b.bz;
115 c -= b.c;
116 }
117
119 {
120 Add(b);
121 }
122
124 {
125 Subtract(b);
126 }
127
131 void Scale(RealType w)
132 {
133 Axx *= w;
134 Axy *= w;
135 Axz *= w;
136 Ayy *= w;
137 Ayz *= w;
138 Azz *= w;
139 bx *= w;
140 by *= w;
141 bz *= w;
142 c *= w;
143 }
144
150 {
151 RealType x = Axx * pt.X + Axy * pt.Y + Axz * pt.Z;
152 RealType y = Axy * pt.X + Ayy * pt.Y + Ayz * pt.Z;
153 RealType z = Axz * pt.X + Ayz * pt.Y + Azz * pt.Z;
154 return (pt.X * x + pt.Y * y + pt.Z * z) +
155 2.0 * (pt.X * bx + pt.Y * by + pt.Z * bz) + c;
156 }
157
162 {
163 RealType x = Axx * pt.X + Axy * pt.Y + Axz * pt.Z;
164 RealType y = Axy * pt.X + Ayy * pt.Y + Ayz * pt.Z;
165 RealType z = Axz * pt.X + Ayz * pt.Y + Azz * pt.Z;
166 return TVector<RealType>(x, y, z);
167 }
168
169
170 bool SolveAxEqualsb(UE::Math::TVector<RealType>& OutResult, const RealType bvecx, const RealType bvecy, const RealType bvecz, const RealType minThresh = 1000.0*TMathUtil<RealType>::Epsilon) const
171 {
172 RealType a11 = Azz * Ayy - Ayz * Ayz;
173 RealType a12 = Axz * Ayz - Azz * Axy;
174 RealType a13 = Axy * Ayz - Axz * Ayy;
175 RealType a22 = Azz * Axx - Axz * Axz;
176 RealType a23 = Axy * Axz - Axx * Ayz;
177 RealType a33 = Axx * Ayy - Axy * Axy;
178 RealType det = (Axx * a11) + (Axy * a12) + (Axz * a13);
179
180 // TODO: not sure what we should be using for this threshold...have seen
181 // det less than 10^-9 on "normal" meshes.
182 if (FMath::Abs(det) > minThresh)
183 {
184 det = 1.0 / det;
185 a11 *= det; a12 *= det; a13 *= det;
186 a22 *= det; a23 *= det; a33 *= det;
187 RealType x = a11 * bvecx + a12 * bvecy + a13 * bvecz;
188 RealType y = a12 * bvecx + a22 * bvecy + a23 * bvecz;
189 RealType z = a13 * bvecx + a23 * bvecy + a33 * bvecz;
190 OutResult = TVector<RealType>(x, y, z);
191 return true;
192 }
193 else
194 {
195 return false;
196 }
197 }
198
199 static bool InvertSymmetricMatrix(const RealType SM[6], RealType InvSM[6], RealType minThresh = 1000.0*TMathUtil<RealType>::Epsilon)
200 {
201 bool Result = false;
202 // Axx = SM[0]; Axy = SM[1]; Axz = SM[2]
203 // Ayy = SM[3]; Ayz = SM[4]
204 // Azz = SM[5]
205
206 InvSM[0] = SM[5] * SM[3] - SM[4] * SM[4]; //s11
207 InvSM[1] = SM[2] * SM[4] - SM[5] * SM[1]; //s12
208 InvSM[2] = SM[1] * SM[4] - SM[2] * SM[3]; //s13
209 InvSM[3] = SM[5] * SM[0] - SM[2] * SM[2]; //s22
210 InvSM[4] = SM[1] * SM[2] - SM[0] * SM[4]; //s23
211 InvSM[5] = SM[0] * SM[3] - SM[1] * SM[1]; //s33
212 RealType Det = (SM[0] * InvSM[0]) + (SM[1] * InvSM[1]) + (SM[2] * InvSM[2]);
213 if (FMath::Abs(Det) > minThresh)
214 {
215 RealType InvDet = RealType(1) / Det;
216 InvSM[0] *= InvDet; InvSM[1] *= InvDet; InvSM[2] *= InvDet;
217 InvSM[3] *= InvDet; InvSM[4] *= InvDet;
218 InvSM[5] *= InvDet;
219 Result = true;
220 }
221 return Result;
222 }
223
224 static TVector<RealType> MultiplySymmetricMatrix(const RealType SM[6], const RealType vec[3])
225 {
226
227 RealType a = SM[0] * vec[0] + SM[1] * vec[1] + SM[2] * vec[2];
228 RealType b = SM[1] * vec[0] + SM[3] * vec[1] + SM[4] * vec[2];
229 RealType c = SM[2] * vec[0] + SM[4] * vec[1] + SM[5] * vec[2];
230
231 return TVector<RealType>(a, b, c);
232 }
234 {
235 RealType vectmp[3] = { vec.X, vec.Y, vec.Z };
237 }
238
239
244
245};
246
247
250
257template<typename RealType>
258class TVolPresQuadricError : public TQuadricError<RealType>
259{
260public:
261
263
265 {
267 {
268 N = Normal;
269 Dist = -Normal.Dot(Point);
270 }
271
272 FPlaneData(RealType w, const FPlaneData& other)
273 {
274 N = w * other.N;
275 Dist = w * other.Dist;
276 }
277
279 {
280 N = other.N;
281 Dist = other.Dist;
282 }
283
285 {
287 Dist = RealType(0);
288 }
289
290 void Add(const FPlaneData& other)
291 {
292 N += other.N;
293 Dist += other.Dist;
294 }
295
299 void Add(RealType w, const FPlaneData& other)
300 {
301 N += w * other.N;
302 Dist += w * other.Dist;
303 }
304
306 {
307 N = other.N;
308 Dist = other.Dist;
309
310 return *this;
311 }
312
314 RealType Dist;
315 };
316
318
319public:
320
321 inline static TVolPresQuadricError Zero() { return TVolPresQuadricError(); };
322
326
331
332
339
341 : BaseStruct(a, b)
343 {
345
346 // Subtract a single copy of the duplicate plane data.
348 }
349
353 void Add(RealType w, const TVolPresQuadricError& b)
354 {
355 BaseStruct::Add(w, b);
356
358 }
359
360
365 {
366 // Compute the unconstrained optimal point
368
369 // if it failed ( the A matrix wasn't invertible) we early out
370 if (!bValid)
371 {
372 return bValid;
373 }
374
375 // Adjust with the volume constraint.
376 // See: http://hhoppe.com/newqem.pdf or https://www.cc.gatech.edu/~turk/my_papers/memless_vis98.pdf
377
378 FPlaneData gvol(1. / 3., PlaneData);
379
380 // Compute the effect of the volumetric constraint.
381 RealType Tol = minThresh; //(1.e-7); NB: using minThresh here to better compare with the attribute version..
382 //constexpr RealType Tol = (1.e-7); //NB: using minThresh here to better compare with the attribute version..
383
385 if (BaseStruct::SolveAxEqualsb(Ainv_g, gvol.N.X, gvol.N.Y, gvol.N.Z, Tol))
386 {
387
388 RealType gt_Ainv_g = gvol.N.Dot(Ainv_g);
389
390 // move the point to the constrained optimal
391 RealType gt_unopt = gvol.N.Dot(OutResult);
392 RealType lambda = (gvol.Dist + gt_unopt) / gt_Ainv_g;
393
394 // Check if the constraint failed.
395
396 if (FMath::Abs(lambda) > 1.e5)
397 {
398 return bValid;
399 }
400
402 }
403
404 return bValid;
405
406
407 }
408};
409
410
413
419template<typename RealType>
421{
422public:
423 typedef RealType ScalarType;
426
427 // Triangle Quadric constructor. Take vertex locations, vertex normals, face normal, and center of face.
432 a(0),
434 {
462 // the basis matrix is composed of two edges of the triangle and the face normal.
463 // unless the triangle is degenerate (or too small), this should be invertible.
464 //@todo replace the 3x3 system with a 2x2 system that results from g = a1 e_10 + a2 e_20
465 // and solving for a1, a2
466 const TMatrix3<RealType> BasisMatrix(P2-P0, P1-P0, NFace, true); // row-based matrix constructor.
467
468 const double det = BasisMatrix.Determinant(); // geometrically the det is related to the triangle area squared
469 if (FMath::Abs(det) > 1.e-8)
470 {
471 // invert the matrix
473
474 // for each component of the attribute vector,
475 for (int i = 0; i < 3; ++i)
476 {
477 const FVector3d ScaledAttr = AttrWeight * FVector3d(N0[i], N1[i], N2[i]);
478 const FVector3d DataVec(ScaledAttr[2] - ScaledAttr[0], ScaledAttr[1] - ScaledAttr[0], 0.);
479
480 // compute vector 'g' and scalar 'd'
482 d[i] = ScaledAttr[0] - P0.Dot(grad[i]);
483
484 // add the values to the quadric
485 BaseStruct::Axx += grad[i].X * grad[i].X;
486
487 BaseStruct::Axy += grad[i].X * grad[i].Y;
488 BaseStruct::Axz += grad[i].X * grad[i].Z;
489
490 BaseStruct::Ayy += grad[i].Y * grad[i].Y;
491 BaseStruct::Ayz += grad[i].Y * grad[i].Z;
492 BaseStruct::Azz += grad[i].Z * grad[i].Z;
493
494 BaseStruct::bx += d[i] * grad[i].X;
495 BaseStruct::by += d[i] * grad[i].Y;
496 BaseStruct::bz += d[i] * grad[i].Z;
497
498 BaseStruct::c += d[i] * d[i];
499 }
500 }
501 else // the triangle was too small or degenerate in some other way
502 {
503 for (int i = 0; i < 3; ++i)
504 {
506 d[i] = AttrWeight * (N0[i] + N1[i] + N2[i]) / 3.; // just average the attribute.
507 }
508 }
509 }
510
512 :BaseClass(),
513 a(0.),
514 attrweight(1.)
515 {
519
520 d[0] = RealType(0);
521 d[1] = RealType(0);
522 d[2] = RealType(0);
523 }
524
527 {
528 a = Aother.a + Bother.a;
529 attrweight = 0.5 * (Aother.attrweight + Bother.attrweight);
530
531 grad[0] = Aother.grad[0] + Bother.grad[0];
532 grad[1] = Aother.grad[1] + Bother.grad[1];
533 grad[2] = Aother.grad[2] + Bother.grad[2];
534
535 d[0] = Aother.d[0] + Bother.d[0];
536 d[1] = Aother.d[1] + Bother.d[1];
537 d[2] = Aother.d[2] + Bother.d[2];
538 }
539
541
545 void Add(RealType w, const TAttrBasedQuadricError& other)
546 {
548
549 a += w; // accumulate weight
550 attrweight = other.attrweight;
551
552 grad[0] += w * other.grad[0];
553 grad[1] += w * other.grad[1];
554 grad[2] += w * other.grad[2];
555
556 d[0] += w * other.d[0];
557 d[1] += w * other.d[1];
558 d[2] += w * other.d[2];
559 }
560
561
566 {
567 // Generate symmetric matrix
568 RealType SM[6] = { 0., 0., 0., 0., 0., 0. };
569
570
571 for (int i = 0; i < 3; ++i)
572 {
573 SM[0] -= grad[i].X * grad[i].X; SM[1] -= grad[i].X * grad[i].Y; SM[2] -= grad[i].X * grad[i].Z;
574 SM[3] -= grad[i].Y * grad[i].Y; SM[4] -= grad[i].Y * grad[i].Z;
575 SM[5] -= grad[i].Z * grad[i].Z;
576 }
577
578 RealType InvA = (FMath::Abs(a) > 1.e-7) ? RealType(1) / a : 0.;
579
580 SM[0] *= InvA; SM[1] *= InvA; SM[2] *= InvA;
581 SM[3] *= InvA; SM[4] *= InvA;
582 SM[5] *= InvA;
583
584 // A - (grad_attr0, grad_attr1.. grad_attrn) . (grad_attr0, grad_attr1.. grad_attrn)^T
585
588 SM[5] += BaseStruct::Azz;
589
590
591 RealType InvSM[6];
593
594 RealType b[3] = { -BaseStruct::bx, -BaseStruct::by, -BaseStruct::bz };
595 b[0] += InvA * (grad[0].X * d[0] + grad[1].X * d[1] + grad[2].X * d[2]);
596 b[1] += InvA * (grad[0].Y * d[0] + grad[1].Y * d[1] + grad[2].Y * d[2]);
597 b[2] += InvA * (grad[0].Z * d[0] + grad[1].Z * d[1] + grad[2].Z * d[2]);
598
599 // add volume constraint
601
602 if (bValid)
603 {
604 // optimal point prior to volume correction
605
607 //SolveAxEqualsb(OptPoint, b[0], b[1], b[2]);
608
610 //SolveAxEqualsb(InvSMgvol, gvol.N.X, gvol.N.Y, gvol.N.Z);
611
612 RealType gvolDotInvSMgvol = gvol.N.Dot(InvSMgvol);
613
614 // move the point to the constrained optimal
615 RealType gvolDotuncopt = gvol.N.Dot(OptPoint);
616 RealType lambda = (gvol.Dist + gvolDotuncopt) / gvolDotInvSMgvol;
617
618 // Check if the constraint failed.
619
620 if (FMath::Abs(lambda) > 1.e5)
621 {
622 return bValid;
623 }
624
626 }
627
628 return bValid;
629
630 }
631
632 RealType Evaluate(const TVector<RealType>& point, const TVector<RealType>& InAttr) const
633 {
634 // 6x6 symmetric matrix ( A -grad[0], -grad[1], -grad[2] )
635 // ( -grad[0]^T )
636 // ( -grad[1]^T aI )
637 // ( -grad[2]^T )
638 //
639 // aI is Identity matrix scaled by the accumulated area 'a'
640 //
641 // extended state vector v = ( point )
642 // ( attr )
643 //
644
645 const TVector<RealType> attr = attrweight * InAttr;
646
647 RealType ptAp = point.Dot(BaseStruct::MultiplyA(point));
648 RealType attrDotattr = attr.Dot(attr);
649 TVector<RealType> Gradattr(grad[0].X * attr[0] + grad[1].X * attr[1] + grad[2].X * attr[2],
650 grad[0].Y * attr[0] + grad[1].Y * attr[1] + grad[2].Y * attr[2],
651 grad[0].Z * attr[0] + grad[1].Z * attr[1] + grad[2].Z * attr[2]);
652 RealType ptGradattr = point.Dot(Gradattr);
653
654 RealType vtSv = ptAp + a * attrDotattr - RealType(2) * ptGradattr;
655
656 // extended 'b' vector
657 // ( b )
658 // (-d )
659 // compute 2<v|b>
660 RealType vtb = point.X * BaseStruct::bx + point.Y * BaseStruct::by + point.Z * BaseStruct::bz
661 - (d[0] * attr[0] + d[1] * attr[1] + d[2] * attr[2]);
662
663 RealType QuadricError = vtSv + RealType(2) * vtb + BaseStruct::c;
664
665 return QuadricError;
666 }
667
669 {
670 if (FMath::Abs(a) > 1.e-5)
671 {
672 RealType aInv = RealType(1) / a;
673
674 attr.X = grad[0].Dot(point) + d[0];
675 attr.Y = grad[1].Dot(point) + d[1];
676 attr.Z = grad[2].Dot(point) + d[2];
677
678 attr *= aInv;
679 }
680 else
681 {
682 attr.X = RealType(0);
683 attr.Y = RealType(0);
684 attr.Z = RealType(0);
685 }
686
687 // the quadric was constructed around a scaled version of the attribute. need to un-scale the result
688 attr *= 1. / attrweight;
689 }
690
691 RealType Evaluate(const TVector<RealType>& point) const
692 {
694 ComputeAttributes(point, attr);
695
696 return Evaluate(point, attr);
697 }
698
699public:
700
701 // accumulated area
702 RealType a;
703
704 // weight used to internally scale the attribute/
705 // used to increase or decrease the importance of the normal in computing the optimal position
706 RealType attrweight = 1.;
707
708 // Additional planes for the attributes.
710 RealType d[3];
711
712
713};
714
717
722template<typename RealType>
724{
725
726 RealType LenghtSqrd = AdjFaceNormal.SquaredLength();
727 RealType error = 100000.0 * TMathUtil<RealType>::Epsilon;
728 if (!FMath::IsNearlyEqual(LenghtSqrd, (RealType)1., error) )
729 {
730 // zero quadric
732 }
733
734
735 TVector<RealType> Edge = p1 - p0;
736
737 // Weight scaled on edge length
738
739 const RealType EdgeLengthSqrd = Edge.SquaredLength();
741 {
742 // zero quadric
744 }
745
746 const RealType EdgeLength = FMath::Sqrt(EdgeLengthSqrd);
747 // normalize
748 Edge *= 1. / EdgeLength;
749
750
751 const RealType Weight = EdgeLength;
752
753 // Normal that is perpendicular to the edge, and face Normal. - i.e. in the face plane and perpendicular to the edge.
754 // The constraint should try to keep points on the plane associated with this constraint plane.
756
757
759
760 SeamQuadric.Scale(EdgeLength);
761
762 return SeamQuadric;
763}
764
765
766} // end namespace UE::Geometry
767} // end namespace UE
@ Normal
Definition AndroidInputInterface.h:116
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define X(Name, Desc)
Definition FormatStringSan.h:47
UE::Math::TVector< double > FVector3d
Definition MathFwd.h:60
Definition MathUtil.h:150
Definition QuadricError.h:421
RealType a
Definition QuadricError.h:702
RealType d[3]
Definition QuadricError.h:710
TVolPresQuadricError< RealType > BaseClass
Definition QuadricError.h:424
TQuadricError< RealType > BaseStruct
Definition QuadricError.h:425
void ComputeAttributes(const TVector< RealType > &point, TVector< RealType > &attr) const
Definition QuadricError.h:668
TAttrBasedQuadricError()
Definition QuadricError.h:511
RealType attrweight
Definition QuadricError.h:706
bool OptimalPoint(UE::Math::TVector< RealType > &OptPoint, RealType minThresh=1000.0 *TMathUtil< RealType >::Epsilon) const
Definition QuadricError.h:565
static TAttrBasedQuadricError Zero()
Definition QuadricError.h:540
TAttrBasedQuadricError(const TAttrBasedQuadricError &Aother, const TAttrBasedQuadricError &Bother)
Definition QuadricError.h:525
void Add(RealType w, const TAttrBasedQuadricError &other)
Definition QuadricError.h:545
TAttrBasedQuadricError(const TVector< RealType > &P0, const TVector< RealType > &P1, const TVector< RealType > &P2, const TVector< RealType > &N0, const TVector< RealType > &N1, const TVector< RealType > &N2, const TVector< RealType > &NFace, const TVector< RealType > &CenterPoint, RealType AttrWeight)
Definition QuadricError.h:428
RealType ScalarType
Definition QuadricError.h:423
TVector< RealType > grad[3]
Definition QuadricError.h:709
RealType Evaluate(const TVector< RealType > &point, const TVector< RealType > &InAttr) const
Definition QuadricError.h:632
RealType Evaluate(const TVector< RealType > &point) const
Definition QuadricError.h:691
Definition QuadricError.h:259
TVolPresQuadricError(const TVector< RealType > &Normal, const TVector< RealType > &Point)
Definition QuadricError.h:327
static TVolPresQuadricError Zero()
Definition QuadricError.h:321
TVolPresQuadricError(const TVolPresQuadricError &a, const TVolPresQuadricError &b, const FPlaneData &DuplicatePlaneData)
Definition QuadricError.h:340
FPlaneData PlaneData
Definition QuadricError.h:317
TVolPresQuadricError()
Definition QuadricError.h:323
TQuadricError< RealType > BaseStruct
Definition QuadricError.h:262
void Add(RealType w, const TVolPresQuadricError &b)
Definition QuadricError.h:353
TVolPresQuadricError(const TVolPresQuadricError &a, const TVolPresQuadricError &b)
Definition QuadricError.h:333
bool OptimalPoint(UE::Math::TVector< RealType > &OutResult, RealType minThresh=1000.0 *TMathUtil< RealType >::Epsilon) const
Definition QuadricError.h:364
TQuadricError< RealType > CreateSeamQuadric(const TVector< RealType > &p0, const TVector< RealType > &p1, const TVector< RealType > &AdjFaceNormal)
Definition QuadricError.h:723
TQuadricError< float > FQuadricErrorf
Definition QuadricError.h:248
TVolPresQuadricError< float > FVolPresQuadricErrorf
Definition QuadricError.h:411
TAttrBasedQuadricError< double > FAttrBasedQuadricErrord
Definition QuadricError.h:716
TQuadricError< double > FQuadricErrord
Definition QuadricError.h:249
TAttrBasedQuadricError< float > FAttrBasedQuadricErrorf
Definition QuadricError.h:715
TVolPresQuadricError< double > FVolPresQuadricErrord
Definition QuadricError.h:412
Definition Sphere.cpp:10
Definition AdvancedWidgetsModule.cpp:13
float v
Definition radaudio_mdct.cpp:62
static UE_FORCEINLINE_HINT bool IsNearlyEqual(float A, float B, float ErrorTolerance=UE_SMALL_NUMBER)
Definition UnrealMathUtility.h:388
static UE_FORCEINLINE_HINT bool IsNearlyZero(float Value, float ErrorTolerance=UE_SMALL_NUMBER)
Definition UnrealMathUtility.h:407
Definition MatrixTypes.h:17
TMatrix3< RealType > Inverse() const
Definition MatrixTypes.h:186
Definition QuadricError.h:24
void Add(RealType w, const TQuadricError &b)
Definition QuadricError.h:76
void AddSeamQuadric(const TQuadricError &b)
Definition QuadricError.h:118
bool OptimalPoint(UE::Math::TVector< RealType > &OutResult, RealType minThresh=1000.0 *TMathUtil< RealType >::Epsilon) const
Definition QuadricError.h:240
void Scale(RealType w)
Definition QuadricError.h:131
RealType Ayz
Definition QuadricError.h:27
TQuadricError(const TVector< RealType > &Normal, const TVector< RealType > &Point)
Definition QuadricError.h:41
RealType by
Definition QuadricError.h:28
TQuadricError()
Definition QuadricError.h:33
static TQuadricError Zero()
Definition QuadricError.h:31
RealType Axz
Definition QuadricError.h:27
TVector< RealType > MultiplyA(const UE::Math::TVector< RealType > &pt) const
Definition QuadricError.h:161
void Add(const TQuadricError &b)
Definition QuadricError.h:90
static TVector< RealType > MultiplySymmetricMatrix(const RealType SM[6], const RealType vec[3])
Definition QuadricError.h:224
static bool InvertSymmetricMatrix(const RealType SM[6], RealType InvSM[6], RealType minThresh=1000.0 *TMathUtil< RealType >::Epsilon)
Definition QuadricError.h:199
RealType Azz
Definition QuadricError.h:27
void Subtract(const TQuadricError &b)
Definition QuadricError.h:104
void SubtractSeamQuadric(const TQuadricError &b)
Definition QuadricError.h:123
bool SolveAxEqualsb(UE::Math::TVector< RealType > &OutResult, const RealType bvecx, const RealType bvecy, const RealType bvecz, const RealType minThresh=1000.0 *TMathUtil< RealType >::Epsilon) const
Definition QuadricError.h:170
RealType bz
Definition QuadricError.h:28
RealType Axy
Definition QuadricError.h:27
RealType Axx
Definition QuadricError.h:27
RealType ScalarType
Definition QuadricError.h:25
TQuadricError(const TQuadricError &a, const TQuadricError &b)
Definition QuadricError.h:58
static TVector< RealType > MultiplySymmetricMatrix(const RealType SM[6], const UE::Math::TVector< RealType > &vec)
Definition QuadricError.h:233
RealType Ayy
Definition QuadricError.h:27
RealType bx
Definition QuadricError.h:28
RealType Evaluate(const UE::Math::TVector< RealType > &pt) const
Definition QuadricError.h:149
RealType c
Definition QuadricError.h:29
FPlaneData()
Definition QuadricError.h:284
void Add(const FPlaneData &other)
Definition QuadricError.h:290
FPlaneData(const FPlaneData &other)
Definition QuadricError.h:278
FPlaneData(const TVector< RealType > &Normal, const TVector< RealType > &Point)
Definition QuadricError.h:266
FPlaneData & operator=(const FPlaneData &other)
Definition QuadricError.h:305
void Add(RealType w, const FPlaneData &other)
Definition QuadricError.h:299
RealType Dist
Definition QuadricError.h:314
FPlaneData(RealType w, const FPlaneData &other)
Definition QuadricError.h:272
TVector< RealType > N
Definition QuadricError.h:313
Definition Vector.h:51
T Z
Definition Vector.h:68
static TVector< T > Zero()
Definition Vector.h:112
T Y
Definition Vector.h:65
UE_FORCEINLINE_HINT TVector< T > Cross(const TVector< T > &V2) const
Definition Vector.h:1535
T X
Definition Vector.h:62
T SquaredLength() const
Definition Vector.h:1734
static UE_FORCEINLINE_HINT T Dist(const TVector< T > &V1, const TVector< T > &V2)
Definition Vector.h:2466
UE_FORCEINLINE_HINT T Dot(const TVector< T > &V) const
Definition Vector.h:1553