replaced "if (apm || !apm->valid())"

This commit is contained in:
Laurens Voerman 2019-05-21 13:28:41 +02:00
parent a9590ab80b
commit 6a8f4ad818
4 changed files with 4 additions and 4 deletions

View File

@ -112,7 +112,7 @@ int main(int argc, char** argv)
while (arguments.read("-p",pathfile)) while (arguments.read("-p",pathfile))
{ {
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid()) if (apm && !apm->getAnimationPath()->empty())
{ {
apm->setTimeScale(animationSpeed); apm->setTimeScale(animationSpeed);

View File

@ -484,7 +484,7 @@ int main( int argc, char **argv )
while (arguments.read("-p",pathfile)) while (arguments.read("-p",pathfile))
{ {
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid()) if (apm && !apm->getAnimationPath()->empty())
{ {
unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );

View File

@ -113,7 +113,7 @@ int main(int argc, char** argv)
while (arguments.read("-p",pathfile)) while (arguments.read("-p",pathfile))
{ {
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid()) if (apm && !apm->getAnimationPath()->empty())
{ {
apm->setTimeScale(animationSpeed); apm->setTimeScale(animationSpeed);

View File

@ -113,7 +113,7 @@ int main(int argc, char** argv)
while (arguments.read("-p",pathfile)) while (arguments.read("-p",pathfile))
{ {
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid()) if (apm && !apm->getAnimationPath()->empty())
{ {
apm->setTimeScale(animationSpeed); apm->setTimeScale(animationSpeed);