@Wenzy90 wrote:
I made a very simple class to test ofNode.But i met a strange crash problem~
class MyNodeClass{ public: ofNode nodeA,nodeB; MyNodeClass(){ nodeA.setPosition(ofVec3f(0,0,0)); nodeB.setPosition(ofVec3f(0,100,0)); nodeB.setParent(nodeA); } void draw(){ nodeA.draw(); nodeB.draw(); } }; // in ofApp:-------------------------------------------------------------- void ofApp::setup(){ } //-------------------------------------------------------------- void ofApp::update(){ } //-------------------------------------------------------------- void ofApp::draw(){ ofBackground(0); cam.begin(); myNode.draw(); cam.end(); } //-------------------------------------------------------------- void ofApp::keyPressed(int key){ myNode = MyNodeClass(); }
When i run the program.Everything is fine until i pressed the keyboard.
It shows the problem in “children”. Did i missed something?
Environment:Xcode9 - OF0.98 - macOs Mojave
Posts: 1
Participants: 1