Page 1 of 1

[2.1] camera->_getManager() returns NULL

Posted: Sun Mar 11, 2018 2:47 pm
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?

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

Posted: Mon Mar 12, 2018 9:49 pm
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)