From ac2bdbda30f1237c30df686eef5d9e1b8215251e Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Wed, 19 Sep 2001 23:52:12 +0000 Subject: [PATCH] 1) new implementation of the osg::Matrix class. Note details below. 2) cleaned up osg::Timer, still in progress. My intent has been to pave the way for support for other OS's. 3) new osg::FrameStamp class which has a frame number, reference time for each frame to be app, culled and drawn. The FrameStamp also can be passed to other machines (i.e. cluster) and the FrameStamp can be used with the slaves own app,cull and draw. I've also added the beginings of a calander time data to the FrameStamp to allow time or day and year to be used in setting up position of sun/moon etc. etc. 4) The osg::State now has contains a pointer to the last applied osg::Camera and the current osg::FrameStamp, so that drawables can use both pieces of information for creating effects such CLOD, earth/sky etc. The osg::NodeVisitor also now allows you to attach a FrameStamp to support syncronization of actions on the scene graph. --- doc/doc++/osg/FrameStamp.html | 192 +++++++++++ doc/doc++/osg/MatrixNew.html | 503 ++++++++++++++++++++++++++++ doc/doc++/osg/MatrixNewProduct.html | 51 +++ doc/doc++/osg/MatrixOld.html | 367 ++++++++++++++++++++ include/osg/FrameStamp | 66 ++++ src/osg/FrameStamp.cpp | 74 ++++ 6 files changed, 1253 insertions(+) create mode 100644 doc/doc++/osg/FrameStamp.html create mode 100644 doc/doc++/osg/MatrixNew.html create mode 100644 doc/doc++/osg/MatrixNewProduct.html create mode 100644 doc/doc++/osg/MatrixOld.html create mode 100644 include/osg/FrameStamp create mode 100644 src/osg/FrameStamp.cpp diff --git a/doc/doc++/osg/FrameStamp.html b/doc/doc++/osg/FrameStamp.html new file mode 100644 index 000000000..e24f4ec49 --- /dev/null +++ b/doc/doc++/osg/FrameStamp.html @@ -0,0 +1,192 @@ + + + + + class SG_EXPORT osg::FrameStamp + + + + +

class SG_EXPORT osg::FrameStamp

Class which encapsulates the frame number, reference time and calander time of specific frame, used to synchonize operations on the scene graph and other machines when using a graphics cluster.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Methods

+[more] FrameStamp() +
+[more] FrameStamp(const FrameStamp& fs) +
+[more] ~FrameStamp() +
+[more]FrameStamp& operator = (const FrameStamp& fs) +
+[more]void setFrameNumber(int fnum) +
+[more]int getFrameNumber() const +
+[more]void setReferenceTime(double refTime) +
+[more]double getReferenceTime() const +
+[more]void setCalanderTime(const tm& calanderTime) +
+[more]void getCalanderTime(tm& calanderTime) const +

+ +

+

Protected Fields

+[more]int _frameNumber +
+[more]double _referenceTime +
+[more]int tm_sec +
+[more]int tm_min +
+[more]int tm_hour +
+[more]int tm_mday +
+[more]int tm_mon +
+[more]int tm_year +
+[more]int tm_wday +
+[more]int tm_yday +
+[more]int tm_isdst +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
Class which encapsulates the frame number, reference time and calander +time of specific frame, used to synchonize operations on the scene graph +and other machines when using a graphics cluster. Note the calander +time can be an artificial simulation time or capture the real time +of day etc.
+
+ + + +
o FrameStamp() +

+ + +

o FrameStamp(const FrameStamp& fs) +

+ + +

o ~FrameStamp() +

+ + +

oFrameStamp& operator = (const FrameStamp& fs) +

+ + +

ovoid setFrameNumber(int fnum) +

+ + +

oint getFrameNumber() const +

+ + +

ovoid setReferenceTime(double refTime) +

+ + +

odouble getReferenceTime() const +

+ + +

ovoid setCalanderTime(const tm& calanderTime) +

+ + +

ovoid getCalanderTime(tm& calanderTime) const +

+ + +

oint _frameNumber +

+ + +

odouble _referenceTime +

+ + +

oint tm_sec +

+ + +

oint tm_min +

+ + +

oint tm_hour +

+ + +

oint tm_mday +

+ + +

oint tm_mon +

+ + +

