Carsten Neumann schrieb:

unfortunately no, but could you post your code or attach your .h/.cpp
file, please ?

        Thanks,
                Carsten

sure, should have done that in the first place. here it is,

greets, robin
#ifndef _LEG_H_
#define _LEG_H_
#pragma once
#endif


#include <OpenSG/OSGConfig.h>
#include <OpenSG/OSGSceneFileHandler.h>
#include <iostream>
#include <ant.h>
#include <helper.h>
#include <world.h>
#include <OpenSG/OSGGeoFunctions.h>
#include <OpenSG/OSGSwitch.h>
#include <OpenSG/OSGSceneFileHandler.h>
#include <OpenSG/OSGSimpleAttachments.h>


using namespace std;
OSG_USING_NAMESPACE
extern Ant* myAnt;

class Leg {

        public:
                Leg();
                void setRotation();

        private:
                Helper* load;
                void setupLeg(std::string jointFilename);
                NodePtr tempLeg;
                std::vector<OSG::GeometryPtr> legGeoNodes;
                std::vector<OSG::GeometryPtr> linkGeoNodes;
                std::vector<OSG::TransformPtr> linkTransform;
                std::vector<OSG::NodePtr> linkTransformNodes;
                        
                Action::ResultE enter(NodePtr& node) { 

                        OSG::GeometryPtr g=OSG::NullFC; 

                        if (getName(node)) {

                                cout << getName(node) << endl;
                        }
                        else {

                                cout << "No name was set!" << endl;
                        }

                        return Action::Continue; 
                }
};
#include <leg.h>

Leg::Leg() {

        load = new Helper;
        std::string jFile="object/output.bin";
        setupLeg(jFile.c_str());
        //saveJoint();

}

//Actions

//Action::ResultE isLegGeo(NodePtr& node) {
//      
//      OSG::GeometryPtr g=OSG::NullFC;
//
//      
if(node.getCore()->getType().isDerivedFrom(OSG::Geometry::getClassType())) {
//
//              if(getName(node)) {
//                      if(getName(node) == "LegGeo") {
//                              
//                              g=OSG::GeometryPtr::dcast(node->getCore());
//                              legGeoNodes.push_back(g);
//                      }
//              }
//      }
//      return Action::Continue;
//}
//
//Action::ResultE isLinkGeo(NodePtr& node) {
//      
//      OSG::GeometryPtr g=OSG::NullFC;
//
//      
if(node.getCore()->getType().isDerivedFrom(OSG::Geometry::getClassType())) {
//
//              if(getName(node)) {
//                      if(getName(node) == "LinkGeo") {
//                              
//                              g=OSG::GeometryPtr::dcast(node->getCore());
//                              linkGeoNodes.push_back(g);
//                      }
//              }
//      }
//      return Action::Continue;
//}
//
//Action::ResultE isLinkTrans(NodePtr& node) {
//      
//      OSG::NodePtr tempTransNode=OSG::NullFC;
//      OSG::NodeCorePtr tempTransCore=OSG::NullFC;
//      OSG::TransformPtr tempTrans=OSG::NullFC;
//
//      
if(node.getCore()->getType().isDerivedFrom(OSG::NodePtr::getClassType())) {
//
//              if(getName(node)) {
//                      if(getName(node) == "LinkTransformNode") {
//                              
//                              tempTransNode = OSG::NodePtr::dcast(node);
//                              tempTransCore = node->getCore();
//                              tempTrans = 
OSG::TransformPtr::dcast(tempTransCore);
//                              linkTransformNodes.push_back(tempTransNode);
//                              linkTransform.push_back(tempTrans);
//                      }
//              }
//      }
//      return Action::Continue;
//}



void Leg::setupLeg(std::string legFilename) {

        tempLeg = load->loadObject(legFilename);        
        
        traverse(tempLeg, 
             osgTypedFunctionFunctor1CPtrRef
             <Action::ResultE, NodePtr>(enter));
        
        myAnt->setChildLeg(linkTransformNodes[0]);
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to