From Joakim Simonsson:
"DOFAnimation's default state could now be controlled by the RW option.
The option string is "dofAnimation"
If the option string is omitted the default animation state is off."
This commit is contained in:
@@ -27,11 +27,15 @@ FltFile::FltFile(
|
||||
MaterialPool* pMaterialPool,
|
||||
LtPtAppearancePool* pLtPtAppearancePool,
|
||||
LtPtAnimationPool* pLtPtAnimationPool,
|
||||
osgDB::ReaderWriter::Options* options)
|
||||
osgDB::ReaderWriter::Options* options):
|
||||
_useTextureAlphaForTransparancyBinning(true),
|
||||
_doUnitsConversion(true),
|
||||
_defaultDOFAnimationState(false),
|
||||
_desiredUnits(ConvertToMeters)
|
||||
{
|
||||
_useTextureAlphaForTransparancyBinning = true;
|
||||
_doUnitsConversion = true;
|
||||
_desiredUnits = ConvertToMeters;
|
||||
|
||||
|
||||
|
||||
|
||||
if (pColorPool)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ class FltFile : public osg::Referenced
|
||||
MaterialPool* pMaterialPool = NULL,
|
||||
LtPtAppearancePool* pLtPtAppearancePool = NULL,
|
||||
LtPtAnimationPool* pLtPtAnimationPool = NULL,
|
||||
osgDB::ReaderWriter::Options* options =NULL);
|
||||
osgDB::ReaderWriter::Options* options = NULL);
|
||||
|
||||
virtual osg::Object* readObject(const std::string& fileName);
|
||||
virtual osg::Node* readNode(const std::string& fileName);
|
||||
@@ -70,6 +70,9 @@ class FltFile : public osg::Referenced
|
||||
FltFile::ConvertUnits getDesiredUnits() const { return _desiredUnits; }
|
||||
std::string getDesiredUnitsString() const;
|
||||
|
||||
void setDefaultDOFAnimationState(bool defaultDOFAnimationState) { _defaultDOFAnimationState = defaultDOFAnimationState; }
|
||||
bool getDefaultDOFAnimationState() const { return _defaultDOFAnimationState; }
|
||||
|
||||
int getFlightVersion() const;
|
||||
inline HeaderRecord* getHeaderRecord() { return _headerRecord.get(); }
|
||||
void getOrigin( double& latitude, double& longitude ) const;
|
||||
@@ -95,6 +98,7 @@ class FltFile : public osg::Referenced
|
||||
bool _useInternalLtPtPalettes;
|
||||
bool _useTextureAlphaForTransparancyBinning;
|
||||
bool _doUnitsConversion;
|
||||
bool _defaultDOFAnimationState; //< Default DOF Animation state
|
||||
ConvertUnits _desiredUnits;
|
||||
|
||||
std::string _directory;
|
||||
|
||||
@@ -91,8 +91,6 @@
|
||||
static int dprint = 0 ;
|
||||
#define DPRINT if(dprint)fprintf
|
||||
|
||||
#define USE_PROXYNODE_FOR_EXTERNAL_FILES
|
||||
|
||||
using namespace flt;
|
||||
|
||||
unsigned int mystrnlen(char *s, unsigned int maxLen)
|
||||
@@ -1103,6 +1101,9 @@ osg::Group* ConvertFromFLT::visitDOF(osg::Group& osgParent, DofRecord* rec)
|
||||
p_data->dfYscale._dfIncrement,
|
||||
p_data->dfZscale._dfIncrement));
|
||||
|
||||
// default DOF animation state
|
||||
transform->setAnimationOn(rec->getFltFile()->getDefaultDOFAnimationState());
|
||||
|
||||
// compute the put matrix.
|
||||
osg::Vec3 O ( p_data->OriginLocalDOF.x(),
|
||||
p_data->OriginLocalDOF.y(),
|
||||
|
||||
Reference in New Issue
Block a user