segmentation fault whenever any method from a class instance of ofEasyCam called

Hi. I just downloaded openFrameworks for my ubuntu 12.04 x64 machine, and I’m trying to write a 3D app that uses an ofEasyCam. However, any time that I try to call a method of ofEasyCam - setTarget, begin, setDistance, they all result in a segmentation fault. When I run it in debug mode (this is in code::blocks) I end up with a cursor pointing to onPositionChanged, in the function ofNode::setPosition. I’m new to code::blocks, so I have no idea what this means.

update: a regular node has this problem as well, if I have a public ofNode and then call myNode.setPosition(0, 0, 0); in testApp::setup(), I get a segmentation fault.

Hey Ectheow, Are you using the version from github or the one downloaded from openframeworks.cc?

The one from openframeworks.cc

I would give the github one a try as I would think a bug that big would be patched by now. I am not sure if the one on openframeworks.cc gets mirrored from master yet

OK, I did that but I’m still having problems. It looks like the program stops whenever ofGetGlobalTransformMatrix is called.

Somehow the ofEasyCam thinks it has a parent, though it doesn’t. This line:

  
if(parent) return getLocalTransformMatrix() * parent->getGlobalTransformMatrix();  

calls the parent pointer if it exists, which it seems to, but it’s uninitialized. I’d walk through how the ofCamera instance is set up, particularly watching setParent() and see if you can find out what’s going wrong.