oint tm_year +

+ + +

oint tm_wday +

+ + +

oint tm_yday +

+ + +

oint tm_isdst +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/MatrixNew.html b/doc/doc++/osg/MatrixNew.html new file mode 100644 index 000000000..c84b546f2 --- /dev/null +++ b/doc/doc++/osg/MatrixNew.html @@ -0,0 +1,503 @@ + + + + + class SG_EXPORT osg::MatrixNew + + + + +

class SG_EXPORT osg::MatrixNew


+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]float _mat[4][4] +
+[more]bool fully_realized +

+ +

+

Public Methods

+[more] META_Object(MatrixNew) +
+[more] MatrixNew() +
+[more] MatrixNew( const MatrixNew& other ) +
+[more]explicit MatrixNew( float const* const def ) +
+[more] MatrixNew( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +
+[more]virtual ~MatrixNew() +
+[more]MatrixNew& operator = (const MatrixNew& ) +
+[more]int compare(const MatrixNew& m) const +
+[more]bool operator < (const MatrixNew& m) const +
+[more]bool operator == (const MatrixNew& m) const +
+[more]bool operator != (const MatrixNew& m) const +
+[more]inline float& operator()(int col, int row) +
+[more]inline float operator()(int col, int row) const +
+[more]void set( float const* const ) +
+[more]void set( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +
+[more]const float* values() +
+[more]void makeIdent() +
+[more]void makeScale( const Vec3& ) +
+[more]void makeScale( float, float, float ) +
+[more]void makeTrans( const Vec3& ) +
+[more]void makeTrans( float, float, float ) +
+[more]void makeRot( const Vec3& from, const Vec3& to ) +
+[more]void makeRot( float angle, const Vec3& orientation ) +
+[more]void makeRot( float angle, float x, float y, float z ) +
+[more]void makeRot( const Quat& ) +
+[more]void makeRot( float, float, float ) +
+[more]bool invert( const MatrixNew& ) +
+[more]bool invertAffine( const MatrixNew& ) +
+[more]static MatrixNew scale( const Vec3& ) +
+[more]static MatrixNew scale( float, float, float ) +
+[more]static MatrixNew trans( const Vec3& ) +
+[more]static MatrixNew trans( float, float, float ) +
+[more]static MatrixNew rotate( const Vec3&, const Vec3& ) +
+[more]static MatrixNew rotate( float, float, float, float ) +
+[more]static MatrixNew rotate( const Quat& ) +
+[more]void setTrans( float tx, float ty, float tz ) +
+[more]void setTrans( const Vec3& v ) +
+[more]Vec3 getTrans() const +
+[more]void copy( const MatrixNew& ) +
+[more]void preScale( float sx, float sy, float sz, const MatrixNew& m ) +
+[more]void postScale( const MatrixNew& m, float sx, float sy, float sz ) +
+[more]void preScale( float sx, float sy, float sz ) +
+[more]void postScale( float sx, float sy, float sz ) +
+[more]void preTrans( float tx, float ty, float tz, const MatrixNew& m ) +
+[more]void postTrans( const MatrixNew& m, float tx, float ty, float tz ) +
+[more]void preTrans( float tx, float ty, float tz) +
+[more]void postTrans( float tx, float ty, float tz ) +
+[more]void preRot( float deg, float x, float y, float z, const MatrixNew& m ) +
+[more]void postRot( const MatrixNew& m, float deg, float x, float y, float z ) +
+[more]void preRot( float deg, float x, float y, float z ) +
+[more]void postRot( float deg, float x, float y, float z ) +
+[more]inline static Vec3 transform3x3(const Vec3& v, const MatrixNew& m) +
apply apply an 3x3 transform of v*M[02,02] +
+[more]inline static Vec3 transform3x3(const MatrixNew& m, const Vec3& v) +
apply apply an 3x3 transform of M[02,02]*v +
+[more]void mult( const MatrixNew&, const MatrixNew& ) +
nd of Deprecated methods +
+[more]void preMult( const MatrixNew& ) +
+[more]void postMult( const MatrixNew& ) +
+[more]inline MatrixNewProduct operator * ( const MatrixNew& other ) const +
+[more]inline void operator *= ( const MatrixNew& other ) +
+[more]inline void operator = ( const MatrixNewProduct& p ) +
+[more] MatrixNew( const MatrixNewProduct& p ) +
+[more]inline Vec3 postMult( const Vec3& v ) const +
+[more]inline Vec3 preMult( const Vec3& v ) const +
+[more]inline Vec4 postMult( const Vec4& v ) const +
+[more]inline Vec4 preMult( const Vec4& v ) const +
+[more]inline Vec3 transform3x3(const Vec3& v, const MatrixNew& m) +
+[more]inline Vec3 transform3x3(const MatrixNew& m, const Vec3& v) +
+[more]inline Vec3 operator* (const Vec3& v) const +
+[more]inline Vec4 operator* (const Vec4& v) const +

+ +

+

Public Members

+class MatrixNewProduct +

+ +
+

Inherited from Object:

+
+

+

Public Methods

+ovirtual Object* clone() const +
+ovirtual bool isSameKindAs(const Object*) const +
+ovirtual const char* className() const +

+ +
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
+ + + +
ofloat _mat[4][4] +

+ + +

obool fully_realized +

+ + +

o META_Object(MatrixNew) +

+ + +

o MatrixNew() +

+ + +

o MatrixNew( const MatrixNew& other ) +

+ + +

oexplicit MatrixNew( float const* const def ) +

+ + +

o MatrixNew( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +

+ + +

ovirtual ~MatrixNew() +

+ + +

oMatrixNew& operator = (const MatrixNew& ) +

+ + +

oint compare(const MatrixNew& m) const +

+ + +

obool operator < (const MatrixNew& m) const +

+ + +

obool operator == (const MatrixNew& m) const +

+ + +

obool operator != (const MatrixNew& m) const +

+ + +

oinline float& operator()(int col, int row) +

+ + +

oinline float operator()(int col, int row) const +

+ + +

ovoid set( float const* const ) +

+ + +

ovoid set( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +

+ + +

oconst float* values() +

+ + +

ovoid makeIdent() +

+ + +

ovoid makeScale( const Vec3& ) +

+ + +

ovoid makeScale( float, float, float ) +

+ + +

ovoid makeTrans( const Vec3& ) +

+ + +

ovoid makeTrans( float, float, float ) +

+ + +

ovoid makeRot( const Vec3& from, const Vec3& to ) +

+ + +

ovoid makeRot( float angle, const Vec3& orientation ) +

+ + +

ovoid makeRot( float angle, float x, float y, float z ) +

+ + +

ovoid makeRot( const Quat& ) +

+ + +

ovoid makeRot( float, float, float ) +

+ + +

obool invert( const MatrixNew& ) +

+ + +

obool invertAffine( const MatrixNew& ) +

+ + +

ostatic MatrixNew scale( const Vec3& ) +

+ + +

ostatic MatrixNew scale( float, float, float ) +

+ + +

ostatic MatrixNew trans( const Vec3& ) +

+ + +

ostatic MatrixNew trans( float, float, float ) +

+ + +

ostatic MatrixNew rotate( const Vec3&, const Vec3& ) +

+ + +

ostatic MatrixNew rotate( float, float, float, float ) +

+ + +

ostatic MatrixNew rotate( const Quat& ) +

+ + +

ovoid setTrans( float tx, float ty, float tz ) +

+ + +

ovoid setTrans( const Vec3& v ) +

+ + +

oVec3 getTrans() const +

+ + +

ovoid copy( const MatrixNew& ) +

+ + +

ovoid preScale( float sx, float sy, float sz, const MatrixNew& m ) +

+ + +

ovoid postScale( const MatrixNew& m, float sx, float sy, float sz ) +

+ + +

ovoid preScale( float sx, float sy, float sz ) +

+ + +

ovoid postScale( float sx, float sy, float sz ) +

+ + +

ovoid preTrans( float tx, float ty, float tz, const MatrixNew& m ) +

+ + +

ovoid postTrans( const MatrixNew& m, float tx, float ty, float tz ) +

+ + +

ovoid preTrans( float tx, float ty, float tz) +

+ + +

ovoid postTrans( float tx, float ty, float tz ) +

+ + +

ovoid preRot( float deg, float x, float y, float z, const MatrixNew& m ) +

+ + +

ovoid postRot( const MatrixNew& m, float deg, float x, float y, float z ) +

+ + +

ovoid preRot( float deg, float x, float y, float z ) +

+ + +

ovoid postRot( float deg, float x, float y, float z ) +

+ + +

oinline static Vec3 transform3x3(const Vec3& v, const MatrixNew& m) +
apply apply an 3x3 transform of v*M[02,02] +

+ + +

oinline static Vec3 transform3x3(const MatrixNew& m, const Vec3& v) +
apply apply an 3x3 transform of M[02,02]*v +

+ + +

ovoid mult( const MatrixNew&, const MatrixNew& ) +
nd of Deprecated methods +

+ + +

ovoid preMult( const MatrixNew& ) +

+ + +

ovoid postMult( const MatrixNew& ) +

+ + +

oinline MatrixNewProduct operator * ( const MatrixNew& other ) const +

+ + +

oinline void operator *= ( const MatrixNew& other ) +

+ + +

oinline void operator = ( const MatrixNewProduct& p ) +

+ + +

o MatrixNew( const MatrixNewProduct& p ) +

+ + +

oinline Vec3 postMult( const Vec3& v ) const +

+ + +

oinline Vec3 preMult( const Vec3& v ) const +

+ + +

oinline Vec4 postMult( const Vec4& v ) const +

+ + +

oinline Vec4 preMult( const Vec4& v ) const +

+ + +

oinline Vec3 transform3x3(const Vec3& v, const MatrixNew& m) +

+ + +

oinline Vec3 transform3x3(const MatrixNew& m, const Vec3& v) +

+ + +

oinline Vec3 operator* (const Vec3& v) const +

+ + +

oinline Vec4 operator* (const Vec4& v) const +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/MatrixNewProduct.html b/doc/doc++/osg/MatrixNewProduct.html new file mode 100644 index 000000000..8148d2dc3 --- /dev/null +++ b/doc/doc++/osg/MatrixNewProduct.html @@ -0,0 +1,51 @@ + + + + + class osg::MatrixNew::MatrixNewProduct + + + + +

class MatrixNewProduct


+ +
+

+

Public Fields

+[more]const MatrixNew& A +
+[more]const MatrixNew& B +

+ +

+

Public Methods

+[more] MatrixNewProduct( const MatrixNew& lhs, const MatrixNew& rhs ) +

+ +
+ + +
+

Documentation

+
+ + + +
oconst MatrixNew& A +

+ + +

oconst MatrixNew& B +

+ + +

o MatrixNewProduct( const MatrixNew& lhs, const MatrixNew& rhs ) +

+ +
This class has no child classes.
+ +

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/doc/doc++/osg/MatrixOld.html b/doc/doc++/osg/MatrixOld.html new file mode 100644 index 000000000..4dbc54413 --- /dev/null +++ b/doc/doc++/osg/MatrixOld.html @@ -0,0 +1,367 @@ + + + + + class SG_EXPORT osg::MatrixOld + + + + +

class SG_EXPORT osg::MatrixOld

4x4 MatrixOld for storage & manipulation of transformations in scene graph.
+
+ +

Inheritance:

+ + + + + + + +
+ +
+

+

Public Fields

+[more]float _mat[4][4] +

+ +

+

Public Methods

+[more] MatrixOld() +
+[more] MatrixOld(const MatrixOld& MatrixOld) +
+[more] MatrixOld( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +
+[more]MatrixOld& operator = (const MatrixOld& MatrixOld) +
+[more]virtual ~MatrixOld() +
+[more]virtual Object* clone() const +
+[more]virtual bool isSameKindAs(const Object* obj) const +
+[more]virtual const char* className() const +
+[more]int compare(const MatrixOld& m) const +
+[more]bool operator < (const MatrixOld& m) const +
+[more]bool operator == (const MatrixOld& m) const +
+[more]bool operator != (const MatrixOld& m) const +
+[more]void makeIdent() +
+[more]void set(const float* m) +
+[more]void set( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +
+[more]void copy(const MatrixOld& MatrixOld) +
+[more]void makeScale(float sx, float sy, float sz) +
+[more]void preScale( float sx, float sy, float sz, const MatrixOld& m ) +
+[more]void postScale( const MatrixOld& m, float sx, float sy, float sz ) +
+[more]void preScale( float sx, float sy, float sz ) +
+[more]void postScale( float sx, float sy, float sz ) +
+[more]void makeTrans( float tx, float ty, float tz ) +
+[more]void preTrans( float tx, float ty, float tz, const MatrixOld& m ) +
+[more]void postTrans( const MatrixOld& m, float tx, float ty, float tz ) +
+[more]void preTrans( float tx, float ty, float tz ) +
+[more]void postTrans( float tx, float ty, float tz ) +
+[more]void makeRot( const Vec3& old_vec, const Vec3& new_vec ) +
Calc the rotation MatrixOld which aligns vector \a old_vec with vector \a new_vec. +
+[more]void makeRot( float deg, float x, float y, float z ) +
+[more]void preRot( float deg, float x, float y, float z, const MatrixOld& m ) +
+[more]void postRot( const MatrixOld& m, float deg, float x, float y, float z ) +
+[more]void preRot( float deg, float x, float y, float z ) +
+[more]void postRot( float deg, float x, float y, float z ) +
+[more]void setTrans( float tx, float ty, float tz ) +
+[more]void setTrans( const Vec3& v ) +
+[more]Vec3 getTrans() const +
+[more]void preMult(const MatrixOld& m) +
+[more]void postMult(const MatrixOld& m) +
+[more]void mult(const MatrixOld& lhs, const MatrixOld& rhs) +
+[more]MatrixOld operator * (const MatrixOld& m) const +
+[more]inline static Vec3 transform3x3(const Vec3& v, const MatrixOld& m) +
apply apply an 3x3 transform of v*M[02,02] +
+[more]inline static Vec3 transform3x3(const MatrixOld& m, const Vec3& v) +
apply apply an 3x3 transform of M[02,02]*v +
+[more]bool invert(const MatrixOld& m) +
+[more]inline Vec3 operator * (const Vec3& v) const +
post multipy v. +
+[more]inline Vec4 operator * (const Vec4& v) const +
post multipy v. +
+[more]inline Vec3 transform3x3(const Vec3& v, const MatrixOld& m) +
+[more]inline Vec3 transform3x3(const MatrixOld& m, const Vec3& v) +

+ +
+

Inherited from Object:

+
+
+

Inherited from Referenced:

+
+

+

Public Methods

+oinline void ref() const +
+oinline void unref() const +
+oinline const int referenceCount() const +

+ +

+

Protected Fields

+omutable int _refCount +

+ +
+ + +
+

Documentation

+
4x4 MatrixOld for storage & manipulation of transformations in scene graph. +Provides basic maths operations, IO and via osg::Object reference counting. +You can directly load the MatrixOld with OpenGL's LoadMatrixOldf() function via +the public member _mat as the MatrixOld is stored in the OpenGL format. +Caution: The disadvantage of this feature is, that the MatrixOld access is +'transposed' if you compare it with the standard C/C++ 2d-array-access +convention . I.e. _mat[i][j] accesses the ith column of the jth row in the +4x4 MatrixOld.
+
+ + + +
o MatrixOld() +

+ + +

o MatrixOld(const MatrixOld& MatrixOld) +

+ + +

o MatrixOld( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +

+ + +

oMatrixOld& operator = (const MatrixOld& MatrixOld) +

+ + +

ovirtual ~MatrixOld() +

+ + +

ovirtual Object* clone() const +

+ + +

ovirtual bool isSameKindAs(const Object* obj) const +

+ + +

ovirtual const char* className() const +

+ + +

oint compare(const MatrixOld& m) const +

+ + +

obool operator < (const MatrixOld& m) const +

+ + +

obool operator == (const MatrixOld& m) const +

+ + +

obool operator != (const MatrixOld& m) const +

+ + +

ovoid makeIdent() +

+ + +

ovoid set(const float* m) +

+ + +

ovoid set( float a00, float a01, float a02, float a03, float a10, float a11, float a12, float a13, float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33) +

+ + +

ovoid copy(const MatrixOld& MatrixOld) +

+ + +

ovoid makeScale(float sx, float sy, float sz) +

+ + +

ovoid preScale( float sx, float sy, float sz, const MatrixOld& m ) +

+ + +

ovoid postScale( const MatrixOld& m, float sx, float sy, float sz ) +

+ + +

ovoid preScale( float sx, float sy, float sz ) +

+ + +

ovoid postScale( float sx, float sy, float sz ) +

+ + +

ovoid makeTrans( float tx, float ty, float tz ) +

+ + +

ovoid preTrans( float tx, float ty, float tz, const MatrixOld& m ) +

+ + +

ovoid postTrans( const MatrixOld& m, float tx, float ty, float tz ) +

+ + +

ovoid preTrans( float tx, float ty, float tz ) +

+ + +

ovoid postTrans( float tx, float ty, float tz ) +

+ + +

ovoid makeRot( const Vec3& old_vec, const Vec3& new_vec ) +
+Calc the rotation MatrixOld which aligns vector \a old_vec with +vector \a new_vec. Both \a old_vec and \a new_vec must have +length 1.0. +

+ + +

ovoid makeRot( float deg, float x, float y, float z ) +

+ + +

ovoid preRot( float deg, float x, float y, float z, const MatrixOld& m ) +

+ + +

ovoid postRot( const MatrixOld& m, float deg, float x, float y, float z ) +

+ + +

ovoid preRot( float deg, float x, float y, float z ) +

+ + +

ovoid postRot( float deg, float x, float y, float z ) +

+ + +

ovoid setTrans( float tx, float ty, float tz ) +

+ + +

ovoid setTrans( const Vec3& v ) +

+ + +

oVec3 getTrans() const +

+ + +

ovoid preMult(const MatrixOld& m) +

+ + +

ovoid postMult(const MatrixOld& m) +

+ + +

ovoid mult(const MatrixOld& lhs, const MatrixOld& rhs) +

+ + +

oMatrixOld operator * (const MatrixOld& m) const +

+ + +

oinline static Vec3 transform3x3(const Vec3& v, const MatrixOld& m) +
apply apply an 3x3 transform of v*M[02,02] +

+ + +

oinline static Vec3 transform3x3(const MatrixOld& m, const Vec3& v) +
apply apply an 3x3 transform of M[02,02]*v +

+ + +

obool invert(const MatrixOld& m) +

+ + +

ofloat _mat[4][4] +

+ + +

oinline Vec3 operator * (const Vec3& v) const +
post multipy v. ie. (m*v) +

+ + +

oinline Vec4 operator * (const Vec4& v) const +
post multipy v. ie. (m*v) +

+ + +

oinline Vec3 transform3x3(const Vec3& v, const MatrixOld& m) +

+ + +

oinline Vec3 transform3x3(const MatrixOld& m, const Vec3& v) +

+ +
This class has no child classes.
+ +
Friends:
inline Vec3 operator * (const Vec3& v,const MatrixOld& m)
inline Vec4 operator * (const Vec4& v,const MatrixOld& m)
inline ostream& operator << (ostream& output, const MatrixOld& MatrixOld)

Alphabetic index HTML hierarchy of classes or Java


+
+This page was generated with the help of DOC++. + + diff --git a/include/osg/FrameStamp b/include/osg/FrameStamp new file mode 100644 index 000000000..148379b07 --- /dev/null +++ b/include/osg/FrameStamp @@ -0,0 +1,66 @@ +#ifndef OSG_FRAMESTAMP +#define OSG_FRAMESTAMP 1 + +#include + +#include + +namespace osg +{ + +/** Class which encapsulates the frame number, reference time and calander + * time of specific frame, used to synchonize operations on the scene graph + * and other machines when using a graphics cluster. Note the calander + * time can be an artificial simulation time or capture the real time + * of day etc.*/ +class SG_EXPORT FrameStamp : public Referenced +{ + public: + + FrameStamp(); + FrameStamp(const FrameStamp& fs); + ~FrameStamp(); + + FrameStamp& operator = (const FrameStamp& fs); + + void setFrameNumber(int fnum) { _frameNumber = fnum; } + int getFrameNumber() const { return _frameNumber; } + + void setReferenceTime(double refTime) { _referenceTime = refTime; } + double getReferenceTime() const { return _referenceTime; } + + void setCalanderTime(const tm& calanderTime); + void getCalanderTime(tm& calanderTime) const; + + protected: + + // note no dynamic memory is used so that data can be passed + // via a simple memory copy or within a data packet across + // the network. + + int _frameNumber; + double _referenceTime; + + + // member varaibles of time.h's tm structure, copied here to + // ensure that all data is no dynamic. The tm structure itself + // is not completely consistent betweem implementations, which + // could be a problem when sending the FrameStamp across a network + // with differnt versions of tm (i.e mixing Unix and Windows.) + int tm_sec; /* Seconds. [0-60] (1 leap second) */ + int tm_min; /* Minutes. [0-59] */ + int tm_hour; /* Hours. [0-23] */ + int tm_mday; /* Day. [1-31] */ + int tm_mon; /* Month. [0-11] */ + int tm_year; /* Year - 1900. */ + int tm_wday; /* Day of week. [0-6] */ + int tm_yday; /* Days in year. [0-365] */ + int tm_isdst; /* DST. [-1/0/1]*/ + + +}; + +}; + + +#endif diff --git a/src/osg/FrameStamp.cpp b/src/osg/FrameStamp.cpp new file mode 100644 index 000000000..79774412d --- /dev/null +++ b/src/osg/FrameStamp.cpp @@ -0,0 +1,74 @@ +#include + +using namespace osg; + +FrameStamp::FrameStamp():Referenced() +{ +} + +FrameStamp::FrameStamp(const FrameStamp& fs):Referenced() +{ + _frameNumber = fs._frameNumber; + _referenceTime = fs._referenceTime; + + tm_sec = fs.tm_sec; /* Seconds. [0-60] (1 leap second) */ + tm_min = fs.tm_min; /* Minutes. [0-59] */ + tm_hour = fs.tm_hour; /* Hours. [0-23] */ + tm_mday = fs.tm_mday; /* Day. [1-31] */ + tm_mon = fs.tm_mon; /* Month. [0-11] */ + tm_year = fs.tm_year; /* Year - 1900. */ + tm_wday = fs.tm_wday; /* Day of week. [0-6] */ + tm_yday = fs.tm_yday; /* Days in year.[0-365] */ + tm_isdst = fs.tm_isdst; /* DST. [-1/0/1]*/ + +} + +FrameStamp::~FrameStamp() +{ +} + +FrameStamp& FrameStamp::operator = (const FrameStamp& fs) +{ + if (this==&fs) return *this; + + _frameNumber = fs._frameNumber; + _referenceTime = fs._referenceTime; + + tm_sec = fs.tm_sec; /* Seconds. [0-60] (1 leap second) */ + tm_min = fs.tm_min; /* Minutes. [0-59] */ + tm_hour = fs.tm_hour; /* Hours. [0-23] */ + tm_mday = fs.tm_mday; /* Day. [1-31] */ + tm_mon = fs.tm_mon; /* Month. [0-11] */ + tm_year = fs.tm_year; /* Year - 1900. */ + tm_wday = fs.tm_wday; /* Day of week. [0-6] */ + tm_yday = fs.tm_yday; /* Days in year.[0-365] */ + tm_isdst = fs.tm_isdst; /* DST. [-1/0/1]*/ + + return *this; +} + +void FrameStamp::setCalanderTime(const tm& ct) +{ + tm_sec = ct.tm_sec; /* Seconds. [0-60] (1 leap second) */ + tm_min = ct.tm_min; /* Minutes. [0-59] */ + tm_hour = ct.tm_hour; /* Hours. [0-23] */ + tm_mday = ct.tm_mday; /* Day. [1-31] */ + tm_mon = ct.tm_mon; /* Month. [0-11] */ + tm_year = ct.tm_year; /* Year - 1900. */ + tm_wday = ct.tm_wday; /* Day of week. [0-6] */ + tm_yday = ct.tm_yday; /* Days in year.[0-365] */ + tm_isdst = ct.tm_isdst; /* DST. [-1/0/1]*/ +} + +void FrameStamp::getCalanderTime(tm& ct) const +{ + ct.tm_sec = tm_sec; /* Seconds. [0-60] (1 leap second) */ + ct.tm_min = tm_min; /* Minutes. [0-59] */ + ct.tm_hour = tm_hour; /* Hours. [0-23] */ + ct.tm_mday = tm_mday; /* Day. [1-31] */ + ct.tm_mon = tm_mon; /* Month. [0-11] */ + ct.tm_year = tm_year; /* Year - 1900. */ + ct.tm_wday = tm_wday; /* Day of week. [0-6] */ + ct.tm_yday = tm_yday; /* Days in year.[0-365] */ + ct.tm_isdst = tm_isdst; /* DST. [-1/0/1]*/ +}