Add [SdfLib](https://github.com/UPC-ViRVIG/SdfLib) plugin to first-party SDFs.

The following dependencies are disabled with a cmake patch file.
- Enoki
- OpenMP
- Assimp
- FCPW

PiperOrigin-RevId: 565352386
Change-Id: Icff9de68408e0afa2032bb83b24491fc4e41d181
This commit is contained in:
Alessio Quaglino
2023-09-14 06:41:48 -07:00
committed by Copybara-Service
parent de5c3b1a09
commit 1afd98ec4b
16 changed files with 12337 additions and 6 deletions
+3 -1
View File
@@ -367,7 +367,9 @@ static mjtNum stepGradient(mjtNum x[3], const mjModel* m, const mjSDF* s,
mjc_gradient(m, d, s, grad, x);
// sanity check
if (isnan(grad[0]) || isnan(grad[1]) || isnan(grad[2])) {
if (isnan(grad[0]) || grad[0]>mjMAXVAL || grad[0]<-mjMAXVAL ||
isnan(grad[1]) || grad[1]>mjMAXVAL || grad[1]<-mjMAXVAL ||
isnan(grad[2]) || grad[2]>mjMAXVAL || grad[2]<-mjMAXVAL) {
return mjMAXVAL;
}
+3
View File
@@ -774,6 +774,9 @@ mjtNum ray_sdf(const mjModel* m, const mjData* d, int g,
if (distance < 1e-8) {
return distance_total;
}
if (distance > 1e6) {
break;
}
}
// reset counter