Added updating of the bbox for generic mesh build
Added build for point clouds Added Clear at the beginning of the Build(m)
This commit is contained in:
parent
94fe86b876
commit
efe6379b4b
|
|
@ -558,6 +558,7 @@ void Torus(MeshType &m, float hRingRadius, float vRingRadius, int hRingDiv=24, i
|
|||
|
||||
}
|
||||
|
||||
|
||||
// this function build a mesh starting from a vector of generic coords (objects having a triple of float at their beginning)
|
||||
// and a vector of faces (objects having a triple of ints at theri beginning).
|
||||
template <class MeshType,class V, class F >
|
||||
|
|
@ -569,6 +570,7 @@ void Build( MeshType & in, const V & v, const F & f)
|
|||
typedef typename MeshType::VertexIterator VertexIterator;
|
||||
typedef typename MeshType::FaceIterator FaceIterator;
|
||||
|
||||
in.Clear();
|
||||
Allocator<MeshType>::AddVertices(in,v.size());
|
||||
Allocator<MeshType>::AddFaces(in,f.size());
|
||||
|
||||
|
|
@ -604,8 +606,17 @@ void Build( MeshType & in, const V & v, const F & f)
|
|||
in.face[i].V(0) = &in.vert[ ff[0] ];
|
||||
in.face[i].V(1) = &in.vert[ ff[0] ];
|
||||
in.face[i].V(2) = &in.vert[ ff[0] ];
|
||||
|
||||
}
|
||||
|
||||
tri::UpdateBounding<MeshType>::Box(in);
|
||||
}
|
||||
|
||||
|
||||
template <class MeshType,class V>
|
||||
void Build( MeshType & in, const V & v)
|
||||
{
|
||||
std::vector<int[3]> dummyfaceVec;
|
||||
Build(in,v,dummyfaceVec);
|
||||
}
|
||||
|
||||
// Build a regular grid mesh as a typical height field mesh
|
||||
|
|
|
|||
Loading…
Reference in New Issue