how to check if a Mogre::SceneNode is null?

Munki

01-06-2011 00:21:49

I want to know if a camera is tracking an object so I use:

isTracking = camera->AutoTrackTarget==nullptr;


and I get a compiler error:

error C2593: 'operator ==' is ambiguous
could be 'built-in C++ operator==(Ogre::SceneNode *, Ogre::SceneNode *)'
or 'built-in C++ operator==(Ogre::Node *, Ogre::Node *)'
while trying to match the argument list '(Mogre::SceneNode ^, nullptr)'


just wondering if this is a bug with mogre, as it's valid managed c++

Tubulii

20-06-2011 08:18:32

never tried autotracking but what about:

isTracking == camera.autotarget != null
or VB.net:
isTracking = camera.autotarget isnot nothing

smiley80

20-06-2011 11:09:03

isTracking = Object::ReferenceEquals(camera->AutoTrackTarget, nullptr);