mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
add steal_vrefs
This commit is contained in:
parent
986f3f8bdc
commit
397b886289
@ -505,6 +505,26 @@ get_vertex_membership(const EggVertex *vert) const {
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: EggGroup::steal_vrefs
|
||||
// Access: Public
|
||||
// Description: Moves all of the vertex references from the indicated
|
||||
// other group into this one. If a given vertex was
|
||||
// previously shared by both groups, the relative
|
||||
// memberships will be summed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void EggGroup::
|
||||
steal_vrefs(EggGroup *other) {
|
||||
nassertv(other != this);
|
||||
VertexRef::const_iterator vri;
|
||||
for (vri = other->vref_begin(); vri != other->vref_end(); ++vri) {
|
||||
EggVertex *vert = (*vri).first;
|
||||
double membership = (*vri).second;
|
||||
ref_vertex(vert, membership);
|
||||
}
|
||||
other->unref_all_vertices();
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
|
@ -198,6 +198,7 @@ public:
|
||||
void unref_vertex(EggVertex *vert);
|
||||
void unref_all_vertices();
|
||||
double get_vertex_membership(const EggVertex *vert) const;
|
||||
void steal_vrefs(EggGroup *other);
|
||||
|
||||
INLINE VertexRef::const_iterator vref_begin() const;
|
||||
INLINE VertexRef::const_iterator vref_end() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user