From Ruben, added handling of vertex indices.
Note from Robert. New codes produces errors when running osgfxbrowser cow.osg so I have elected to keep the original implementation of compute_basis_vectors around and as the default compile to keep the CVS version working. Ruben's new version of compute_basis_vectors has to be explicitly compiled in by toggling an #if 1 block to #if 0.
This commit is contained in:
@@ -54,16 +54,25 @@ public:
|
||||
inline const osg::Vec4Array *getBinormalArray() const { return B_.get(); }
|
||||
inline void setBinormalArray(osg::Vec4Array *array) { B_ = array; }
|
||||
|
||||
inline osg::IndexArray *getIndices() { return indices_.get(); }
|
||||
protected:
|
||||
virtual ~TangentSpaceGenerator() {}
|
||||
TangentSpaceGenerator &operator=(const TangentSpaceGenerator &) { return *this; }
|
||||
|
||||
void compute_basis_vectors(osg::PrimitiveSet *pset, const osg::Array *vx, const osg::Array *nx, const osg::Array *tx, int iA, int iB, int iC);
|
||||
void compute_basis_vectors(osg::PrimitiveSet *pset,
|
||||
const osg::Array *vx,
|
||||
const osg::Array *nx,
|
||||
const osg::Array *tx,
|
||||
const osg::IndexArray *vix,
|
||||
const osg::IndexArray *nix,
|
||||
const osg::IndexArray *tix,
|
||||
int iA, int iB, int iC);
|
||||
|
||||
private:
|
||||
osg::ref_ptr<osg::Vec4Array> T_;
|
||||
osg::ref_ptr<osg::Vec4Array> B_;
|
||||
osg::ref_ptr<osg::Vec4Array> N_;
|
||||
osg::ref_ptr<osg::UIntArray> indices_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user