Add needsdf flag to mjsMesh.
PiperOrigin-RevId: 782949528 Change-Id: Iaa96326a91795c3469c991bd8def53560b38e4f0
This commit is contained in:
committed by
Copybara-Service
parent
92bcbeb5d3
commit
9a41d385c1
@@ -140,7 +140,6 @@ mjCMesh::mjCMesh(mjCModel* _model, mjCDef* _def) {
|
||||
maxhullvert_ = -1;
|
||||
processed_ = false;
|
||||
visual_ = true;
|
||||
needoct_ = false;
|
||||
needreorient_ = true;
|
||||
|
||||
// reset to default if given
|
||||
@@ -362,7 +361,7 @@ void mjCMesh::LoadSDF() {
|
||||
}
|
||||
|
||||
needreorient_ = false;
|
||||
needoct_ = false;
|
||||
needsdf = false;
|
||||
normal_ = std::move(usernormal);
|
||||
face_ = std::move(userface);
|
||||
ProcessVertices(uservert);
|
||||
@@ -685,7 +684,7 @@ void mjCMesh::TryCompile(const mjVFS* vfs) {
|
||||
}
|
||||
|
||||
// make octree
|
||||
if (!needoct_) {
|
||||
if (!needsdf) {
|
||||
octree_.Clear(); // this occurs when a non-SDF mesh is loaded from a cached SDF mesh
|
||||
} else if (octree_.Nodes().empty()) {
|
||||
octree_.SetFace(vert_, face_);
|
||||
|
||||
@@ -1689,7 +1689,7 @@ void mjCModel::IndexAssets(bool discard) {
|
||||
((mjCMesh*)mesh)->SetNotVisual(); // reset to true by mesh->Compile()
|
||||
}
|
||||
geom->mesh = (discard && geom->visual_) ? nullptr : (mjCMesh*)mesh;
|
||||
static_cast<mjCMesh*>(mesh)->needoct_ |= geom->spec.type == mjGEOM_SDF;
|
||||
static_cast<mjCMesh*>(mesh)->spec.needsdf |= geom->spec.type == mjGEOM_SDF;
|
||||
} else {
|
||||
throw mjCError(geom, "mesh '%s' not found in geom %d", geom->get_meshname().c_str(), i);
|
||||
}
|
||||
|
||||
@@ -1004,7 +1004,6 @@ class mjCMesh_ : public mjCBase {
|
||||
|
||||
// used by the compiler
|
||||
bool needreorient_; // needs reorientation
|
||||
bool needoct_; // needs octree
|
||||
bool visual_; // true: the mesh is only visual
|
||||
std::vector< std::pair<int, int> > halfedge_; // half-edge data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user