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.
This commit is contained in:
74
src/osg/FrameStamp.cpp
Normal file
74
src/osg/FrameStamp.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
#include <osg/FrameStamp>
|
||||
|
||||
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]*/
|
||||
}
|
||||
Reference in New Issue
Block a user