mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 04:03:59 +02:00
cleanup Leapmotion initialization removes warning
about unused variable
This commit is contained in:
parent
85bfcf0eea
commit
456a3c3739
3 changed files with 21 additions and 20 deletions
|
@ -1722,7 +1722,7 @@ void Application::init() {
|
|||
_faceplus.init();
|
||||
_visage.init();
|
||||
|
||||
Leapmotion* leap = Leapmotion::create();
|
||||
Leapmotion::init();
|
||||
|
||||
// fire off an immediate domain-server check in now that settings are loaded
|
||||
NodeList::getInstance()->sendDomainServerCheckIn();
|
||||
|
|
|
@ -36,27 +36,26 @@ MotionTracker::Index evalJointIndex(bool isRightSide, int finger, int bone) {
|
|||
}
|
||||
}
|
||||
|
||||
Leapmotion* Leapmotion::create() {
|
||||
// check that the Leapmotion hasn't been created yet
|
||||
// static
|
||||
void Leapmotion::init() {
|
||||
DeviceTracker* device = DeviceTracker::getDevice(NAME);
|
||||
|
||||
if (!device) {
|
||||
// create a new Leapmotion and register it
|
||||
Leapmotion* leap = new Leapmotion();
|
||||
DeviceTracker::registerDevice(NAME, leap);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
Leapmotion* Leapmotion::getInstance() {
|
||||
DeviceTracker* device = DeviceTracker::getDevice(NAME);
|
||||
if (!device) {
|
||||
// create a new Leapmotion
|
||||
Leapmotion* leap = new Leapmotion();
|
||||
|
||||
// register it
|
||||
DeviceTracker::registerDevice(NAME, leap);
|
||||
|
||||
return leap;
|
||||
}
|
||||
else
|
||||
{
|
||||
Leapmotion* leap = dynamic_cast< Leapmotion* > (device);
|
||||
if (leap) {
|
||||
return leap;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
// create a new Leapmotion and register it
|
||||
device = new Leapmotion();
|
||||
DeviceTracker::registerDevice(NAME, device);
|
||||
}
|
||||
return dynamic_cast< Leapmotion* > (device);
|
||||
}
|
||||
|
||||
Leapmotion::Leapmotion() :
|
||||
|
|
|
@ -25,8 +25,10 @@ class Leapmotion : public MotionTracker {
|
|||
public:
|
||||
static const Name NAME;
|
||||
|
||||
static void init();
|
||||
|
||||
/// Leapmotion MotionTracker factory
|
||||
static Leapmotion* create();
|
||||
static Leapmotion* getInstance();
|
||||
|
||||
bool isActive() const { return _active; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue