MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / update_

Method update_

source/MRViewer/MRRenderMeshObject.cpp:747–792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

745}
746
747void RenderMeshObject::update_( ViewportMask )
748{
749 auto objDirty = objMesh_->getDirtyFlags();
750 objMesh_->resetDirty();
751 if ( cornerMode_ )
752 {
753 // DIRTY_POSITION because we use corner rendering and need to update render verts
754 // DIRTY_UV because we need to update UV coordinates
755 if ( objDirty & DIRTY_FACE ) // first to also activate all flags due to DIRTY_POSITION later
756 objDirty |= DIRTY_POSITION | DIRTY_UV | DIRTY_VERTS_COLORMAP;
757 }
758 if ( objDirty & ( DIRTY_FACE | DIRTY_POSITION ) )
759 objDirty |= DIRTY_RENDER_NORMALS | DIRTY_BORDER_LINES | DIRTY_EDGES_SELECTION;
760 dirty_ |= objDirty;
761
762 if ( dirty_ & DIRTY_FACE || dirty_ & DIRTY_POSITION )
763 {
764 dirtyEdges_ = true;
765 dirtyPointPos_ = true;
766 }
767
768#ifndef __EMSCRIPTEN__
769 if ( !cornerMode_ && objMesh_->creases().any() )
770 {
771 // always need corner mode for creases
772 // it should not affect dirtyEdges_
773 cornerMode_ = true;
774 dirty_ |= DIRTY_POSITION;
775 dirty_ |= DIRTY_VERTS_COLORMAP;
776 dirty_ |= DIRTY_UV;
777 dirty_ |= DIRTY_FACE;
778 dirtyPointPos_ = true;
779 }
780 else if ( cornerMode_ && objMesh_->creases().none() )
781 {
782 // disable corner mode if no creases
783 // it should not affect dirtyEdges_
784 cornerMode_ = false;
785 dirty_ |= DIRTY_POSITION;
786 dirty_ |= DIRTY_VERTS_COLORMAP;
787 dirty_ |= DIRTY_UV;
788 dirty_ |= DIRTY_FACE;
789 dirtyPointPos_ = true;
790 }
791#endif
792}
793
794RenderBufferRef<Vector3f> RenderMeshObject::loadVertPosBuffer_()
795{

Callers

nothing calls this directly

Calls 3

resetDirtyMethod · 0.80
noneMethod · 0.80
anyMethod · 0.45

Tested by

no test coverage detected