Moved osg::DOFTransform to osgSim::DOFTransform.
Fixed crash associated with .osg files which contain empty description fields. From Sondra Inverson, added support to .ive plugin for osgSim::DOFTransform.
This commit is contained in:
@@ -16,6 +16,7 @@ SRC_DIRS = \
|
||||
osgSim\
|
||||
osgGL2\
|
||||
osgFX\
|
||||
osgTerrain\
|
||||
osgProducer\
|
||||
osgPlugins\
|
||||
../examples
|
||||
|
||||
@@ -1727,6 +1727,9 @@ Package=<4>
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name Core osgUtil
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name Core osgSim
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -181,10 +181,6 @@ SOURCE=..\..\src\osg\DisplaySettings.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osg\DOFTransform.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osg\Drawable.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -561,10 +557,6 @@ SOURCE=..\..\include\osg\DisplaySettings
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\osg\DOFTransform
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Include\Osg\Drawable
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -134,6 +134,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\DataOutputStream.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\ive\DOFTransform.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\ive\Drawable.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -382,6 +386,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\DrawElementsUShort.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\ive\DOFTransform.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\ive\Exception.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -190,13 +190,19 @@ LINK32=link.exe
|
||||
|
||||
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osgSim\IO_LightPointNode.cpp
|
||||
SOURCE=..\..\..\src\osgPlugins\osgSim\IO_DOFTransform.cpp
|
||||
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osgSim\IO_LightPointNode.cpp
|
||||
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osgSim\IO_LightPoint.cpp
|
||||
|
||||
|
||||
@@ -97,6 +97,10 @@ SOURCE=..\..\src\osgSim\BlinkSequence.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osgSim\DOFTransform.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osgSim\LightPoint.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -141,6 +145,10 @@ SOURCE=..\..\include\osgSim\BlinkSequence
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\osgSim\DOFTransform
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\osgSim\LightPoint
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
||||
//created by Sasa Bistrovic
|
||||
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
||||
//as published by the Free Software Foundation.
|
||||
|
||||
#ifndef OSG_DOFTRANSFORM
|
||||
#define OSG_DOFTRANSFORM 1
|
||||
|
||||
//base class:
|
||||
#include <osg/Transform>
|
||||
|
||||
namespace osg{
|
||||
/** DOFTransform - encapsulates Multigen DOF behavior*/
|
||||
class SG_EXPORT DOFTransform : public Transform
|
||||
{
|
||||
public:
|
||||
/** constructor*/
|
||||
DOFTransform();
|
||||
|
||||
/**copy constructor*/
|
||||
DOFTransform(const DOFTransform& dof, const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
Transform(dof, copyop),
|
||||
_minHPR(dof._minHPR),
|
||||
_maxHPR(dof._maxHPR),
|
||||
_currentHPR(dof._currentHPR),
|
||||
_incrementHPR(dof._incrementHPR),
|
||||
_minTranslate(dof._minTranslate),
|
||||
_maxTranslate(dof._maxTranslate),
|
||||
_currentTranslate(dof._currentTranslate),
|
||||
_incrementTranslate(dof._incrementTranslate),
|
||||
_minScale(dof._minScale),
|
||||
_maxScale(dof._maxScale),
|
||||
_currentScale(dof._currentScale),
|
||||
_incrementScale(dof._incrementScale),
|
||||
_Put(dof._Put),
|
||||
_inversePut(dof._inversePut),
|
||||
_limitationFlags(dof._limitationFlags),
|
||||
_animationOn(dof._animationOn),
|
||||
_increasingFlags(dof._increasingFlags) {}
|
||||
|
||||
META_Node(osg, DOFTransform);
|
||||
|
||||
virtual DOFTransform* asDOFTransform() { return this; }
|
||||
virtual const DOFTransform* asDOFTransform() const { return this; }
|
||||
|
||||
virtual void traverse(NodeVisitor& nv);
|
||||
|
||||
void setMinHPR(const Vec3& hpr) { _minHPR = hpr;}
|
||||
const Vec3& getMinHPR() const { return _minHPR;}
|
||||
|
||||
void setMaxHPR(const Vec3& hpr) {_maxHPR = hpr;}
|
||||
const Vec3& getMaxHPR() const { return _maxHPR;}
|
||||
|
||||
void setIncrementHPR(const Vec3& hpr) {_incrementHPR = hpr;}
|
||||
const Vec3& getIncrementHPR() const { return _incrementHPR;}
|
||||
|
||||
void setCurrentHPR(const Vec3& hpr) {_currentHPR = hpr;}
|
||||
const Vec3& getCurrentHPR() const {return _currentHPR;}
|
||||
|
||||
void updateCurrentHPR(const Vec3& hpr);
|
||||
|
||||
|
||||
void setMinTranslate(const Vec3& translate) {_minTranslate = translate;}
|
||||
const Vec3& getMinTranslate() const { return _minTranslate;}
|
||||
|
||||
void setMaxTranslate(const Vec3& translate) {_maxTranslate = translate;}
|
||||
const Vec3& getMaxTranslate() const { return _maxTranslate;}
|
||||
|
||||
void setIncrementTranslate(const Vec3& translate) { _incrementTranslate = translate;}
|
||||
const Vec3& getIncrementTranslate() const { return _incrementTranslate;}
|
||||
|
||||
void setCurrentTranslate(const Vec3& translate){ _currentTranslate = translate;}
|
||||
inline const Vec3& getCurrentTranslate() const { return _currentTranslate;}
|
||||
|
||||
void updateCurrentTranslate(const Vec3& translate);
|
||||
|
||||
|
||||
void setMinScale(const Vec3& scale) { _minScale = scale;}
|
||||
const Vec3& getMinScale() const { return _minScale;}
|
||||
|
||||
void setMaxScale(const Vec3& scale) { _maxScale = scale;}
|
||||
const Vec3& getMaxScale() const { return _maxScale;}
|
||||
|
||||
void setIncrementScale(const Vec3& scale) { _incrementScale = scale;}
|
||||
const Vec3& getIncrementScale() const { return _incrementScale;}
|
||||
|
||||
void setCurrentScale(const Vec3& scale) { _currentScale = scale;}
|
||||
inline const Vec3& getCurrentScale() const { return _currentScale;}
|
||||
|
||||
void updateCurrentScale(const Vec3& scale);
|
||||
|
||||
|
||||
void setPutMatrix(const Matrix& put) { _Put = put;}
|
||||
inline const Matrix& getPutMatrix() const {return _Put;}
|
||||
|
||||
void setInversePutMatrix(const Matrix& inversePut) { _inversePut = inversePut;}
|
||||
inline const Matrix& getInversePutMatrix() const {return _inversePut;}
|
||||
|
||||
void setLimitationFlags(unsigned long flags) { _limitationFlags = flags;}
|
||||
inline unsigned long getLimitationFlags() const {return _limitationFlags;}
|
||||
|
||||
|
||||
inline void setAnimationOn(bool do_animate) {_animationOn = do_animate;}
|
||||
inline bool getAnimationOn() const {return _animationOn;}
|
||||
|
||||
void animate();
|
||||
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~DOFTransform() {}
|
||||
|
||||
Vec3 _minHPR;
|
||||
Vec3 _maxHPR;
|
||||
Vec3 _currentHPR;
|
||||
Vec3 _incrementHPR;
|
||||
|
||||
Vec3 _minTranslate;
|
||||
Vec3 _maxTranslate;
|
||||
Vec3 _currentTranslate;
|
||||
Vec3 _incrementTranslate;
|
||||
|
||||
Vec3 _minScale;
|
||||
Vec3 _maxScale;
|
||||
Vec3 _currentScale;
|
||||
Vec3 _incrementScale;
|
||||
|
||||
Matrix _Put;
|
||||
Matrix _inversePut;
|
||||
|
||||
unsigned long _limitationFlags;
|
||||
/* bits from left to right
|
||||
0 = x translation limited (2^31)
|
||||
1 = y translation limited (2^30)
|
||||
2 = z translation limited (2^29)
|
||||
3 = pitch limited (2^28)
|
||||
4 = roll limited (2^27)
|
||||
5 = yaw limited (2^26)
|
||||
6 = x scale limited (2^25)
|
||||
7 = y scale limited (2^24)
|
||||
8 = z scale limited (2^23)
|
||||
|
||||
else reserved
|
||||
*/
|
||||
|
||||
bool _animationOn;
|
||||
/** flags indicating whether value is incerasing or decreasing in animation
|
||||
bits form right to left, 1 means increasing while 0 is decreasing
|
||||
0 = x translation
|
||||
1 = y translation
|
||||
2 = z translation
|
||||
3 = pitch
|
||||
4 = roll
|
||||
5 = yaw
|
||||
6 = x scale
|
||||
7 = y scale
|
||||
8 = z scale
|
||||
*/
|
||||
unsigned short _increasingFlags;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -26,7 +26,6 @@ class LightSource;
|
||||
class ClipNode;
|
||||
class Group;
|
||||
class Transform;
|
||||
class DOFTransform;
|
||||
class MatrixTransform;
|
||||
class PositionAttitudeTransform;
|
||||
class Projection;
|
||||
@@ -226,7 +225,6 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
|
||||
virtual void apply(LightSource& node) { apply((Group&)node); }
|
||||
|
||||
virtual void apply(Transform& node) { apply((Group&)node); }
|
||||
virtual void apply(DOFTransform& node) { apply((Transform&)node); }
|
||||
virtual void apply(MatrixTransform& node) { apply((Transform&)node); }
|
||||
virtual void apply(PositionAttitudeTransform& node) { apply((Transform&)node); }
|
||||
|
||||
|
||||
@@ -84,9 +84,6 @@ class SG_EXPORT Transform : public Group
|
||||
virtual PositionAttitudeTransform* asPositionAttitudeTransform() { return 0; }
|
||||
virtual const PositionAttitudeTransform* asPositionAttitudeTransform() const { return 0; }
|
||||
|
||||
virtual DOFTransform* asDOFTransform() { return 0; }
|
||||
virtual const DOFTransform* asDOFTransform() const { return 0; }
|
||||
|
||||
enum ReferenceFrame
|
||||
{
|
||||
RELATIVE_TO_PARENTS,
|
||||
|
||||
174
include/osgSim/DOFTransform
Normal file
174
include/osgSim/DOFTransform
Normal file
@@ -0,0 +1,174 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGSIM_DOFTRANSFORM
|
||||
#define OSGSIM_DOFTRANSFORM 1
|
||||
|
||||
//base class:
|
||||
#include <osg/Transform>
|
||||
|
||||
#include <osgSim/Export>
|
||||
|
||||
namespace osgSim {
|
||||
|
||||
/** DOFTransform - encapsulates Multigen DOF behavior*/
|
||||
class OSGSIM_EXPORT DOFTransform : public osg::Transform
|
||||
{
|
||||
public:
|
||||
/** constructor*/
|
||||
DOFTransform();
|
||||
|
||||
/**copy constructor*/
|
||||
DOFTransform(const DOFTransform& dof, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
Transform(dof, copyop),
|
||||
_minHPR(dof._minHPR),
|
||||
_maxHPR(dof._maxHPR),
|
||||
_currentHPR(dof._currentHPR),
|
||||
_incrementHPR(dof._incrementHPR),
|
||||
_minTranslate(dof._minTranslate),
|
||||
_maxTranslate(dof._maxTranslate),
|
||||
_currentTranslate(dof._currentTranslate),
|
||||
_incrementTranslate(dof._incrementTranslate),
|
||||
_minScale(dof._minScale),
|
||||
_maxScale(dof._maxScale),
|
||||
_currentScale(dof._currentScale),
|
||||
_incrementScale(dof._incrementScale),
|
||||
_Put(dof._Put),
|
||||
_inversePut(dof._inversePut),
|
||||
_limitationFlags(dof._limitationFlags),
|
||||
_animationOn(dof._animationOn),
|
||||
_increasingFlags(dof._increasingFlags) {}
|
||||
|
||||
META_Node(osgSim, DOFTransform);
|
||||
|
||||
virtual void traverse(osg::NodeVisitor& nv);
|
||||
|
||||
void setMinHPR(const osg::Vec3& hpr) { _minHPR = hpr;}
|
||||
const osg::Vec3& getMinHPR() const { return _minHPR;}
|
||||
|
||||
void setMaxHPR(const osg::Vec3& hpr) {_maxHPR = hpr;}
|
||||
const osg::Vec3& getMaxHPR() const { return _maxHPR;}
|
||||
|
||||
void setIncrementHPR(const osg::Vec3& hpr) {_incrementHPR = hpr;}
|
||||
const osg::Vec3& getIncrementHPR() const { return _incrementHPR;}
|
||||
|
||||
void setCurrentHPR(const osg::Vec3& hpr) {_currentHPR = hpr;}
|
||||
const osg::Vec3& getCurrentHPR() const {return _currentHPR;}
|
||||
|
||||
void updateCurrentHPR(const osg::Vec3& hpr);
|
||||
|
||||
|
||||
void setMinTranslate(const osg::Vec3& translate) {_minTranslate = translate;}
|
||||
const osg::Vec3& getMinTranslate() const { return _minTranslate;}
|
||||
|
||||
void setMaxTranslate(const osg::Vec3& translate) {_maxTranslate = translate;}
|
||||
const osg::Vec3& getMaxTranslate() const { return _maxTranslate;}
|
||||
|
||||
void setIncrementTranslate(const osg::Vec3& translate) { _incrementTranslate = translate;}
|
||||
const osg::Vec3& getIncrementTranslate() const { return _incrementTranslate;}
|
||||
|
||||
void setCurrentTranslate(const osg::Vec3& translate){ _currentTranslate = translate;}
|
||||
inline const osg::Vec3& getCurrentTranslate() const { return _currentTranslate;}
|
||||
|
||||
void updateCurrentTranslate(const osg::Vec3& translate);
|
||||
|
||||
|
||||
void setMinScale(const osg::Vec3& scale) { _minScale = scale;}
|
||||
const osg::Vec3& getMinScale() const { return _minScale;}
|
||||
|
||||
void setMaxScale(const osg::Vec3& scale) { _maxScale = scale;}
|
||||
const osg::Vec3& getMaxScale() const { return _maxScale;}
|
||||
|
||||
void setIncrementScale(const osg::Vec3& scale) { _incrementScale = scale;}
|
||||
const osg::Vec3& getIncrementScale() const { return _incrementScale;}
|
||||
|
||||
void setCurrentScale(const osg::Vec3& scale) { _currentScale = scale;}
|
||||
inline const osg::Vec3& getCurrentScale() const { return _currentScale;}
|
||||
|
||||
void updateCurrentScale(const osg::Vec3& scale);
|
||||
|
||||
|
||||
void setPutMatrix(const osg::Matrix& put) { _Put = put;}
|
||||
inline const osg::Matrix& getPutMatrix() const {return _Put;}
|
||||
|
||||
void setInversePutMatrix(const osg::Matrix& inversePut) { _inversePut = inversePut;}
|
||||
inline const osg::Matrix& getInversePutMatrix() const {return _inversePut;}
|
||||
|
||||
void setLimitationFlags(unsigned long flags) { _limitationFlags = flags;}
|
||||
inline unsigned long getLimitationFlags() const {return _limitationFlags;}
|
||||
|
||||
|
||||
inline void setAnimationOn(bool do_animate) {_animationOn = do_animate;}
|
||||
inline bool getAnimationOn() const {return _animationOn;}
|
||||
|
||||
void animate();
|
||||
|
||||
virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const;
|
||||
|
||||
virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~DOFTransform() {}
|
||||
|
||||
osg::Vec3 _minHPR;
|
||||
osg::Vec3 _maxHPR;
|
||||
osg::Vec3 _currentHPR;
|
||||
osg::Vec3 _incrementHPR;
|
||||
|
||||
osg::Vec3 _minTranslate;
|
||||
osg::Vec3 _maxTranslate;
|
||||
osg::Vec3 _currentTranslate;
|
||||
osg::Vec3 _incrementTranslate;
|
||||
|
||||
osg::Vec3 _minScale;
|
||||
osg::Vec3 _maxScale;
|
||||
osg::Vec3 _currentScale;
|
||||
osg::Vec3 _incrementScale;
|
||||
|
||||
osg::Matrix _Put;
|
||||
osg::Matrix _inversePut;
|
||||
|
||||
unsigned long _limitationFlags;
|
||||
/* bits from left to right
|
||||
0 = x translation limited (2^31)
|
||||
1 = y translation limited (2^30)
|
||||
2 = z translation limited (2^29)
|
||||
3 = pitch limited (2^28)
|
||||
4 = roll limited (2^27)
|
||||
5 = yaw limited (2^26)
|
||||
6 = x scale limited (2^25)
|
||||
7 = y scale limited (2^24)
|
||||
8 = z scale limited (2^23)
|
||||
|
||||
else reserved
|
||||
*/
|
||||
|
||||
bool _animationOn;
|
||||
/** flags indicating whether value is incerasing or decreasing in animation
|
||||
bits form right to left, 1 means increasing while 0 is decreasing
|
||||
0 = x translation
|
||||
1 = y translation
|
||||
2 = z translation
|
||||
3 = pitch
|
||||
4 = roll
|
||||
5 = yaw
|
||||
6 = x scale
|
||||
7 = y scale
|
||||
8 = z scale
|
||||
*/
|
||||
unsigned short _increasingFlags;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -53,9 +53,9 @@ class OSGSIM_EXPORT LightPointNode : public osg::Node
|
||||
void removeLightPoint(unsigned int pos);
|
||||
|
||||
|
||||
LightPoint& getLightPoint(unsigned int pos) { return _lightPointList[pos]; }
|
||||
LightPoint& getLightPoint(unsigned int pos) { return _lightPointList[pos]; }
|
||||
|
||||
const LightPoint& getLightPoint(unsigned int pos) const { return _lightPointList[pos]; }
|
||||
const LightPoint& getLightPoint(unsigned int pos) const { return _lightPointList[pos]; }
|
||||
|
||||
|
||||
void setLightPointList(const LightPointList& lpl) { _lightPointList=lpl; }
|
||||
|
||||
@@ -26,7 +26,6 @@ CXXFILES =\
|
||||
CullStack.cpp\
|
||||
Depth.cpp\
|
||||
DisplaySettings.cpp\
|
||||
DOFTransform.cpp\
|
||||
Drawable.cpp\
|
||||
DrawPixels.cpp\
|
||||
ClearNode.cpp\
|
||||
|
||||
@@ -52,7 +52,7 @@ CXXFILES =\
|
||||
|
||||
INC += -I$(THISDIR)
|
||||
|
||||
LIBS += $(OSG_LIBS) $(OTHER_LIBS)
|
||||
LIBS += -losgSim $(OSG_LIBS) $(OTHER_LIBS)
|
||||
|
||||
TARGET_BASENAME = flt
|
||||
include $(TOPDIR)/Make/cygwin_plugin_def
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <osg/Image>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osg/DOFTransform>
|
||||
#include <osg/Sequence>
|
||||
|
||||
#include <osgDB/FileUtils>
|
||||
@@ -38,6 +37,8 @@
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include <osgSim/DOFTransform>
|
||||
|
||||
#include "opcodes.h"
|
||||
#include "flt.h"
|
||||
#include "flt2osg.h"
|
||||
@@ -800,7 +801,7 @@ osg::Group* ConvertFromFLT::visitDOF(osg::Group& osgParent, DofRecord* rec)
|
||||
|
||||
#if defined(USE_DOFTransform)
|
||||
|
||||
osg::DOFTransform* transform = new osg::DOFTransform;
|
||||
osgSim::DOFTransform* transform = new osgSim::DOFTransform;
|
||||
transform->setName(rec->getData()->szIdent);
|
||||
transform->setDataVariance(osg::Object::DYNAMIC);
|
||||
visitAncillary(osgParent, *transform, rec)->addChild( transform );
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "LOD.h"
|
||||
#include "PagedLOD.h"
|
||||
#include "PositionAttitudeTransform.h"
|
||||
#include "DOFTransform.h"
|
||||
#include "Transform.h"
|
||||
#include "Switch.h"
|
||||
#include "OccluderNode.h"
|
||||
@@ -184,6 +185,17 @@ long DataInputStream::readLong(){
|
||||
return l;
|
||||
}
|
||||
|
||||
unsigned long DataInputStream::readULong(){
|
||||
unsigned long l;
|
||||
_istream->read((char*)&l, LONGSIZE);
|
||||
if (_istream->rdstate() & _istream->failbit)
|
||||
throw Exception("DataInputStream::readULong(): Failed to read unsigned long value.");
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeULong() ["<<l<<"]"<<std::endl;
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
double DataInputStream::readDouble(){
|
||||
double d;
|
||||
_istream->read((char*)&d, DOUBLESIZE);
|
||||
@@ -623,6 +635,10 @@ osg::Node* DataInputStream::readNode()
|
||||
node = new osg::PositionAttitudeTransform();
|
||||
((ive::PositionAttitudeTransform*)(node))->read(this);
|
||||
}
|
||||
else if(nodeTypeID== IVEDOFTRANSFORM){
|
||||
node = new osgSim::DOFTransform();
|
||||
((ive::DOFTransform*)(node))->read(this);
|
||||
}
|
||||
else if(nodeTypeID== IVETRANSFORM){
|
||||
node = new osg::Transform();
|
||||
((ive::Transform*)(node))->read(this);
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
int peekInt();
|
||||
float readFloat();
|
||||
long readLong();
|
||||
unsigned long readULong();
|
||||
double readDouble();
|
||||
std::string readString();
|
||||
void readCharArray(char* data, int size);
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "LOD.h"
|
||||
#include "PagedLOD.h"
|
||||
#include "PositionAttitudeTransform.h"
|
||||
#include "DOFTransform.h"
|
||||
#include "Transform.h"
|
||||
#include "Switch.h"
|
||||
#include "OccluderNode.h"
|
||||
@@ -110,6 +111,12 @@ void DataOutputStream::writeLong(long l){
|
||||
if (_verboseOutput) std::cout<<"read/writeLong() ["<<l<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
void DataOutputStream::writeULong(unsigned long l){
|
||||
_ostream->write((char*)&l, LONGSIZE);
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeULong() ["<<l<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
void DataOutputStream::writeDouble(double d){
|
||||
_ostream->write((char*)&d, DOUBLESIZE);
|
||||
|
||||
@@ -500,6 +507,9 @@ void DataOutputStream::writeNode(const osg::Node* node)
|
||||
else if(dynamic_cast<const osg::PositionAttitudeTransform*>(node)){
|
||||
((ive::PositionAttitudeTransform*)(node))->write(this);
|
||||
}
|
||||
else if(dynamic_cast<const osgSim::DOFTransform*>(node)){
|
||||
((ive::DOFTransform*)(node))->write(this);
|
||||
}
|
||||
else if(dynamic_cast<const osg::LightSource*>(node)){
|
||||
((ive::LightSource*)(node))->write(this);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ public:
|
||||
void writeInt(int i);
|
||||
void writeFloat(float f);
|
||||
void writeLong(long l);
|
||||
void writeULong(unsigned long l);
|
||||
void writeDouble(double d);
|
||||
void writeString(const std::string& s);
|
||||
void writeCharArray(const char* data, int size);
|
||||
|
||||
@@ -12,6 +12,7 @@ CXXFILES =\
|
||||
CullFace.cpp\
|
||||
DataInputStream.cpp\
|
||||
DataOutputStream.cpp\
|
||||
DOFTransform.cpp\
|
||||
DrawArrayLengths.cpp\
|
||||
DrawArrays.cpp\
|
||||
DrawElementsUByte.cpp\
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "Image.h"
|
||||
#include "Object.h"
|
||||
|
||||
#include <osg/Notify>
|
||||
|
||||
using namespace ive;
|
||||
|
||||
void Image::write(DataOutputStream* out)
|
||||
@@ -40,7 +42,7 @@ void Image::write(DataOutputStream* out)
|
||||
out->writeInt(r());
|
||||
|
||||
|
||||
std::cout << getFileName()<<"\t"<<s()<<"\t"<<t()<<std::endl;
|
||||
osg::notify(osg::DEBUG_INFO) << "image written '" << getFileName()<<"'\t"<<s()<<"\t"<<t()<<std::endl;
|
||||
|
||||
// Write formats, type and packing
|
||||
out->writeInt(getInternalTextureFormat());
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace ive {
|
||||
#define IVECONVEXPLANAROCCLUDER 0x00000019
|
||||
#define IVECONVEXPLANARPOLYGON 0x00000020
|
||||
#define IVEPAGEDLOD 0x00000021
|
||||
#define IVEDOFTRANSFORM 0x00000022
|
||||
|
||||
// Node callbacks
|
||||
#define IVENODECALLBACK 0x00000050
|
||||
|
||||
@@ -12,7 +12,6 @@ CXXFILES =\
|
||||
CullFace.cpp\
|
||||
ClipNode.cpp\
|
||||
Depth.cpp\
|
||||
DOFTransform.cpp\
|
||||
Drawable.cpp\
|
||||
ClearNode.cpp\
|
||||
Fog.cpp\
|
||||
|
||||
@@ -91,7 +91,7 @@ bool Node_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
while (fr.matchSequence("description %s"))
|
||||
{
|
||||
node.addDescription(fr[1].getStr());
|
||||
if (fr[1].getStr()) node.addDescription(fr[1].getStr());
|
||||
fr+=2;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ TOPDIR = ../../..
|
||||
include $(TOPDIR)/Make/makedefs
|
||||
|
||||
CXXFILES =\
|
||||
IO_DOFTransform.cpp\
|
||||
IO_LightPointNode.cpp\
|
||||
IO_LightPoint.cpp\
|
||||
IO_BlinkSequence.cpp\
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "osg/DOFTransform"
|
||||
#include "osgSim/DOFTransform"
|
||||
|
||||
#include "osgDB/Registry"
|
||||
#include "osgDB/Input"
|
||||
#include "osgDB/Output"
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgSim;
|
||||
using namespace osgDB;
|
||||
using namespace std;
|
||||
|
||||
@@ -15,7 +16,7 @@ bool DOFTransform_writeLocalData(const Object& obj, Output& fw);
|
||||
// register the read and write functions with the osgDB::Registry.
|
||||
RegisterDotOsgWrapperProxy g_DOFTransformProxy
|
||||
(
|
||||
new osg::DOFTransform,
|
||||
new osgSim::DOFTransform,
|
||||
"DOFTransform",
|
||||
"Object Node Transform DOFTransform Group",
|
||||
&DOFTransform_readLocalData,
|
||||
@@ -4,6 +4,7 @@ include $(TOPDIR)/Make/makedefs
|
||||
|
||||
CXXFILES = \
|
||||
ColorRange.cpp\
|
||||
DOFTransform.cpp\
|
||||
ScalarBar.cpp\
|
||||
ScalarsToColors.cpp\
|
||||
BlinkSequence.cpp\
|
||||
|
||||
Reference in New Issue
Block a user