Hi all,
I’m running in to an issue when I try to create a camera component on a child node (in C++). Here’s code that works:
[code] // Create the camera
cameraNode_ = scene_->CreateChild(“OrbitCamera”);
orbit_cam_ = cameraNode_->CreateComponent();
child_node = scene_->CreateChild(“CamNode”);
Camera* camera_ = cameraNode_->CreateComponent<Camera>(); //NOTE: creating a camera on this node works fine
[/code]
However, when I change the code so that I create the camera on a child node of ‘cameraNode’, I get a black screen:
[code] // Create the camera
cameraNode_ = scene_->CreateChild(“OrbitCamera”);
orbit_cam_ = cameraNode_->CreateComponent();
child_node = scene_->CreateChild(“CamNode”);
Camera* camera_ = child_node ->CreateComponent<Camera>(); //NOTE: creating a camera now gives me a black screen
[/code]
Can’t figure it out. Btw, having a camera on a child object is very useful for 3d Camera rigs (i.e. the parent node is the Pivot point), I would like to get this working. Also, this code is just running in the standard CreateScene method, taken almost verbatim out of the samples.