Example of a custom defined GeoNode:
// MyGeoNode.h #include "nvsg/GeoNode.h" // base class definition class MyGeoNode : public nvsg::GeoNode { public: MyGeoNode(); //... };
Choosing an object code lower than nvsg::OC_CUSTOMOBJECT for a custom-defined NVSG object results in undefined runtime behavior!
Example of custom object code definitions:
// MyObjectCodes.h #include "nvsg/Object.h" // object code defines enum { OC_MYGEONODE = OC_CUSTOMOBJECT , OC_MYGEOSET // = OC_CUSTOMOBJECT+1 , OC_MYMATERIAL // = OC_CUSTOMOBJECT+2 }; // ...
It is best to assign the unique object code at the object's construction time:
// MyGeoNode.cpp #include "MyGeoNode.h" // MyGeoNode definition #include "MyObjectCodes.h" // custom object codes using namespace nvsg; MyGeoNode::MyGeoNode() { // assign the unique object code m_objectCode = OC_MYGEONODE; }
Back to