From Wang Rui, "Attached is the osgAnimation wrappers for serialize IO operations. A
few headers and the osgAnimation sources are also modified to make everything goes well, including: A new REGISTER_OBJECT_WRAPPER2 macro to wrap classes like Skeleton::UpdateSkeleton. A bug fix in the Seralizer header which avoids setting default values to objects. Naming style fixes in osgAnimation headers and sources, also in the deprecated dotosg wrappers. A bug fix for the XML support, to write char values correctly. A small change in the osg::Geometry wrapper to ignore the InternalGeometry property, which is used by the MorphGeometry and should not be set by user applications. The avatar.osg, nathan.osg and robot.osg data files all work fine with serializers, with some 'unsupported wrapper' warnings when converting. I'm thinking of removing these warnings by disabling related property serializers (ComputeBoundingBoxCallback and Drawable::UpdateCallback), which are seldom recorded by users. By the way, I still wonder how would we handle the C4121 problem, discussed some days before. The /Zp compile option is set to 16 in the attached cmake script file. And is there a better solution now?"
This commit is contained in:
@@ -113,7 +113,7 @@ namespace osgAnimation
|
||||
double getDuration() const { return _numberFrame * 1.0 / _fps; }
|
||||
|
||||
// 0 means infini else it's the number of loop
|
||||
virtual void setLoop(int nb) { _loop = nb; }
|
||||
virtual void setLoop(unsigned int nb) { _loop = nb; }
|
||||
virtual unsigned int getLoop() const { return _loop;}
|
||||
|
||||
// get the number of loop, the frame relative to loop.
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace osgAnimation
|
||||
bool update (double time, int priority = 0);
|
||||
void resetTargets();
|
||||
|
||||
void setPlaymode (PlayMode mode) { _playmode = mode; }
|
||||
void setPlayMode (PlayMode mode) { _playmode = mode; }
|
||||
PlayMode getPlayMode() const { return _playmode; }
|
||||
|
||||
void setStartTime(double time) { _startTime = time;}
|
||||
|
||||
@@ -54,7 +54,8 @@ namespace osgAnimation
|
||||
|
||||
/// set a flag to define the behaviour
|
||||
void setAutomaticLink(bool);
|
||||
bool isAutomaticLink() const;
|
||||
bool getAutomaticLink() const;
|
||||
bool isAutomaticLink() const { return getAutomaticLink(); }
|
||||
void dirty();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace osgAnimation
|
||||
void update();
|
||||
|
||||
const osg::Vec3& getAxis() const;
|
||||
const double getAngle() const;
|
||||
double getAngle() const;
|
||||
void setAxis(const osg::Vec3&);
|
||||
void setAngle(const double&);
|
||||
void setAngle(double);
|
||||
|
||||
virtual Target* getOrCreateTarget();
|
||||
virtual Target* getTarget() {return _target.get();}
|
||||
|
||||
@@ -139,6 +139,13 @@ protected:
|
||||
typedef CLASS MyClass; \
|
||||
void wrapper_propfunc_##NAME(osgDB::ObjectWrapper* wrapper)
|
||||
|
||||
#define REGISTER_OBJECT_WRAPPER2(NAME, PROTO, CLASS, CLASSNAME, ASSOCIATES) \
|
||||
extern void wrapper_propfunc_##NAME(osgDB::ObjectWrapper*); \
|
||||
static osgDB::RegisterWrapperProxy wrapper_proxy_##NAME( \
|
||||
PROTO, CLASSNAME, ASSOCIATES, &wrapper_propfunc_##NAME); \
|
||||
typedef CLASS MyClass; \
|
||||
void wrapper_propfunc_##NAME(osgDB::ObjectWrapper* wrapper)
|
||||
|
||||
class OSGDB_EXPORT RegisterCompressorProxy
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -499,7 +499,8 @@ public:
|
||||
{
|
||||
is >> BEGIN_BRACKET;
|
||||
P* value = dynamic_cast<P*>( is.readObject() );
|
||||
(object.*_setter)( value );
|
||||
if ( ParentType::_defaultValue!=value )
|
||||
(object.*_setter)( value );
|
||||
is >> END_BRACKET;
|
||||
}
|
||||
}
|
||||
@@ -567,7 +568,8 @@ public:
|
||||
{
|
||||
is >> BEGIN_BRACKET;
|
||||
P* value = dynamic_cast<P*>( is.readImage() );
|
||||
(object.*_setter)( value );
|
||||
if ( ParentType::_defaultValue!=value )
|
||||
(object.*_setter)( value );
|
||||
is >> END_BRACKET;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user