Convert tabs to spaces.
This commit is contained in:
@@ -45,7 +45,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
|
|||||||
|
|
||||||
class ControlPoint
|
class ControlPoint
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ControlPoint():
|
ControlPoint():
|
||||||
_scale(1.0,1.0,1.0) {}
|
_scale(1.0,1.0,1.0) {}
|
||||||
|
|
||||||
@@ -64,14 +64,14 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
|
|||||||
_rotation(rotation),
|
_rotation(rotation),
|
||||||
_scale(scale) {}
|
_scale(scale) {}
|
||||||
|
|
||||||
void setPosition(const osg::Vec3d& position) { _position = position; }
|
void setPosition(const osg::Vec3d& position) { _position = position; }
|
||||||
const osg::Vec3d& getPosition() const { return _position; }
|
const osg::Vec3d& getPosition() const { return _position; }
|
||||||
|
|
||||||
void setRotation(const osg::Quat& rotation) { _rotation = rotation; }
|
void setRotation(const osg::Quat& rotation) { _rotation = rotation; }
|
||||||
const osg::Quat& getRotation() const { return _rotation; }
|
const osg::Quat& getRotation() const { return _rotation; }
|
||||||
|
|
||||||
void setScale(const osg::Vec3d& scale) { _scale = scale; }
|
void setScale(const osg::Vec3d& scale) { _scale = scale; }
|
||||||
const osg::Vec3d& getScale() const { return _scale; }
|
const osg::Vec3d& getScale() const { return _scale; }
|
||||||
|
|
||||||
inline void interpolate(float ratio,const ControlPoint& first, const ControlPoint& second)
|
inline void interpolate(float ratio,const ControlPoint& first, const ControlPoint& second)
|
||||||
{
|
{
|
||||||
@@ -117,7 +117,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
|
|||||||
matrix.preMult(osg::Matrixd::translate(-_position));
|
matrix.preMult(osg::Matrixd::translate(-_position));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
osg::Vec3d _position;
|
osg::Vec3d _position;
|
||||||
osg::Quat _rotation;
|
osg::Quat _rotation;
|
||||||
|
|||||||
@@ -66,13 +66,13 @@ class OSG_EXPORT Billboard : public Geode
|
|||||||
typedef std::vector<Vec3> PositionList;
|
typedef std::vector<Vec3> PositionList;
|
||||||
|
|
||||||
/** Set the list of pivot point positions. */
|
/** Set the list of pivot point positions. */
|
||||||
inline void setPositionList(PositionList& pl) { _positionList=pl; }
|
inline void setPositionList(PositionList& pl) { _positionList=pl; }
|
||||||
|
|
||||||
/** Get the list of pivot point positions. */
|
/** Get the list of pivot point positions. */
|
||||||
inline PositionList& getPositionList() { return _positionList; }
|
inline PositionList& getPositionList() { return _positionList; }
|
||||||
|
|
||||||
/** Get a const list of pivot point positions. */
|
/** Get a const list of pivot point positions. */
|
||||||
inline const PositionList& getPositionList() const { return _positionList; }
|
inline const PositionList& getPositionList() const { return _positionList; }
|
||||||
|
|
||||||
/** Add a Drawable with a default position of Vec3(0,0,0).
|
/** Add a Drawable with a default position of Vec3(0,0,0).
|
||||||
* Call the base-class Geode::addDrawble() to add the given Drawable
|
* Call the base-class Geode::addDrawble() to add the given Drawable
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ class OSG_EXPORT ClipPlane : public StateAttribute
|
|||||||
|
|
||||||
/** Set the clip plane with the given Plane. */
|
/** Set the clip plane with the given Plane. */
|
||||||
void setClipPlane(const Plane& plane)
|
void setClipPlane(const Plane& plane)
|
||||||
{
|
{
|
||||||
_clipPlane.set(plane[0],plane[1],plane[2],plane[3]);
|
_clipPlane.set(plane[0],plane[1],plane[2],plane[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Defines the plane as [ a b c d ]. */
|
/** Defines the plane as [ a b c d ]. */
|
||||||
void setClipPlane(double a,double b,double c,double d)
|
void setClipPlane(double a,double b,double c,double d)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class OSG_EXPORT ClusterCullingCallback : public Drawable::CullCallback, public
|
|||||||
META_Object(osg,ClusterCullingCallback);
|
META_Object(osg,ClusterCullingCallback);
|
||||||
|
|
||||||
/** Computes the control point, normal, and deviation from the
|
/** Computes the control point, normal, and deviation from the
|
||||||
* given drawable contents. */
|
* given drawable contents. */
|
||||||
void computeFrom(const osg::Drawable* drawable);
|
void computeFrom(const osg::Drawable* drawable);
|
||||||
|
|
||||||
/** Transform the ClusterCullingCallback's positional members to a new coordinate frame.*/
|
/** Transform the ClusterCullingCallback's positional members to a new coordinate frame.*/
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ class OSG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::
|
|||||||
virtual void apply(osg::OccluderNode& node);
|
virtual void apply(osg::OccluderNode& node);
|
||||||
|
|
||||||
/** Sets the minimum shadow occluder volume that an active occluder
|
/** Sets the minimum shadow occluder volume that an active occluder
|
||||||
* must have. vol is units relative the clip space volume where 1.0
|
* must have. vol is units relative the clip space volume where 1.0
|
||||||
* is the whole clip space. */
|
* is the whole clip space. */
|
||||||
void setMinimumShadowOccluderVolume(float vol) { _minimumShadowOccluderVolume = vol; }
|
void setMinimumShadowOccluderVolume(float vol) { _minimumShadowOccluderVolume = vol; }
|
||||||
float getMinimumShadowOccluderVolume() const { return _minimumShadowOccluderVolume; }
|
float getMinimumShadowOccluderVolume() const { return _minimumShadowOccluderVolume; }
|
||||||
|
|
||||||
/** Sets the maximum number of occluders to have active for culling
|
/** Sets the maximum number of occluders to have active for culling
|
||||||
* purposes. */
|
* purposes. */
|
||||||
void setMaximumNumberOfActiveOccluders(unsigned int num) { _maximumNumberOfActiveOccluders = num; }
|
void setMaximumNumberOfActiveOccluders(unsigned int num) { _maximumNumberOfActiveOccluders = num; }
|
||||||
unsigned int getMaximumNumberOfActiveOccluders() const { return _maximumNumberOfActiveOccluders; }
|
unsigned int getMaximumNumberOfActiveOccluders() const { return _maximumNumberOfActiveOccluders; }
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class OSG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::
|
|||||||
const ShadowVolumeOccluderSet& getCollectedOccluderSet() const { return _occluderSet; }
|
const ShadowVolumeOccluderSet& getCollectedOccluderSet() const { return _occluderSet; }
|
||||||
|
|
||||||
/** Removes occluded occluders for the collected occluders list, then
|
/** Removes occluded occluders for the collected occluders list, then
|
||||||
* discards all but MaximumNumberOfActiveOccluders of occluders,
|
* discards all but MaximumNumberOfActiveOccluders of occluders,
|
||||||
* discarding the occluders with the lowests shadow occluder volume. */
|
* discarding the occluders with the lowests shadow occluder volume. */
|
||||||
void removeOccludedOccluders();
|
void removeOccludedOccluders();
|
||||||
|
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ class OSG_EXPORT ConvexPlanarOccluder : public Object
|
|||||||
|
|
||||||
void setHoleList(const HoleList& holeList) { _holeList=holeList; }
|
void setHoleList(const HoleList& holeList) { _holeList=holeList; }
|
||||||
|
|
||||||
HoleList& getHoleList() { return _holeList; }
|
HoleList& getHoleList() { return _holeList; }
|
||||||
|
|
||||||
const HoleList& getHoleList() const { return _holeList; }
|
const HoleList& getHoleList() const { return _holeList; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@@ -63,6 +63,6 @@ class OSG_EXPORT ConvexPlanarOccluder : public Object
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace
|
} // end of namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -48,6 +48,6 @@ class OSG_EXPORT ConvexPlanarPolygon
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace
|
} // end of namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -40,19 +40,19 @@ class OSG_EXPORT CopyOp
|
|||||||
|
|
||||||
enum Options
|
enum Options
|
||||||
{
|
{
|
||||||
SHALLOW_COPY = 0,
|
SHALLOW_COPY = 0,
|
||||||
DEEP_COPY_OBJECTS = 1,
|
DEEP_COPY_OBJECTS = 1,
|
||||||
DEEP_COPY_NODES = 2,
|
DEEP_COPY_NODES = 2,
|
||||||
DEEP_COPY_DRAWABLES = 4,
|
DEEP_COPY_DRAWABLES = 4,
|
||||||
DEEP_COPY_STATESETS = 8,
|
DEEP_COPY_STATESETS = 8,
|
||||||
DEEP_COPY_STATEATTRIBUTES = 16,
|
DEEP_COPY_STATEATTRIBUTES = 16,
|
||||||
DEEP_COPY_TEXTURES = 32,
|
DEEP_COPY_TEXTURES = 32,
|
||||||
DEEP_COPY_IMAGES = 64,
|
DEEP_COPY_IMAGES = 64,
|
||||||
DEEP_COPY_ARRAYS = 128,
|
DEEP_COPY_ARRAYS = 128,
|
||||||
DEEP_COPY_PRIMITIVES = 256,
|
DEEP_COPY_PRIMITIVES = 256,
|
||||||
DEEP_COPY_SHAPES = 512,
|
DEEP_COPY_SHAPES = 512,
|
||||||
DEEP_COPY_UNIFORMS = 1024,
|
DEEP_COPY_UNIFORMS = 1024,
|
||||||
DEEP_COPY_ALL = 0xffffffff
|
DEEP_COPY_ALL = 0xffffffff
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef unsigned int CopyFlags;
|
typedef unsigned int CopyFlags;
|
||||||
@@ -70,8 +70,8 @@ class OSG_EXPORT CopyOp
|
|||||||
virtual Image* operator() (const Image* image) const;
|
virtual Image* operator() (const Image* image) const;
|
||||||
virtual Array* operator() (const Array* array) const;
|
virtual Array* operator() (const Array* array) const;
|
||||||
virtual PrimitiveSet* operator() (const PrimitiveSet* primitives) const;
|
virtual PrimitiveSet* operator() (const PrimitiveSet* primitives) const;
|
||||||
virtual Shape* operator() (const Shape* shape) const;
|
virtual Shape* operator() (const Shape* shape) const;
|
||||||
virtual Uniform* operator() (const Uniform* shape) const;
|
virtual Uniform* operator() (const Uniform* shape) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -186,10 +186,10 @@ class OSG_EXPORT CullStack : public osg::CullSettings
|
|||||||
ref_ptr<osg::RefMatrix> _identity;
|
ref_ptr<osg::RefMatrix> _identity;
|
||||||
|
|
||||||
typedef std::vector< osg::ref_ptr<osg::RefMatrix> > MatrixList;
|
typedef std::vector< osg::ref_ptr<osg::RefMatrix> > MatrixList;
|
||||||
MatrixList _reuseMatrixList;
|
MatrixList _reuseMatrixList;
|
||||||
unsigned int _currentReuseMatrixIndex;
|
unsigned int _currentReuseMatrixIndex;
|
||||||
|
|
||||||
inline osg::RefMatrix* createOrReuseMatrix(const osg::Matrix& value);
|
inline osg::RefMatrix* createOrReuseMatrix(const osg::Matrix& value);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -286,6 +286,6 @@ inline RefMatrix* CullStack::createOrReuseMatrix(const osg::Matrix& value)
|
|||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace
|
} // end of namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -345,6 +345,6 @@ class OSG_EXPORT CullingSet : public Referenced
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace
|
} // end of namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -31,15 +31,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
|
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
|
||||||
# if defined( _LIB ) || defined( USE_STATIC )
|
# if defined( _LIB ) || defined( USE_STATIC )
|
||||||
# define OSG_EXPORT
|
# define OSG_EXPORT
|
||||||
# elif defined( OSG_LIBRARY )
|
# elif defined( OSG_LIBRARY )
|
||||||
# define OSG_EXPORT __declspec(dllexport)
|
# define OSG_EXPORT __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define OSG_EXPORT __declspec(dllimport)
|
# define OSG_EXPORT __declspec(dllimport)
|
||||||
# endif /* SG_LIBRARY */
|
# endif /* SG_LIBRARY */
|
||||||
#else
|
#else
|
||||||
# define OSG_EXPORT
|
# define OSG_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// set up define for whether member templates are supported by VisualStudio compilers.
|
// set up define for whether member templates are supported by VisualStudio compilers.
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
|
|||||||
std::string _fragmentProgram;
|
std::string _fragmentProgram;
|
||||||
|
|
||||||
LocalParamList _programLocalParameters;
|
LocalParamList _programLocalParameters;
|
||||||
MatrixList _matrixList;
|
MatrixList _matrixList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,13 +55,13 @@ inline void* getGLExtensionFuncPtr(const char *funcName)
|
|||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
|
|
||||||
std::string temp( "_" );
|
std::string temp( "_" );
|
||||||
temp += funcName; // Mac OS X prepends an underscore on function names
|
temp += funcName; // Mac OS X prepends an underscore on function names
|
||||||
if ( NSIsSymbolNameDefined( temp.c_str() ) )
|
if ( NSIsSymbolNameDefined( temp.c_str() ) )
|
||||||
{
|
{
|
||||||
NSSymbol symbol = NSLookupAndBindSymbol( temp.c_str() );
|
NSSymbol symbol = NSLookupAndBindSymbol( temp.c_str() );
|
||||||
return NSAddressOfSymbol( symbol );
|
return NSAddressOfSymbol( symbol );
|
||||||
} else
|
} else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#elif defined (__sun)
|
#elif defined (__sun)
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class OSG_EXPORT Group : public Node
|
|||||||
/** Get the index number of child, return a value between
|
/** Get the index number of child, return a value between
|
||||||
* 0 and _children.size()-1 if found, if not found then
|
* 0 and _children.size()-1 if found, if not found then
|
||||||
* return _children.size().
|
* return _children.size().
|
||||||
*/
|
*/
|
||||||
inline unsigned int getChildIndex( const Node* node ) const
|
inline unsigned int getChildIndex( const Node* node ) const
|
||||||
{
|
{
|
||||||
for (unsigned int childNum=0;childNum<_children.size();++childNum)
|
for (unsigned int childNum=0;childNum<_children.size();++childNum)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class OSG_EXPORT ImageStream : public Image
|
|||||||
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
|
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
|
||||||
virtual int compare(const Image& rhs) const;
|
virtual int compare(const Image& rhs) const;
|
||||||
|
|
||||||
enum StreamStatus
|
enum StreamStatus
|
||||||
{
|
{
|
||||||
INVALID,
|
INVALID,
|
||||||
PLAYING,
|
PLAYING,
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class OSG_EXPORT LineStipple : public StateAttribute
|
|||||||
virtual ~LineStipple();
|
virtual ~LineStipple();
|
||||||
|
|
||||||
GLint _factor;
|
GLint _factor;
|
||||||
GLushort _pattern;
|
GLushort _pattern;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -286,8 +286,8 @@ class OSG_EXPORT Matrixd
|
|||||||
inline Vec4d operator* ( const Vec4d& v ) const;
|
inline Vec4d operator* ( const Vec4d& v ) const;
|
||||||
|
|
||||||
void setTrans( value_type tx, value_type ty, value_type tz );
|
void setTrans( value_type tx, value_type ty, value_type tz );
|
||||||
void setTrans( const Vec3f& v );
|
void setTrans( const Vec3f& v );
|
||||||
void setTrans( const Vec3d& v );
|
void setTrans( const Vec3d& v );
|
||||||
|
|
||||||
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
|
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
|
||||||
|
|
||||||
@@ -616,42 +616,42 @@ inline Vec3d Matrixd::transform3x3(const Matrixd& m,const Vec3d& v)
|
|||||||
|
|
||||||
inline Vec3f operator* (const Vec3f& v, const Matrixd& m )
|
inline Vec3f operator* (const Vec3f& v, const Matrixd& m )
|
||||||
{
|
{
|
||||||
return m.preMult(v);
|
return m.preMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vec3d operator* (const Vec3d& v, const Matrixd& m )
|
inline Vec3d operator* (const Vec3d& v, const Matrixd& m )
|
||||||
{
|
{
|
||||||
return m.preMult(v);
|
return m.preMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vec4f operator* (const Vec4f& v, const Matrixd& m )
|
inline Vec4f operator* (const Vec4f& v, const Matrixd& m )
|
||||||
{
|
{
|
||||||
return m.preMult(v);
|
return m.preMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vec4d operator* (const Vec4d& v, const Matrixd& m )
|
inline Vec4d operator* (const Vec4d& v, const Matrixd& m )
|
||||||
{
|
{
|
||||||
return m.preMult(v);
|
return m.preMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vec3f Matrixd::operator* (const Vec3f& v) const
|
inline Vec3f Matrixd::operator* (const Vec3f& v) const
|
||||||
{
|
{
|
||||||
return postMult(v);
|
return postMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vec3d Matrixd::operator* (const Vec3d& v) const
|
inline Vec3d Matrixd::operator* (const Vec3d& v) const
|
||||||
{
|
{
|
||||||
return postMult(v);
|
return postMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vec4f Matrixd::operator* (const Vec4f& v) const
|
inline Vec4f Matrixd::operator* (const Vec4f& v) const
|
||||||
{
|
{
|
||||||
return postMult(v);
|
return postMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vec4d Matrixd::operator* (const Vec4d& v) const
|
inline Vec4d Matrixd::operator* (const Vec4d& v) const
|
||||||
{
|
{
|
||||||
return postMult(v);
|
return postMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ class OSG_EXPORT Matrixf
|
|||||||
void orthoNormalize(const Matrixf& rhs);
|
void orthoNormalize(const Matrixf& rhs);
|
||||||
|
|
||||||
//basic utility functions to create new matrices
|
//basic utility functions to create new matrices
|
||||||
inline static Matrixf identity( void );
|
inline static Matrixf identity( void );
|
||||||
inline static Matrixf scale( const Vec3f& sv);
|
inline static Matrixf scale( const Vec3f& sv);
|
||||||
inline static Matrixf scale( const Vec3d& sv);
|
inline static Matrixf scale( const Vec3d& sv);
|
||||||
inline static Matrixf scale( value_type sx, value_type sy, value_type sz);
|
inline static Matrixf scale( value_type sx, value_type sy, value_type sz);
|
||||||
@@ -287,8 +287,8 @@ class OSG_EXPORT Matrixf
|
|||||||
inline Vec4d operator* ( const Vec4d& v ) const;
|
inline Vec4d operator* ( const Vec4d& v ) const;
|
||||||
|
|
||||||
void setTrans( value_type tx, value_type ty, value_type tz );
|
void setTrans( value_type tx, value_type ty, value_type tz );
|
||||||
void setTrans( const Vec3f& v );
|
void setTrans( const Vec3f& v );
|
||||||
void setTrans( const Vec3d& v );
|
void setTrans( const Vec3d& v );
|
||||||
|
|
||||||
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
|
inline Vec3d getTrans() const { return Vec3d(_mat[3][0],_mat[3][1],_mat[3][2]); }
|
||||||
|
|
||||||
@@ -325,11 +325,11 @@ class OSG_EXPORT Matrixf
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline Matrixf operator * ( const Matrixf &m ) const
|
inline Matrixf operator * ( const Matrixf &m ) const
|
||||||
{
|
{
|
||||||
osg::Matrixf r;
|
osg::Matrixf r;
|
||||||
r.mult(*this,m);
|
r.mult(*this,m);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
value_type _mat[4][4];
|
value_type _mat[4][4];
|
||||||
@@ -610,36 +610,36 @@ inline Vec3d Matrixf::transform3x3(const Matrixf& m,const Vec3d& v)
|
|||||||
|
|
||||||
inline Vec3f operator* (const Vec3f& v, const Matrixf& m )
|
inline Vec3f operator* (const Vec3f& v, const Matrixf& m )
|
||||||
{
|
{
|
||||||
return m.preMult(v);
|
return m.preMult(v);
|
||||||
}
|
}
|
||||||
inline Vec3d operator* (const Vec3d& v, const Matrixf& m )
|
inline Vec3d operator* (const Vec3d& v, const Matrixf& m )
|
||||||
{
|
{
|
||||||
return m.preMult(v);
|
return m.preMult(v);
|
||||||
}
|
}
|
||||||
inline Vec4f operator* (const Vec4f& v, const Matrixf& m )
|
inline Vec4f operator* (const Vec4f& v, const Matrixf& m )
|
||||||
{
|
{
|
||||||
return m.preMult(v);
|
return m.preMult(v);
|
||||||
}
|
}
|
||||||
inline Vec4d operator* (const Vec4d& v, const Matrixf& m )
|
inline Vec4d operator* (const Vec4d& v, const Matrixf& m )
|
||||||
{
|
{
|
||||||
return m.preMult(v);
|
return m.preMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vec3f Matrixf::operator* (const Vec3f& v) const
|
inline Vec3f Matrixf::operator* (const Vec3f& v) const
|
||||||
{
|
{
|
||||||
return postMult(v);
|
return postMult(v);
|
||||||
}
|
}
|
||||||
inline Vec3d Matrixf::operator* (const Vec3d& v) const
|
inline Vec3d Matrixf::operator* (const Vec3d& v) const
|
||||||
{
|
{
|
||||||
return postMult(v);
|
return postMult(v);
|
||||||
}
|
}
|
||||||
inline Vec4f Matrixf::operator* (const Vec4f& v) const
|
inline Vec4f Matrixf::operator* (const Vec4f& v) const
|
||||||
{
|
{
|
||||||
return postMult(v);
|
return postMult(v);
|
||||||
}
|
}
|
||||||
inline Vec4d Matrixf::operator* (const Vec4d& v) const
|
inline Vec4d Matrixf::operator* (const Vec4d& v) const
|
||||||
{
|
{
|
||||||
return postMult(v);
|
return postMult(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,17 +28,17 @@ namespace osg {
|
|||||||
class OSG_EXPORT PointSprite : public osg::StateAttribute {
|
class OSG_EXPORT PointSprite : public osg::StateAttribute {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
PointSprite() {}
|
PointSprite() {}
|
||||||
|
|
||||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||||
PointSprite(const PointSprite& texenv,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
PointSprite(const PointSprite& texenv,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||||
StateAttribute(texenv,copyop) {}
|
StateAttribute(texenv,copyop) {}
|
||||||
|
|
||||||
|
|
||||||
META_StateAttribute(osg, PointSprite, POINTSPRITE);
|
META_StateAttribute(osg, PointSprite, POINTSPRITE);
|
||||||
|
|
||||||
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
|
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
|
||||||
virtual int compare(const StateAttribute& sa) const;
|
virtual int compare(const StateAttribute& sa) const;
|
||||||
|
|
||||||
virtual bool getModeUsage(ModeUsage& usage) const
|
virtual bool getModeUsage(ModeUsage& usage) const
|
||||||
{
|
{
|
||||||
@@ -46,14 +46,14 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool isTextureAttribute() const { return true; }
|
virtual bool isTextureAttribute() const { return true; }
|
||||||
|
|
||||||
virtual void apply(osg::State& state) const;
|
virtual void apply(osg::State& state) const;
|
||||||
|
|
||||||
static bool isPointSpriteSupported(unsigned int context);
|
static bool isPointSpriteSupported(unsigned int context);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~PointSprite( void ) {}
|
virtual ~PointSprite( void ) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,6 +384,6 @@ class OSG_EXPORT Polytope
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace
|
} // end of namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -172,13 +172,13 @@ inline void Referenced::unref() const
|
|||||||
*/
|
*/
|
||||||
class OSG_EXPORT Referenced : public NoodleGlue::CBridgable
|
class OSG_EXPORT Referenced : public NoodleGlue::CBridgable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** Method not used in NoodleGlue referencing
|
/** Method not used in NoodleGlue referencing
|
||||||
*/
|
*/
|
||||||
inline void unref_nodelete() const { --_refCount; }
|
inline void unref_nodelete() const { --_refCount; }
|
||||||
inline int referenceCount() const { return _refCount; }
|
inline int referenceCount() const { return _refCount; }
|
||||||
protected:
|
protected:
|
||||||
virtual ~Referenced() {}
|
virtual ~Referenced() {}
|
||||||
};
|
};
|
||||||
#endif //OSG_JAVA_BUILD
|
#endif //OSG_JAVA_BUILD
|
||||||
|
|
||||||
|
|||||||
@@ -167,6 +167,6 @@ inline void ShadowVolumeOccluder::popCurrentMask()
|
|||||||
//std::cout<<"ShadowVolumeOccluder::popCurrentMasks() - _occluderVolume.getMaskStack().size()="<<_occluderVolume.getMaskStack().size()<<" "<<_occluderVolume.getCurrentMask()<<std::endl;
|
//std::cout<<"ShadowVolumeOccluder::popCurrentMasks() - _occluderVolume.getMaskStack().size()="<<_occluderVolume.getMaskStack().size()<<" "<<_occluderVolume.getCurrentMask()<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace
|
} // end of namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -72,17 +72,17 @@ class OSG_EXPORT Shape : public Object
|
|||||||
/** return the name of the attribute's class type.*/
|
/** return the name of the attribute's class type.*/
|
||||||
virtual const char* className() const { return "Shape"; }
|
virtual const char* className() const { return "Shape"; }
|
||||||
|
|
||||||
/** accept a non const shape visitor which can be used on non const shape objects.
|
/** accept a non const shape visitor which can be used on non const shape objects.
|
||||||
Must be defined by derived classes.*/
|
Must be defined by derived classes.*/
|
||||||
virtual void accept(ShapeVisitor&)=0;
|
virtual void accept(ShapeVisitor&)=0;
|
||||||
|
|
||||||
/** accept a const shape visitor which can be used on const shape objects.
|
/** accept a const shape visitor which can be used on const shape objects.
|
||||||
Must be defined by derived classes.*/
|
Must be defined by derived classes.*/
|
||||||
virtual void accept(ConstShapeVisitor&) const =0;
|
virtual void accept(ConstShapeVisitor&) const =0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual ~Shape();
|
virtual ~Shape();
|
||||||
};
|
};
|
||||||
|
|
||||||
// forward declarations of Shape types.
|
// forward declarations of Shape types.
|
||||||
@@ -103,42 +103,42 @@ class ShapeVisitor
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ShapeVisitor() {}
|
ShapeVisitor() {}
|
||||||
virtual ~ShapeVisitor() {}
|
virtual ~ShapeVisitor() {}
|
||||||
|
|
||||||
virtual void apply(Sphere&) {}
|
virtual void apply(Sphere&) {}
|
||||||
virtual void apply(Box&) {}
|
virtual void apply(Box&) {}
|
||||||
virtual void apply(Cone&) {}
|
virtual void apply(Cone&) {}
|
||||||
virtual void apply(Cylinder&) {}
|
virtual void apply(Cylinder&) {}
|
||||||
virtual void apply(Capsule&) {}
|
virtual void apply(Capsule&) {}
|
||||||
virtual void apply(InfinitePlane&) {}
|
virtual void apply(InfinitePlane&) {}
|
||||||
|
|
||||||
virtual void apply(TriangleMesh&) {}
|
virtual void apply(TriangleMesh&) {}
|
||||||
virtual void apply(ConvexHull&) {}
|
virtual void apply(ConvexHull&) {}
|
||||||
virtual void apply(HeightField&) {}
|
virtual void apply(HeightField&) {}
|
||||||
|
|
||||||
virtual void apply(CompositeShape&) {}
|
virtual void apply(CompositeShape&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConstShapeVisitor
|
class ConstShapeVisitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ConstShapeVisitor() {}
|
ConstShapeVisitor() {}
|
||||||
virtual ~ConstShapeVisitor() {}
|
virtual ~ConstShapeVisitor() {}
|
||||||
|
|
||||||
virtual void apply(const Sphere&) {}
|
virtual void apply(const Sphere&) {}
|
||||||
virtual void apply(const Box&) {}
|
virtual void apply(const Box&) {}
|
||||||
virtual void apply(const Cone&) {}
|
virtual void apply(const Cone&) {}
|
||||||
virtual void apply(const Cylinder&) {}
|
virtual void apply(const Cylinder&) {}
|
||||||
virtual void apply(const Capsule&) {}
|
virtual void apply(const Capsule&) {}
|
||||||
virtual void apply(const InfinitePlane&) {}
|
virtual void apply(const InfinitePlane&) {}
|
||||||
|
|
||||||
virtual void apply(const TriangleMesh&) {}
|
virtual void apply(const TriangleMesh&) {}
|
||||||
virtual void apply(const ConvexHull&) {}
|
virtual void apply(const ConvexHull&) {}
|
||||||
virtual void apply(const HeightField&) {}
|
virtual void apply(const HeightField&) {}
|
||||||
|
|
||||||
virtual void apply(const CompositeShape&) {}
|
virtual void apply(const CompositeShape&) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Sphere : public Shape
|
class Sphere : public Shape
|
||||||
@@ -146,40 +146,40 @@ class Sphere : public Shape
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
Sphere():
|
Sphere():
|
||||||
_center(0.0f,0.0f,0.0f),
|
_center(0.0f,0.0f,0.0f),
|
||||||
_radius(1.0f) {}
|
_radius(1.0f) {}
|
||||||
|
|
||||||
Sphere(const osg::Vec3& center,float radius):
|
Sphere(const osg::Vec3& center,float radius):
|
||||||
_center(center),
|
_center(center),
|
||||||
_radius(radius) {}
|
_radius(radius) {}
|
||||||
|
|
||||||
Sphere(const Sphere& sphere,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
Sphere(const Sphere& sphere,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(sphere,copyop),
|
Shape(sphere,copyop),
|
||||||
_center(sphere._center),
|
_center(sphere._center),
|
||||||
_radius(sphere._radius) {}
|
_radius(sphere._radius) {}
|
||||||
|
|
||||||
META_Shape(osg, Sphere);
|
META_Shape(osg, Sphere);
|
||||||
|
|
||||||
inline bool valid() const { return _radius>=0.0f; }
|
inline bool valid() const { return _radius>=0.0f; }
|
||||||
|
|
||||||
inline void set(const Vec3& center,float radius)
|
inline void set(const Vec3& center,float radius)
|
||||||
{
|
{
|
||||||
_center = center;
|
_center = center;
|
||||||
_radius = radius;
|
_radius = radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setCenter(const Vec3& center) { _center = center; }
|
inline void setCenter(const Vec3& center) { _center = center; }
|
||||||
inline const Vec3& getCenter() const { return _center; }
|
inline const Vec3& getCenter() const { return _center; }
|
||||||
|
|
||||||
inline void setRadius(float radius) { _radius = radius; }
|
inline void setRadius(float radius) { _radius = radius; }
|
||||||
inline float getRadius() const { return _radius; }
|
inline float getRadius() const { return _radius; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual ~Sphere() {}
|
virtual ~Sphere() {}
|
||||||
|
|
||||||
Vec3 _center;
|
Vec3 _center;
|
||||||
float _radius;
|
float _radius;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -188,51 +188,51 @@ class Box : public Shape
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
Box():
|
Box():
|
||||||
_center(0.0f,0.0f,0.0f),
|
_center(0.0f,0.0f,0.0f),
|
||||||
_halfLengths(0.5f,0.5f,0.5f) {}
|
_halfLengths(0.5f,0.5f,0.5f) {}
|
||||||
|
|
||||||
Box(const osg::Vec3& center,float width):
|
Box(const osg::Vec3& center,float width):
|
||||||
_center(center),
|
_center(center),
|
||||||
_halfLengths(width*0.5f,width*0.5f,width*0.5f) {}
|
_halfLengths(width*0.5f,width*0.5f,width*0.5f) {}
|
||||||
|
|
||||||
Box(const osg::Vec3& center,float lengthX,float lengthY, float lengthZ):
|
Box(const osg::Vec3& center,float lengthX,float lengthY, float lengthZ):
|
||||||
_center(center),
|
_center(center),
|
||||||
_halfLengths(lengthX*0.5f,lengthY*0.5f,lengthZ*0.5f) {}
|
_halfLengths(lengthX*0.5f,lengthY*0.5f,lengthZ*0.5f) {}
|
||||||
|
|
||||||
Box(const Box& box,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
Box(const Box& box,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(box,copyop),
|
Shape(box,copyop),
|
||||||
_center(box._center),
|
_center(box._center),
|
||||||
_halfLengths(box._halfLengths),
|
_halfLengths(box._halfLengths),
|
||||||
_rotation(box._rotation) {}
|
_rotation(box._rotation) {}
|
||||||
|
|
||||||
META_Shape(osg, Box);
|
META_Shape(osg, Box);
|
||||||
|
|
||||||
inline bool valid() const { return _halfLengths.x()>=0.0f; }
|
inline bool valid() const { return _halfLengths.x()>=0.0f; }
|
||||||
|
|
||||||
inline void set(const Vec3& center,const Vec3& halfLengths)
|
inline void set(const Vec3& center,const Vec3& halfLengths)
|
||||||
{
|
{
|
||||||
_center = center;
|
_center = center;
|
||||||
_halfLengths = halfLengths;
|
_halfLengths = halfLengths;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setCenter(const Vec3& center) { _center = center; }
|
inline void setCenter(const Vec3& center) { _center = center; }
|
||||||
inline const Vec3& getCenter() const { return _center; }
|
inline const Vec3& getCenter() const { return _center; }
|
||||||
|
|
||||||
inline void setHalfLengths(const Vec3& halfLengths) { _halfLengths = halfLengths; }
|
inline void setHalfLengths(const Vec3& halfLengths) { _halfLengths = halfLengths; }
|
||||||
inline const Vec3& getHalfLengths() const { return _halfLengths; }
|
inline const Vec3& getHalfLengths() const { return _halfLengths; }
|
||||||
|
|
||||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||||
inline const Quat& getRotation() const { return _rotation; }
|
inline const Quat& getRotation() const { return _rotation; }
|
||||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||||
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual ~Box() {}
|
virtual ~Box() {}
|
||||||
|
|
||||||
Vec3 _center;
|
Vec3 _center;
|
||||||
Vec3 _halfLengths;
|
Vec3 _halfLengths;
|
||||||
Quat _rotation;
|
Quat _rotation;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -243,59 +243,59 @@ class Cone : public Shape
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
Cone():
|
Cone():
|
||||||
_center(0.0f,0.0f,0.0f),
|
_center(0.0f,0.0f,0.0f),
|
||||||
_radius(1.0f),
|
_radius(1.0f),
|
||||||
_height(1.0f) {}
|
_height(1.0f) {}
|
||||||
|
|
||||||
Cone(const osg::Vec3& center,float radius,float height):
|
Cone(const osg::Vec3& center,float radius,float height):
|
||||||
_center(center),
|
_center(center),
|
||||||
_radius(radius),
|
_radius(radius),
|
||||||
_height(height) {}
|
_height(height) {}
|
||||||
|
|
||||||
Cone(const Cone& cone,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
Cone(const Cone& cone,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(cone,copyop),
|
Shape(cone,copyop),
|
||||||
_center(cone._center),
|
_center(cone._center),
|
||||||
_radius(cone._radius),
|
_radius(cone._radius),
|
||||||
_height(cone._height),
|
_height(cone._height),
|
||||||
_rotation(cone._rotation) {}
|
_rotation(cone._rotation) {}
|
||||||
|
|
||||||
META_Shape(osg, Cone);
|
META_Shape(osg, Cone);
|
||||||
|
|
||||||
inline bool valid() const { return _radius>=0.0f; }
|
inline bool valid() const { return _radius>=0.0f; }
|
||||||
|
|
||||||
inline void set(const Vec3& center,float radius, float height)
|
inline void set(const Vec3& center,float radius, float height)
|
||||||
{
|
{
|
||||||
_center = center;
|
_center = center;
|
||||||
_radius = radius;
|
_radius = radius;
|
||||||
_height = height;
|
_height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setCenter(const Vec3& center) { _center = center; }
|
inline void setCenter(const Vec3& center) { _center = center; }
|
||||||
inline const Vec3& getCenter() const { return _center; }
|
inline const Vec3& getCenter() const { return _center; }
|
||||||
|
|
||||||
inline void setRadius(float radius) { _radius = radius; }
|
inline void setRadius(float radius) { _radius = radius; }
|
||||||
inline float getRadius() const { return _radius; }
|
inline float getRadius() const { return _radius; }
|
||||||
|
|
||||||
inline void setHeight(float height) { _height = height; }
|
inline void setHeight(float height) { _height = height; }
|
||||||
inline float getHeight() const { return _height; }
|
inline float getHeight() const { return _height; }
|
||||||
|
|
||||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||||
inline const Quat& getRotation() const { return _rotation; }
|
inline const Quat& getRotation() const { return _rotation; }
|
||||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||||
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||||
|
|
||||||
inline float getBaseOffsetFactor() const { return 0.25f; }
|
inline float getBaseOffsetFactor() const { return 0.25f; }
|
||||||
inline float getBaseOffset() const { return -getBaseOffsetFactor()*getHeight(); }
|
inline float getBaseOffset() const { return -getBaseOffsetFactor()*getHeight(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual ~Cone() {}
|
virtual ~Cone() {}
|
||||||
|
|
||||||
Vec3 _center;
|
Vec3 _center;
|
||||||
float _radius;
|
float _radius;
|
||||||
float _height;
|
float _height;
|
||||||
|
|
||||||
Quat _rotation;
|
Quat _rotation;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Cylinder : public Shape
|
class Cylinder : public Shape
|
||||||
@@ -303,56 +303,55 @@ class Cylinder : public Shape
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
Cylinder():
|
Cylinder():
|
||||||
_center(0.0f,0.0f,0.0f),
|
_center(0.0f,0.0f,0.0f),
|
||||||
_radius(1.0f),
|
_radius(1.0f),
|
||||||
_height(1.0f) {}
|
_height(1.0f) {}
|
||||||
|
|
||||||
Cylinder(const osg::Vec3& center,float radius,float height):
|
Cylinder(const osg::Vec3& center,float radius,float height):
|
||||||
_center(center),
|
_center(center),
|
||||||
_radius(radius),
|
_radius(radius),
|
||||||
_height(height) {}
|
_height(height) {}
|
||||||
|
|
||||||
Cylinder(const Cylinder& cylinder,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
Cylinder(const Cylinder& cylinder,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(cylinder,copyop),
|
Shape(cylinder,copyop),
|
||||||
_center(cylinder._center),
|
_center(cylinder._center),
|
||||||
_radius(cylinder._radius),
|
_radius(cylinder._radius),
|
||||||
_height(cylinder._height),
|
_height(cylinder._height),
|
||||||
_rotation(cylinder._rotation) {}
|
_rotation(cylinder._rotation) {}
|
||||||
|
|
||||||
META_Shape(osg, Cylinder);
|
META_Shape(osg, Cylinder);
|
||||||
|
|
||||||
inline bool valid() const { return _radius>=0.0f; }
|
inline bool valid() const { return _radius>=0.0f; }
|
||||||
|
|
||||||
inline void set(const Vec3& center,float radius, float height)
|
inline void set(const Vec3& center,float radius, float height)
|
||||||
{
|
{
|
||||||
_center = center;
|
_center = center;
|
||||||
_radius = radius;
|
_radius = radius;
|
||||||
_height = height;
|
_height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setCenter(const Vec3& center) { _center = center; }
|
inline void setCenter(const Vec3& center) { _center = center; }
|
||||||
inline const Vec3& getCenter() const { return _center; }
|
inline const Vec3& getCenter() const { return _center; }
|
||||||
|
|
||||||
inline void setRadius(float radius) { _radius = radius; }
|
inline void setRadius(float radius) { _radius = radius; }
|
||||||
inline float getRadius() const { return _radius; }
|
inline float getRadius() const { return _radius; }
|
||||||
|
|
||||||
inline void setHeight(float height) { _height = height; }
|
inline void setHeight(float height) { _height = height; }
|
||||||
inline float getHeight() const { return _height; }
|
inline float getHeight() const { return _height; }
|
||||||
|
|
||||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||||
inline const Quat& getRotation() const { return _rotation; }
|
inline const Quat& getRotation() const { return _rotation; }
|
||||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||||
bool zeroRotation() const { return _rotation.zeroRotation(); }
|
bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual ~Cylinder() {}
|
virtual ~Cylinder() {}
|
||||||
|
|
||||||
Vec3 _center;
|
Vec3 _center;
|
||||||
float _radius;
|
float _radius;
|
||||||
float _height;
|
float _height;
|
||||||
|
Quat _rotation;
|
||||||
Quat _rotation;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Capsule : public Shape
|
class Capsule : public Shape
|
||||||
@@ -360,68 +359,67 @@ class Capsule : public Shape
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
Capsule():
|
Capsule():
|
||||||
_center(0.0f,0.0f,0.0f),
|
_center(0.0f,0.0f,0.0f),
|
||||||
_radius(1.0f),
|
_radius(1.0f),
|
||||||
_height(1.0f) {}
|
_height(1.0f) {}
|
||||||
|
|
||||||
Capsule(const osg::Vec3& center,float radius,float height):
|
Capsule(const osg::Vec3& center,float radius,float height):
|
||||||
_center(center),
|
_center(center),
|
||||||
_radius(radius),
|
_radius(radius),
|
||||||
_height(height) {}
|
_height(height) {}
|
||||||
|
|
||||||
Capsule(const Capsule& capsule,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
Capsule(const Capsule& capsule,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(capsule,copyop),
|
Shape(capsule,copyop),
|
||||||
_center(capsule._center),
|
_center(capsule._center),
|
||||||
_radius(capsule._radius),
|
_radius(capsule._radius),
|
||||||
_height(capsule._height),
|
_height(capsule._height),
|
||||||
_rotation(capsule._rotation) {}
|
_rotation(capsule._rotation) {}
|
||||||
|
|
||||||
META_Shape(osg, Capsule);
|
META_Shape(osg, Capsule);
|
||||||
|
|
||||||
inline bool valid() const { return _radius>=0.0f; }
|
inline bool valid() const { return _radius>=0.0f; }
|
||||||
|
|
||||||
inline void set(const Vec3& center,float radius, float height)
|
inline void set(const Vec3& center,float radius, float height)
|
||||||
{
|
{
|
||||||
_center = center;
|
_center = center;
|
||||||
_radius = radius;
|
_radius = radius;
|
||||||
_height = height;
|
_height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setCenter(const Vec3& center) { _center = center; }
|
inline void setCenter(const Vec3& center) { _center = center; }
|
||||||
inline const Vec3& getCenter() const { return _center; }
|
inline const Vec3& getCenter() const { return _center; }
|
||||||
|
|
||||||
inline void setRadius(float radius) { _radius = radius; }
|
inline void setRadius(float radius) { _radius = radius; }
|
||||||
inline float getRadius() const { return _radius; }
|
inline float getRadius() const { return _radius; }
|
||||||
|
|
||||||
inline void setHeight(float height) { _height = height; }
|
inline void setHeight(float height) { _height = height; }
|
||||||
inline float getHeight() const { return _height; }
|
inline float getHeight() const { return _height; }
|
||||||
|
|
||||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||||
inline const Quat& getRotation() const { return _rotation; }
|
inline const Quat& getRotation() const { return _rotation; }
|
||||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||||
bool zeroRotation() const { return _rotation.zeroRotation(); }
|
bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual ~Capsule() {}
|
virtual ~Capsule() {}
|
||||||
|
|
||||||
Vec3 _center;
|
Vec3 _center;
|
||||||
float _radius;
|
float _radius;
|
||||||
float _height;
|
float _height;
|
||||||
|
Quat _rotation;
|
||||||
Quat _rotation;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfinitePlane : public Shape, public Plane
|
class InfinitePlane : public Shape, public Plane
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfinitePlane() {}
|
InfinitePlane() {}
|
||||||
|
|
||||||
InfinitePlane(const InfinitePlane& plane,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
InfinitePlane(const InfinitePlane& plane,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(plane,copyop),
|
Shape(plane,copyop),
|
||||||
Plane(plane) {}
|
Plane(plane) {}
|
||||||
|
|
||||||
META_Shape(osg, InfinitePlane);
|
META_Shape(osg, InfinitePlane);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@@ -432,31 +430,31 @@ class TriangleMesh : public Shape
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TriangleMesh() {}
|
TriangleMesh() {}
|
||||||
|
|
||||||
TriangleMesh(const TriangleMesh& mesh,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
TriangleMesh(const TriangleMesh& mesh,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(mesh,copyop),
|
Shape(mesh,copyop),
|
||||||
_vertices(mesh._vertices),
|
_vertices(mesh._vertices),
|
||||||
_indices(mesh._indices) {}
|
_indices(mesh._indices) {}
|
||||||
|
|
||||||
META_Shape(osg, TriangleMesh);
|
META_Shape(osg, TriangleMesh);
|
||||||
|
|
||||||
|
|
||||||
void setVertices(Vec3Array* vertices) { _vertices = vertices; }
|
void setVertices(Vec3Array* vertices) { _vertices = vertices; }
|
||||||
Vec3Array* getVertices() { return _vertices.get(); }
|
Vec3Array* getVertices() { return _vertices.get(); }
|
||||||
const Vec3Array* getVertices() const { return _vertices.get(); }
|
const Vec3Array* getVertices() const { return _vertices.get(); }
|
||||||
|
|
||||||
|
|
||||||
void setIndices(IndexArray* indices) { _indices = indices; }
|
void setIndices(IndexArray* indices) { _indices = indices; }
|
||||||
IndexArray* getIndices() { return _indices.get(); }
|
IndexArray* getIndices() { return _indices.get(); }
|
||||||
const IndexArray* getIndices() const { return _indices.get(); }
|
const IndexArray* getIndices() const { return _indices.get(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
~TriangleMesh() {}
|
~TriangleMesh() {}
|
||||||
|
|
||||||
ref_ptr<Vec3Array> _vertices;
|
ref_ptr<Vec3Array> _vertices;
|
||||||
ref_ptr<IndexArray> _indices;
|
ref_ptr<IndexArray> _indices;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -464,60 +462,59 @@ class ConvexHull : public TriangleMesh
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ConvexHull() {}
|
ConvexHull() {}
|
||||||
|
|
||||||
ConvexHull(const ConvexHull& hull,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
ConvexHull(const ConvexHull& hull,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
TriangleMesh(hull,copyop) {}
|
TriangleMesh(hull,copyop) {}
|
||||||
|
|
||||||
META_Shape(osg, TriangleMesh);
|
META_Shape(osg, TriangleMesh);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
~ConvexHull() {}
|
~ConvexHull() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class OSG_EXPORT HeightField : public Shape
|
class OSG_EXPORT HeightField : public Shape
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
HeightField():
|
HeightField():
|
||||||
_columns(0),
|
_columns(0),
|
||||||
_rows(0),
|
_rows(0),
|
||||||
_origin(0.0f,0.0f,0.0f),
|
_origin(0.0f,0.0f,0.0f),
|
||||||
_dx(1.0f),
|
_dx(1.0f),
|
||||||
_dy(1.0f),
|
_dy(1.0f),
|
||||||
_skirtHeight(0.0f),
|
_skirtHeight(0.0f),
|
||||||
_borderWidth(0) {}
|
_borderWidth(0) {}
|
||||||
|
|
||||||
HeightField(const HeightField& mesh,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
HeightField(const HeightField& mesh,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(mesh,copyop),
|
Shape(mesh,copyop),
|
||||||
_columns(mesh._columns),
|
_columns(mesh._columns),
|
||||||
_rows(mesh._rows),
|
_rows(mesh._rows),
|
||||||
_origin(mesh._origin),
|
_origin(mesh._origin),
|
||||||
_dx(mesh._dx),
|
_dx(mesh._dx),
|
||||||
_dy(mesh._dy),
|
_dy(mesh._dy),
|
||||||
_skirtHeight(mesh._skirtHeight),
|
_skirtHeight(mesh._skirtHeight),
|
||||||
_borderWidth(mesh._borderWidth),
|
_borderWidth(mesh._borderWidth),
|
||||||
_heights(mesh._heights) {}
|
_heights(mesh._heights) {}
|
||||||
|
|
||||||
META_Shape(osg, HeightField);
|
META_Shape(osg, HeightField);
|
||||||
|
|
||||||
typedef std::vector<float> HeightList;
|
typedef std::vector<float> HeightList;
|
||||||
|
|
||||||
void allocate(unsigned int numColumns,unsigned int numRows);
|
void allocate(unsigned int numColumns,unsigned int numRows);
|
||||||
|
|
||||||
inline unsigned int getNumColumns() const { return _columns; }
|
inline unsigned int getNumColumns() const { return _columns; }
|
||||||
inline unsigned int getNumRows() const { return _rows; }
|
inline unsigned int getNumRows() const { return _rows; }
|
||||||
|
|
||||||
inline void setOrigin(const osg::Vec3& origin) { _origin = origin; }
|
inline void setOrigin(const osg::Vec3& origin) { _origin = origin; }
|
||||||
inline const osg::Vec3& getOrigin() const { return _origin; }
|
inline const osg::Vec3& getOrigin() const { return _origin; }
|
||||||
|
|
||||||
inline void setXInterval(float dx) { _dx = dx; }
|
inline void setXInterval(float dx) { _dx = dx; }
|
||||||
inline float getXInterval() const { return _dx; }
|
inline float getXInterval() const { return _dx; }
|
||||||
|
|
||||||
inline void setYInterval(float dy) { _dy = dy; }
|
|
||||||
inline float getYInterval() const { return _dy; }
|
|
||||||
|
|
||||||
|
inline void setYInterval(float dy) { _dy = dy; }
|
||||||
|
inline float getYInterval() const { return _dy; }
|
||||||
|
|
||||||
/** Set the height of the skirt to render around the edge of HeightField.
|
/** Set the height of the skirt to render around the edge of HeightField.
|
||||||
* The skirt is used as a means of disguising edge boundaries between adjacent HeightField,
|
* The skirt is used as a means of disguising edge boundaries between adjacent HeightField,
|
||||||
@@ -535,31 +532,31 @@ class OSG_EXPORT HeightField : public Shape
|
|||||||
/** Get the width in number of cells in from the edge that the height field should be rendered from.*/
|
/** Get the width in number of cells in from the edge that the height field should be rendered from.*/
|
||||||
unsigned int getBorderWidth() const { return _borderWidth; }
|
unsigned int getBorderWidth() const { return _borderWidth; }
|
||||||
|
|
||||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||||
inline const Quat& getRotation() const { return _rotation; }
|
inline const Quat& getRotation() const { return _rotation; }
|
||||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||||
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||||
|
|
||||||
/* set a single height point in the height field */
|
/* set a single height point in the height field */
|
||||||
inline void setHeight(unsigned int c,unsigned int r,float value)
|
inline void setHeight(unsigned int c,unsigned int r,float value)
|
||||||
{
|
{
|
||||||
_heights[c+r*_columns] = value;
|
_heights[c+r*_columns] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get address of single height point in the height field, allows user to change. */
|
/* Get address of single height point in the height field, allows user to change. */
|
||||||
inline float& getHeight(unsigned int c,unsigned int r)
|
inline float& getHeight(unsigned int c,unsigned int r)
|
||||||
{
|
{
|
||||||
return _heights[c+r*_columns];
|
return _heights[c+r*_columns];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get value of single height point in the height field, not editable. */
|
/* Get value of single height point in the height field, not editable. */
|
||||||
inline float getHeight(unsigned int c,unsigned int r) const
|
inline float getHeight(unsigned int c,unsigned int r) const
|
||||||
{
|
{
|
||||||
return _heights[c+r*_columns];
|
return _heights[c+r*_columns];
|
||||||
}
|
}
|
||||||
|
|
||||||
HeightList& getHeightList() { return _heights; }
|
HeightList& getHeightList() { return _heights; }
|
||||||
const HeightList& getHeightList() const { return _heights; }
|
const HeightList& getHeightList() const { return _heights; }
|
||||||
|
|
||||||
inline Vec3 getVertex(unsigned int c,unsigned int r) const
|
inline Vec3 getVertex(unsigned int c,unsigned int r) const
|
||||||
{
|
{
|
||||||
@@ -574,19 +571,19 @@ class OSG_EXPORT HeightField : public Shape
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual ~HeightField();
|
virtual ~HeightField();
|
||||||
|
|
||||||
unsigned int _columns,_rows;
|
unsigned int _columns,_rows;
|
||||||
|
|
||||||
osg::Vec3 _origin;
|
osg::Vec3 _origin;
|
||||||
float _dx;
|
float _dx;
|
||||||
float _dy;
|
float _dy;
|
||||||
|
|
||||||
float _skirtHeight;
|
float _skirtHeight;
|
||||||
unsigned int _borderWidth;
|
unsigned int _borderWidth;
|
||||||
|
|
||||||
Quat _rotation;
|
Quat _rotation;
|
||||||
HeightList _heights;
|
HeightList _heights;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -599,43 +596,43 @@ class CompositeShape : public Shape
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef std::vector< ref_ptr<Shape> > ChildList;
|
typedef std::vector< ref_ptr<Shape> > ChildList;
|
||||||
|
|
||||||
CompositeShape() {}
|
CompositeShape() {}
|
||||||
|
|
||||||
CompositeShape(const CompositeShape& cs,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
CompositeShape(const CompositeShape& cs,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||||
Shape(cs,copyop),
|
Shape(cs,copyop),
|
||||||
_children(cs._children) {}
|
_children(cs._children) {}
|
||||||
|
|
||||||
META_Shape(osg, CompositeShape);
|
META_Shape(osg, CompositeShape);
|
||||||
|
|
||||||
/** Set the shape that encloses all of the children.*/
|
/** Set the shape that encloses all of the children.*/
|
||||||
void setShape(Shape* shape) { _shape = shape; }
|
void setShape(Shape* shape) { _shape = shape; }
|
||||||
|
|
||||||
/** Get the shape that encloses all of the children.*/
|
/** Get the shape that encloses all of the children.*/
|
||||||
Shape* getShape() { return _shape.get(); }
|
Shape* getShape() { return _shape.get(); }
|
||||||
|
|
||||||
/** Get the const shape that encloses all of the children.*/
|
/** Get the const shape that encloses all of the children.*/
|
||||||
const Shape* getShape() const { return _shape.get(); }
|
const Shape* getShape() const { return _shape.get(); }
|
||||||
|
|
||||||
/** Get the number of children of this composite shape.*/
|
/** Get the number of children of this composite shape.*/
|
||||||
unsigned int getNumChildren() const { return _children.size(); }
|
unsigned int getNumChildren() const { return _children.size(); }
|
||||||
|
|
||||||
/** Get a child.*/
|
/** Get a child.*/
|
||||||
Shape* getChild(unsigned int i) { return _children[i].get(); }
|
Shape* getChild(unsigned int i) { return _children[i].get(); }
|
||||||
|
|
||||||
/** Get a const child.*/
|
/** Get a const child.*/
|
||||||
const Shape* getChild(unsigned int i) const { return _children[i].get(); }
|
const Shape* getChild(unsigned int i) const { return _children[i].get(); }
|
||||||
|
|
||||||
/** Add a child to the list.*/
|
/** Add a child to the list.*/
|
||||||
void addChild(Shape* shape) { _children.push_back(shape); }
|
void addChild(Shape* shape) { _children.push_back(shape); }
|
||||||
|
|
||||||
/** remove a child from the list.*/
|
/** remove a child from the list.*/
|
||||||
void removeChild(unsigned int i) { _children.erase(_children.begin()+i); }
|
void removeChild(unsigned int i) { _children.erase(_children.begin()+i); }
|
||||||
|
|
||||||
/** find the index number of child, if child is not found then it returns getNumChildren(),
|
/** find the index number of child, if child is not found then it returns getNumChildren(),
|
||||||
* so should be used in similar style to STL's result!=end().*/
|
* so should be used in similar style to STL's result!=end().*/
|
||||||
unsigned int findChildNo(Shape* shape) const
|
unsigned int findChildNo(Shape* shape) const
|
||||||
{
|
{
|
||||||
for (unsigned int childNo=0;childNo<_children.size();++childNo)
|
for (unsigned int childNo=0;childNo<_children.size();++childNo)
|
||||||
{
|
{
|
||||||
@@ -647,10 +644,10 @@ class CompositeShape : public Shape
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
~CompositeShape() {}
|
~CompositeShape() {}
|
||||||
|
|
||||||
ref_ptr<Shape> _shape;
|
ref_ptr<Shape> _shape;
|
||||||
ChildList _children;
|
ChildList _children;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ class OSG_EXPORT Texture1D : public Texture
|
|||||||
|
|
||||||
/** It's not ideal that _image is mutable, but it's required since
|
/** It's not ideal that _image is mutable, but it's required since
|
||||||
* Image::ensureDimensionsArePowerOfTwo() can only be called in a
|
* Image::ensureDimensionsArePowerOfTwo() can only be called in a
|
||||||
* valid OpenGL context, and therefore within Texture::apply, which
|
* valid OpenGL context, and therefore within Texture::apply, which
|
||||||
* is const. */
|
* is const. */
|
||||||
mutable ref_ptr<Image> _image;
|
mutable ref_ptr<Image> _image;
|
||||||
|
|
||||||
/** Subloaded images can have different texture and image sizes. */
|
/** Subloaded images can have different texture and image sizes. */
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ class OSG_EXPORT Texture2D : public Texture
|
|||||||
|
|
||||||
/** It's not ideal that _image is mutable, but it's required since
|
/** It's not ideal that _image is mutable, but it's required since
|
||||||
* Image::ensureDimensionsArePowerOfTwo() can only be called in a
|
* Image::ensureDimensionsArePowerOfTwo() can only be called in a
|
||||||
* valid OpenGL context, and therefore within Texture::apply, which
|
* valid OpenGL context, and therefore within Texture::apply, which
|
||||||
* is const. */
|
* is const. */
|
||||||
ref_ptr<Image> _image;
|
ref_ptr<Image> _image;
|
||||||
|
|
||||||
/** Subloaded images can have different texture and image sizes. */
|
/** Subloaded images can have different texture and image sizes. */
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class OSG_EXPORT Transform : public Group
|
|||||||
* deep in the scene graph. It is therefore recommended to only use
|
* deep in the scene graph. It is therefore recommended to only use
|
||||||
* absolute Transforms at the top of the scene, for such things as
|
* absolute Transforms at the top of the scene, for such things as
|
||||||
* heads up displays.
|
* heads up displays.
|
||||||
*/
|
*/
|
||||||
void setReferenceFrame(ReferenceFrame rf);
|
void setReferenceFrame(ReferenceFrame rf);
|
||||||
|
|
||||||
ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
|
ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
|
||||||
@@ -139,7 +139,7 @@ class OSG_EXPORT Transform : public Group
|
|||||||
* There is no need to override in subclasses from osg::Transform
|
* There is no need to override in subclasses from osg::Transform
|
||||||
* since this computeBound() uses the underlying matrix (calling
|
* since this computeBound() uses the underlying matrix (calling
|
||||||
* computeMatrix if required).
|
* computeMatrix if required).
|
||||||
*/
|
*/
|
||||||
virtual BoundingSphere computeBound() const;
|
virtual BoundingSphere computeBound() const;
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ public:
|
|||||||
const Vec3* vptr = &_vertexArrayPtr[first];
|
const Vec3* vptr = &_vertexArrayPtr[first];
|
||||||
for(GLsizei i=2;i<count;++i,++vptr)
|
for(GLsizei i=2;i<count;++i,++vptr)
|
||||||
{
|
{
|
||||||
if ((i%2)) this->operator()(*(vptr),*(vptr+2),*(vptr+1),_treatVertexDataAsTemporary);
|
if ((i%2)) this->operator()(*(vptr),*(vptr+2),*(vptr+1),_treatVertexDataAsTemporary);
|
||||||
else this->operator()(*(vptr),*(vptr+1),*(vptr+2),_treatVertexDataAsTemporary);
|
else this->operator()(*(vptr),*(vptr+1),*(vptr+2),_treatVertexDataAsTemporary);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -138,8 +138,8 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=2;i<count;++i,++iptr)
|
for(GLsizei i=2;i<count;++i,++iptr)
|
||||||
{
|
{
|
||||||
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
|
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
|
||||||
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
|
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -207,8 +207,8 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=2;i<count;++i,++iptr)
|
for(GLsizei i=2;i<count;++i,++iptr)
|
||||||
{
|
{
|
||||||
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
|
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
|
||||||
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
|
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -274,8 +274,8 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=2;i<count;++i,++iptr)
|
for(GLsizei i=2;i<count;++i,++iptr)
|
||||||
{
|
{
|
||||||
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
|
if ((i%2)) this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+2)],_vertexArrayPtr[*(iptr+1)],_treatVertexDataAsTemporary);
|
||||||
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
|
else this->operator()(_vertexArrayPtr[*(iptr)],_vertexArrayPtr[*(iptr+1)],_vertexArrayPtr[*(iptr+2)],_treatVertexDataAsTemporary);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -328,7 +328,7 @@ public:
|
|||||||
* non vertex array primitives to vertex array based primitives.
|
* non vertex array primitives to vertex array based primitives.
|
||||||
* This is done to simplify the implementation of primtive functor
|
* This is done to simplify the implementation of primtive functor
|
||||||
* subclasses - users only need override drawArray and drawElements.
|
* subclasses - users only need override drawArray and drawElements.
|
||||||
*/
|
*/
|
||||||
virtual void begin(GLenum mode)
|
virtual void begin(GLenum mode)
|
||||||
{
|
{
|
||||||
_modeCache = mode;
|
_modeCache = mode;
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ public:
|
|||||||
unsigned int pos=first;
|
unsigned int pos=first;
|
||||||
for(GLsizei i=2;i<count;++i,++pos)
|
for(GLsizei i=2;i<count;++i,++pos)
|
||||||
{
|
{
|
||||||
if ((i%2)) this->operator()(pos,pos+2,pos+1);
|
if ((i%2)) this->operator()(pos,pos+2,pos+1);
|
||||||
else this->operator()(pos,pos+1,pos+2);
|
else this->operator()(pos,pos+1,pos+2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -139,8 +139,8 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=2;i<count;++i,++iptr)
|
for(GLsizei i=2;i<count;++i,++iptr)
|
||||||
{
|
{
|
||||||
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
|
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
|
||||||
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
|
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -206,8 +206,8 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=2;i<count;++i,++iptr)
|
for(GLsizei i=2;i<count;++i,++iptr)
|
||||||
{
|
{
|
||||||
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
|
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
|
||||||
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
|
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -273,8 +273,8 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=2;i<count;++i,++iptr)
|
for(GLsizei i=2;i<count;++i,++iptr)
|
||||||
{
|
{
|
||||||
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
|
if ((i%2)) this->operator()(*(iptr),*(iptr+2),*(iptr+1));
|
||||||
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
|
else this->operator()(*(iptr),*(iptr+1),*(iptr+2));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ namespace osg {
|
|||||||
typedef UByte4 Vec4ub;
|
typedef UByte4 Vec4ub;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // end of namespace osg
|
} // end of namespace osg
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class Vec2b
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Methods are defined here so that they are implicitly inlined
|
// Methods are defined here so that they are implicitly inlined
|
||||||
|
|
||||||
/** Type of Vec class.*/
|
/** Type of Vec class.*/
|
||||||
typedef char value_type;
|
typedef char value_type;
|
||||||
@@ -123,7 +123,7 @@ class Vec2b
|
|||||||
|
|
||||||
/** Unary vector add. Slightly more efficient because no temporary
|
/** Unary vector add. Slightly more efficient because no temporary
|
||||||
* intermediate object.
|
* intermediate object.
|
||||||
*/
|
*/
|
||||||
inline Vec2b& operator += (const Vec2b& rhs)
|
inline Vec2b& operator += (const Vec2b& rhs)
|
||||||
{
|
{
|
||||||
_v[0] += rhs._v[0];
|
_v[0] += rhs._v[0];
|
||||||
@@ -145,10 +145,10 @@ class Vec2b
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end of class Vec2b
|
}; // end of class Vec2b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end of namespace osg
|
} // end of namespace osg
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class Vec2d
|
|||||||
|
|
||||||
inline bool operator != (const Vec2d& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1]; }
|
inline bool operator != (const Vec2d& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1]; }
|
||||||
|
|
||||||
inline bool operator < (const Vec2d& v) const
|
inline bool operator < (const Vec2d& v) const
|
||||||
{
|
{
|
||||||
if (_v[0]<v._v[0]) return true;
|
if (_v[0]<v._v[0]) return true;
|
||||||
else if (_v[0]>v._v[0]) return false;
|
else if (_v[0]>v._v[0]) return false;
|
||||||
@@ -91,8 +91,8 @@ class Vec2d
|
|||||||
inline Vec2d& operator *= (value_type rhs)
|
inline Vec2d& operator *= (value_type rhs)
|
||||||
{
|
{
|
||||||
_v[0]*=rhs;
|
_v[0]*=rhs;
|
||||||
_v[1]*=rhs;
|
_v[1]*=rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Divide by scalar. */
|
/** Divide by scalar. */
|
||||||
@@ -105,8 +105,8 @@ class Vec2d
|
|||||||
inline Vec2d& operator /= (value_type rhs)
|
inline Vec2d& operator /= (value_type rhs)
|
||||||
{
|
{
|
||||||
_v[0]/=rhs;
|
_v[0]/=rhs;
|
||||||
_v[1]/=rhs;
|
_v[1]/=rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Binary vector add. */
|
/** Binary vector add. */
|
||||||
@@ -117,12 +117,12 @@ class Vec2d
|
|||||||
|
|
||||||
/** Unary vector add. Slightly more efficient because no temporary
|
/** Unary vector add. Slightly more efficient because no temporary
|
||||||
* intermediate object.
|
* intermediate object.
|
||||||
*/
|
*/
|
||||||
inline Vec2d& operator += (const Vec2d& rhs)
|
inline Vec2d& operator += (const Vec2d& rhs)
|
||||||
{
|
{
|
||||||
_v[0] += rhs._v[0];
|
_v[0] += rhs._v[0];
|
||||||
_v[1] += rhs._v[1];
|
_v[1] += rhs._v[1];
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Binary vector subtract. */
|
/** Binary vector subtract. */
|
||||||
@@ -136,20 +136,20 @@ class Vec2d
|
|||||||
{
|
{
|
||||||
_v[0]-=rhs._v[0];
|
_v[0]-=rhs._v[0];
|
||||||
_v[1]-=rhs._v[1];
|
_v[1]-=rhs._v[1];
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Negation operator. Returns the negative of the Vec2d. */
|
/** Negation operator. Returns the negative of the Vec2d. */
|
||||||
inline const Vec2d operator - () const
|
inline const Vec2d operator - () const
|
||||||
{
|
{
|
||||||
return Vec2d (-_v[0], -_v[1]);
|
return Vec2d (-_v[0], -_v[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Length of the vector = sqrt( vec . vec ) */
|
/** Length of the vector = sqrt( vec . vec ) */
|
||||||
inline value_type length() const
|
inline value_type length() const
|
||||||
{
|
{
|
||||||
return sqrt( _v[0]*_v[0] + _v[1]*_v[1] );
|
return sqrt( _v[0]*_v[0] + _v[1]*_v[1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Length squared of the vector = vec . vec */
|
/** Length squared of the vector = vec . vec */
|
||||||
inline value_type length2( void ) const
|
inline value_type length2( void ) const
|
||||||
@@ -159,20 +159,20 @@ class Vec2d
|
|||||||
|
|
||||||
/** Normalize the vector so that it has length unity.
|
/** Normalize the vector so that it has length unity.
|
||||||
* Returns the previous length of the vector.
|
* Returns the previous length of the vector.
|
||||||
*/
|
*/
|
||||||
inline value_type normalize()
|
inline value_type normalize()
|
||||||
{
|
{
|
||||||
value_type norm = Vec2d::length();
|
value_type norm = Vec2d::length();
|
||||||
if (norm>0.0)
|
if (norm>0.0)
|
||||||
{
|
{
|
||||||
value_type inv = 1.0/norm;
|
value_type inv = 1.0/norm;
|
||||||
_v[0] *= inv;
|
_v[0] *= inv;
|
||||||
_v[1] *= inv;
|
_v[1] *= inv;
|
||||||
}
|
}
|
||||||
return( norm );
|
return( norm );
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end of class Vec2d
|
}; // end of class Vec2d
|
||||||
|
|
||||||
} // end of namespace osg
|
} // end of namespace osg
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OSG_VEC2S
|
#ifndef OSG_VEC2S
|
||||||
#define OSG_VEC2S 1
|
#define OSG_VEC2S 1
|
||||||
|
|
||||||
namespace osg {
|
namespace osg {
|
||||||
|
|
||||||
|
|||||||
@@ -121,12 +121,12 @@ class Vec3b
|
|||||||
inline Vec3b operator + (const Vec3b& rhs) const
|
inline Vec3b operator + (const Vec3b& rhs) const
|
||||||
{
|
{
|
||||||
return Vec3b(_v[0]+rhs._v[0], _v[1]+rhs._v[1],
|
return Vec3b(_v[0]+rhs._v[0], _v[1]+rhs._v[1],
|
||||||
_v[2]+rhs._v[2]);
|
_v[2]+rhs._v[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Unary vector add. Slightly more efficient because no temporary
|
/** Unary vector add. Slightly more efficient because no temporary
|
||||||
* intermediate object.
|
* intermediate object.
|
||||||
*/
|
*/
|
||||||
inline Vec3b& operator += (const Vec3b& rhs)
|
inline Vec3b& operator += (const Vec3b& rhs)
|
||||||
{
|
{
|
||||||
_v[0] += rhs._v[0];
|
_v[0] += rhs._v[0];
|
||||||
@@ -139,7 +139,7 @@ class Vec3b
|
|||||||
inline Vec3b operator - (const Vec3b& rhs) const
|
inline Vec3b operator - (const Vec3b& rhs) const
|
||||||
{
|
{
|
||||||
return Vec3b(_v[0]-rhs._v[0], _v[1]-rhs._v[1],
|
return Vec3b(_v[0]-rhs._v[0], _v[1]-rhs._v[1],
|
||||||
_v[2]-rhs._v[2]);
|
_v[2]-rhs._v[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Unary vector subtract. */
|
/** Unary vector subtract. */
|
||||||
@@ -151,10 +151,10 @@ class Vec3b
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end of class Vec3b
|
}; // end of class Vec3b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end of namespace osg
|
} // end of namespace osg
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OSG_VEC3S
|
#ifndef OSG_VEC3S
|
||||||
#define OSG_VEC3S 1
|
#define OSG_VEC3S 1
|
||||||
|
|
||||||
namespace osg {
|
namespace osg {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OSG_VEC4S
|
#ifndef OSG_VEC4S
|
||||||
#define OSG_VEC4S 1
|
#define OSG_VEC4S 1
|
||||||
|
|
||||||
namespace osg {
|
namespace osg {
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ class Vec4s
|
|||||||
else return (_v[3]<v._v[3]);
|
else return (_v[3]<v._v[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline value_type* ptr() { return _v; }
|
inline value_type* ptr() { return _v; }
|
||||||
inline const value_type* ptr() const { return _v; }
|
inline const value_type* ptr() const { return _v; }
|
||||||
|
|
||||||
inline void set( value_type x, value_type y, value_type z, value_type w)
|
inline void set( value_type x, value_type y, value_type z, value_type w)
|
||||||
|
|||||||
@@ -121,12 +121,12 @@ class Vec4ub
|
|||||||
inline Vec4ub operator + (const Vec4ub& rhs) const
|
inline Vec4ub operator + (const Vec4ub& rhs) const
|
||||||
{
|
{
|
||||||
return Vec4ub(_v[0]+rhs._v[0], _v[1]+rhs._v[1],
|
return Vec4ub(_v[0]+rhs._v[0], _v[1]+rhs._v[1],
|
||||||
_v[2]+rhs._v[2], _v[3]+rhs._v[3]);
|
_v[2]+rhs._v[2], _v[3]+rhs._v[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Unary vector add. Slightly more efficient because no temporary
|
/** Unary vector add. Slightly more efficient because no temporary
|
||||||
* intermediate object.
|
* intermediate object.
|
||||||
*/
|
*/
|
||||||
inline Vec4ub& operator += (const Vec4ub& rhs)
|
inline Vec4ub& operator += (const Vec4ub& rhs)
|
||||||
{
|
{
|
||||||
_v[0] += rhs._v[0];
|
_v[0] += rhs._v[0];
|
||||||
@@ -140,7 +140,7 @@ class Vec4ub
|
|||||||
inline Vec4ub operator - (const Vec4ub& rhs) const
|
inline Vec4ub operator - (const Vec4ub& rhs) const
|
||||||
{
|
{
|
||||||
return Vec4ub(_v[0]-rhs._v[0], _v[1]-rhs._v[1],
|
return Vec4ub(_v[0]-rhs._v[0], _v[1]-rhs._v[1],
|
||||||
_v[2]-rhs._v[2], _v[3]-rhs._v[3] );
|
_v[2]-rhs._v[2], _v[3]-rhs._v[3] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Unary vector subtract. */
|
/** Unary vector subtract. */
|
||||||
@@ -153,8 +153,8 @@ class Vec4ub
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end of class Vec4ub
|
}; // end of class Vec4ub
|
||||||
|
|
||||||
} // end of namespace osg
|
} // end of namespace osg
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec2b& vec)
|
|||||||
{
|
{
|
||||||
output << (int)vec._v[0] << " "
|
output << (int)vec._v[0] << " "
|
||||||
<< (int)vec._v[1];
|
<< (int)vec._v[1];
|
||||||
return output; // to enable cascading
|
return output; // to enable cascading
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec2b& vec)
|
inline std::istream& operator >> (std::istream& input, Vec2b& vec)
|
||||||
@@ -152,7 +152,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec3b& vec)
|
|||||||
output << (int)vec._v[0] << " "
|
output << (int)vec._v[0] << " "
|
||||||
<< (int)vec._v[1] << " "
|
<< (int)vec._v[1] << " "
|
||||||
<< (int)vec._v[2];
|
<< (int)vec._v[2];
|
||||||
return output; // to enable cascading
|
return output; // to enable cascading
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec3b& vec)
|
inline std::istream& operator >> (std::istream& input, Vec3b& vec)
|
||||||
@@ -169,7 +169,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec4b& vec)
|
|||||||
<< (int)vec._v[1] << " "
|
<< (int)vec._v[1] << " "
|
||||||
<< (int)vec._v[2] << " "
|
<< (int)vec._v[2] << " "
|
||||||
<< (int)vec._v[3];
|
<< (int)vec._v[3];
|
||||||
return output; // to enable cascading
|
return output; // to enable cascading
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec4b& vec)
|
inline std::istream& operator >> (std::istream& input, Vec4b& vec)
|
||||||
@@ -185,7 +185,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec2s& vec)
|
|||||||
{
|
{
|
||||||
output << (int)vec._v[0] << " "
|
output << (int)vec._v[0] << " "
|
||||||
<< (int)vec._v[1];
|
<< (int)vec._v[1];
|
||||||
return output; // to enable cascading
|
return output; // to enable cascading
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec2s& vec)
|
inline std::istream& operator >> (std::istream& input, Vec2s& vec)
|
||||||
@@ -201,7 +201,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec3s& vec)
|
|||||||
output << (int)vec._v[0] << " "
|
output << (int)vec._v[0] << " "
|
||||||
<< (int)vec._v[1] << " "
|
<< (int)vec._v[1] << " "
|
||||||
<< (int)vec._v[2];
|
<< (int)vec._v[2];
|
||||||
return output; // to enable cascading
|
return output; // to enable cascading
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec3s& vec)
|
inline std::istream& operator >> (std::istream& input, Vec3s& vec)
|
||||||
@@ -218,7 +218,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec4s& vec)
|
|||||||
<< (int)vec._v[1] << " "
|
<< (int)vec._v[1] << " "
|
||||||
<< (int)vec._v[2] << " "
|
<< (int)vec._v[2] << " "
|
||||||
<< (int)vec._v[3];
|
<< (int)vec._v[3];
|
||||||
return output; // to enable cascading
|
return output; // to enable cascading
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec4s& vec)
|
inline std::istream& operator >> (std::istream& input, Vec4s& vec)
|
||||||
@@ -267,7 +267,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec4ub& vec)
|
|||||||
<< (int)vec._v[1] << " "
|
<< (int)vec._v[1] << " "
|
||||||
<< (int)vec._v[2] << " "
|
<< (int)vec._v[2] << " "
|
||||||
<< (int)vec._v[3];
|
<< (int)vec._v[3];
|
||||||
return output; // to enable cascading
|
return output; // to enable cascading
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec4ub& vec)
|
inline std::istream& operator >> (std::istream& input, Vec4ub& vec)
|
||||||
@@ -301,10 +301,10 @@ inline std::istream& operator >> (std::istream& input, Quat& vec)
|
|||||||
inline std::ostream& operator << (std::ostream& output, const Plane& pl)
|
inline std::ostream& operator << (std::ostream& output, const Plane& pl)
|
||||||
{
|
{
|
||||||
output << pl[0] << " "
|
output << pl[0] << " "
|
||||||
<< pl[1] << " "
|
<< pl[1] << " "
|
||||||
<< pl[2] << " "
|
<< pl[2] << " "
|
||||||
<< pl[3];
|
<< pl[3];
|
||||||
return output; // to enable cascading
|
return output; // to enable cascading
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Plane& vec)
|
inline std::istream& operator >> (std::istream& input, Plane& vec)
|
||||||
|
|||||||
@@ -76,9 +76,9 @@ class ref_ptr
|
|||||||
|
|
||||||
inline const T* operator->() const { return _ptr; }
|
inline const T* operator->() const { return _ptr; }
|
||||||
|
|
||||||
inline bool operator!() const { return _ptr==0L; }
|
inline bool operator!() const { return _ptr==0L; }
|
||||||
|
|
||||||
inline bool valid() const { return _ptr!=0L; }
|
inline bool valid() const { return _ptr!=0L; }
|
||||||
|
|
||||||
inline T* get() { return _ptr; }
|
inline T* get() { return _ptr; }
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ class OSGDB_EXPORT DynamicLibrary : public osg::Referenced
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/** get handle to library file */
|
/** get handle to library file */
|
||||||
static HANDLE getLibraryHandle( const std::string& libraryName);
|
static HANDLE getLibraryHandle( const std::string& libraryName);
|
||||||
|
|
||||||
/** disallow default constructor.*/
|
/** disallow default constructor.*/
|
||||||
DynamicLibrary():osg::Referenced() {}
|
DynamicLibrary():osg::Referenced() {}
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
# if defined( _LIB ) || defined( USE_STATIC )
|
# if defined( _LIB ) || defined( USE_STATIC )
|
||||||
# define OSGDB_EXPORT
|
# define OSGDB_EXPORT
|
||||||
# elif defined( OSGDB_LIBRARY )
|
# elif defined( OSGDB_LIBRARY )
|
||||||
# define OSGDB_EXPORT __declspec(dllexport)
|
# define OSGDB_EXPORT __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define OSGDB_EXPORT __declspec(dllimport)
|
# define OSGDB_EXPORT __declspec(dllimport)
|
||||||
# endif /* OSGDBSG_LIBRARY */
|
# endif /* OSGDBSG_LIBRARY */
|
||||||
#else
|
#else
|
||||||
# define OSGDB_EXPORT
|
# define OSGDB_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ class OSGDB_EXPORT Output : public std::ofstream
|
|||||||
|
|
||||||
Output& indent();
|
Output& indent();
|
||||||
|
|
||||||
/** wrap a string with "" quotes and use \" for any internal quotes.*/
|
/** wrap a string with "" quotes and use \" for any internal quotes.*/
|
||||||
std::string wrapString(const std::string& str);
|
std::string wrapString(const std::string& str);
|
||||||
|
|
||||||
inline void setIndentStep(int step) { _indentStep = step; }
|
inline void setIndentStep(int step) { _indentStep = step; }
|
||||||
inline int getIndentStep() const { return _indentStep; }
|
inline int getIndentStep() const { return _indentStep; }
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
AnimationPathManipulator( osg::AnimationPath* animationPath=0 );
|
AnimationPathManipulator( osg::AnimationPath* animationPath=0 );
|
||||||
|
|
||||||
AnimationPathManipulator( const std::string& filename );
|
AnimationPathManipulator( const std::string& filename );
|
||||||
|
|
||||||
virtual const char* className() const { return "AnimationPath"; }
|
virtual const char* className() const { return "AnimationPath"; }
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
|
|||||||
|
|
||||||
const osg::AnimationPath* getAnimationPath() const { return _animationPath.get(); }
|
const osg::AnimationPath* getAnimationPath() const { return _animationPath.get(); }
|
||||||
|
|
||||||
bool valid() const { return _animationPath.valid(); }
|
bool valid() const { return _animationPath.valid(); }
|
||||||
|
|
||||||
void init(const GUIEventAdapter& ea,GUIActionAdapter& us);
|
void init(const GUIEventAdapter& ea,GUIActionAdapter& us);
|
||||||
|
|
||||||
@@ -77,13 +77,13 @@ class OSGGA_EXPORT AnimationPathManipulator : public MatrixManipulator
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
bool _valid;
|
bool _valid;
|
||||||
|
|
||||||
bool _printOutTiminInfo;
|
bool _printOutTiminInfo;
|
||||||
|
|
||||||
void handleFrame( double time );
|
void handleFrame( double time );
|
||||||
|
|
||||||
osg::ref_ptr<osg::AnimationPath> _animationPath;
|
osg::ref_ptr<osg::AnimationPath> _animationPath;
|
||||||
|
|
||||||
double _timeOffset;
|
double _timeOffset;
|
||||||
double _timeScale;
|
double _timeScale;
|
||||||
|
|||||||
@@ -63,14 +63,14 @@ class OSGGA_EXPORT DriveManipulator : public MatrixManipulator
|
|||||||
/** Get the keyboard and mouse usage of this manipulator.*/
|
/** Get the keyboard and mouse usage of this manipulator.*/
|
||||||
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
||||||
|
|
||||||
void setModelScale( double in_ms ) { _modelScale = in_ms; }
|
void setModelScale( double in_ms ) { _modelScale = in_ms; }
|
||||||
double getModelScale() const { return _modelScale; }
|
double getModelScale() const { return _modelScale; }
|
||||||
|
|
||||||
void setVelocity( double in_vel ) { _velocity = in_vel; }
|
void setVelocity( double in_vel ) { _velocity = in_vel; }
|
||||||
double getVelocity() const { return _velocity; }
|
double getVelocity() const { return _velocity; }
|
||||||
|
|
||||||
void setHeight( double in_h ) { _height = in_h; }
|
void setHeight( double in_h ) { _height = in_h; }
|
||||||
double getHeight() const { return _height; }
|
double getHeight() const { return _height; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
void addMatrixManipulator(int key, std::string name, MatrixManipulator *cm);
|
void addMatrixManipulator(int key, std::string name, MatrixManipulator *cm);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Add a camera manipulator with an autogenerated keybinding which is '1' + previous number of camera's registerd.
|
Add a camera manipulator with an autogenerated keybinding which is '1' + previous number of camera's registerd.
|
||||||
*/
|
*/
|
||||||
void addNumberedMatrixManipulator(MatrixManipulator *cm);
|
void addNumberedMatrixManipulator(MatrixManipulator *cm);
|
||||||
|
|
||||||
unsigned int getNumMatrixManipulators() const { return _manips.size(); }
|
unsigned int getNumMatrixManipulators() const { return _manips.size(); }
|
||||||
|
|||||||
@@ -19,48 +19,48 @@
|
|||||||
namespace osgIntrospection
|
namespace osgIntrospection
|
||||||
{
|
{
|
||||||
|
|
||||||
class Value;
|
class Value;
|
||||||
|
|
||||||
struct Comparator
|
struct Comparator
|
||||||
{
|
{
|
||||||
virtual bool isEqualTo(const Value& l, const Value& r) const = 0;
|
virtual bool isEqualTo(const Value& l, const Value& r) const = 0;
|
||||||
virtual bool isLessThanOrEqualTo(const Value& l, const Value& r) const = 0;
|
virtual bool isLessThanOrEqualTo(const Value& l, const Value& r) const = 0;
|
||||||
virtual ~Comparator() {}
|
virtual ~Comparator() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct TotalOrderComparator: Comparator
|
struct TotalOrderComparator: Comparator
|
||||||
{
|
{
|
||||||
virtual bool isEqualTo(const Value& l, const Value& r) const
|
virtual bool isEqualTo(const Value& l, const Value& r) const
|
||||||
{
|
{
|
||||||
const T &vl = variant_cast<const T &>(l);
|
const T &vl = variant_cast<const T &>(l);
|
||||||
const T &vr = variant_cast<const T &>(r);
|
const T &vr = variant_cast<const T &>(r);
|
||||||
return vl <= vr && vr <= vl;
|
return vl <= vr && vr <= vl;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool isLessThanOrEqualTo(const Value& l, const Value& r) const
|
virtual bool isLessThanOrEqualTo(const Value& l, const Value& r) const
|
||||||
{
|
{
|
||||||
return variant_cast<const T &>(l) <= variant_cast<const T &>(r);
|
return variant_cast<const T &>(l) <= variant_cast<const T &>(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~TotalOrderComparator() {}
|
virtual ~TotalOrderComparator() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct PartialOrderComparator: Comparator
|
struct PartialOrderComparator: Comparator
|
||||||
{
|
{
|
||||||
virtual bool isEqualTo(const Value& l, const Value& r) const
|
virtual bool isEqualTo(const Value& l, const Value& r) const
|
||||||
{
|
{
|
||||||
return variant_cast<const T &>(l) == variant_cast<const T &>(r);
|
return variant_cast<const T &>(l) == variant_cast<const T &>(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool isLessThanOrEqualTo(const Value& , const Value& ) const
|
virtual bool isLessThanOrEqualTo(const Value& , const Value& ) const
|
||||||
{
|
{
|
||||||
throw ComparisonOperatorNotSupportedException(typeid(T), "less than or equal to");
|
throw ComparisonOperatorNotSupportedException(typeid(T), "less than or equal to");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~PartialOrderComparator() {}
|
virtual ~PartialOrderComparator() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class OSGPRODUCER_EXPORT EventAdapter : public osgGA::GUIEventAdapter
|
|||||||
void adaptResize(double t, float Xmin, float Ymin, float Xmax, float Ymax);
|
void adaptResize(double t, float Xmin, float Ymin, float Xmax, float Ymax);
|
||||||
|
|
||||||
/** method for adapting mouse scroll wheel events. */
|
/** method for adapting mouse scroll wheel events. */
|
||||||
void adaptMouseScroll(double t, Producer::KeyboardMouseCallback::ScrollingMotion sm);
|
void adaptMouseScroll(double t, Producer::KeyboardMouseCallback::ScrollingMotion sm);
|
||||||
|
|
||||||
/** method for adapting mouse motion events whilst mouse buttons are pressed.*/
|
/** method for adapting mouse motion events whilst mouse buttons are pressed.*/
|
||||||
void adaptMouseMotion(double t, float x, float y);
|
void adaptMouseMotion(double t, float x, float y);
|
||||||
@@ -125,8 +125,8 @@ class OSGPRODUCER_EXPORT EventAdapter : public osgGA::GUIEventAdapter
|
|||||||
// which required the mouse buttons state at the time of the event.
|
// which required the mouse buttons state at the time of the event.
|
||||||
static unsigned int _s_accumulatedButtonMask;
|
static unsigned int _s_accumulatedButtonMask;
|
||||||
|
|
||||||
// used to store current button value
|
// used to store current button value
|
||||||
static int _s_button;
|
static int _s_button;
|
||||||
|
|
||||||
// used to store window min and max values.
|
// used to store window min and max values.
|
||||||
static float _s_Xmin;
|
static float _s_Xmin;
|
||||||
|
|||||||
@@ -30,12 +30,12 @@
|
|||||||
# if defined( _LIB ) || defined( USE_STATIC )
|
# if defined( _LIB ) || defined( USE_STATIC )
|
||||||
# define OSGPRODUCER_EXPORT
|
# define OSGPRODUCER_EXPORT
|
||||||
# elif defined( OSGPRODUCER_LIBRARY )
|
# elif defined( OSGPRODUCER_LIBRARY )
|
||||||
# define OSGPRODUCER_EXPORT __declspec(dllexport)
|
# define OSGPRODUCER_EXPORT __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define OSGPRODUCER_EXPORT __declspec(dllimport)
|
# define OSGPRODUCER_EXPORT __declspec(dllimport)
|
||||||
#endif /* OSGPRODUCER_LIBRARY */
|
#endif /* OSGPRODUCER_LIBRARY */
|
||||||
#else
|
#else
|
||||||
#define OSGPRODUCER_EXPORT
|
#define OSGPRODUCER_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class OSGSIM_EXPORT Impostor : public osg::LOD
|
|||||||
/** Set the Impostor threshold distance.
|
/** Set the Impostor threshold distance.
|
||||||
* For eye points further than this threshold the Imposter is used if appropriate,
|
* For eye points further than this threshold the Imposter is used if appropriate,
|
||||||
* otherwise the LOD children as chosen as per a standard LOD node.
|
* otherwise the LOD children as chosen as per a standard LOD node.
|
||||||
*/
|
*/
|
||||||
inline void setImpostorThreshold(float distance) { _impostorThreshold = distance; }
|
inline void setImpostorThreshold(float distance) { _impostorThreshold = distance; }
|
||||||
|
|
||||||
/* Get the Impostor threshold distance. */
|
/* Get the Impostor threshold distance. */
|
||||||
|
|||||||
@@ -1117,7 +1117,7 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
|
|||||||
unsigned int _maximumTileImageSize;
|
unsigned int _maximumTileImageSize;
|
||||||
unsigned int _maximumTileTerrainSize;
|
unsigned int _maximumTileTerrainSize;
|
||||||
float _maximumVisiableDistanceOfTopLevel;
|
float _maximumVisiableDistanceOfTopLevel;
|
||||||
float _radiusToMaxVisibleDistanceRatio;
|
float _radiusToMaxVisibleDistanceRatio;
|
||||||
float _verticalScale;
|
float _verticalScale;
|
||||||
float _skirtRatio;
|
float _skirtRatio;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user