[2.1] camera->_getManager() returns NULL

Minor issues with the Ogre API that can be trivial to fix
Shimayama
Halfling
Posts: 74
Joined: Sat Apr 25, 2009 2:20 pm
Location: Norway
x 1

[2.1] camera->_getManager() returns NULL

Post by Shimayama »

1. Is there a reason that Camera (actually Frustum also) does not set mManager of base class during constuction, as most other MovableObject types do?

It is convenient to be able to use using _getManager() to know which scene manager to call destroyEntity on when just having an Entity pointer, but it is not possible with Camera.

Code: Select all

    Camera::Camera( IdType id, ObjectMemoryManager *objectMemoryManager, SceneManager* sm )
        : Frustum( id, objectMemoryManager ),

Code: Select all

    Frustum::Frustum( IdType id, ObjectMemoryManager *objectMemoryManager ) : 
        MovableObject( id, objectMemoryManager, (SceneManager*)0, 1 ),
2. If that is intended, then I guess it is not valid for the user to call camera->_notifyManager(sceneManager) after createCamera, as a workaround?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5429
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1337

Re: [2.1] camera->_getManager() returns NULL

Post by dark_sylinc »

Looks like a bug indeed, but careful with the fix: it may be hiding another bug (i.e. another place of Ogre checking if _getManager() is null to follow a different path)