mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 07:23:39 +02:00
Visage toggle bits.
This commit is contained in:
parent
5b30f932c1
commit
fc32d9581d
5 changed files with 42 additions and 24 deletions
|
@ -113,18 +113,18 @@
|
||||||
<context>
|
<context>
|
||||||
<name>Menu</name>
|
<name>Menu</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/Menu.cpp" line="422"/>
|
<location filename="src/Menu.cpp" line="427"/>
|
||||||
<source>Open .ini config file</source>
|
<source>Open .ini config file</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/Menu.cpp" line="424"/>
|
<location filename="src/Menu.cpp" line="429"/>
|
||||||
<location filename="src/Menu.cpp" line="436"/>
|
<location filename="src/Menu.cpp" line="441"/>
|
||||||
<source>Text files (*.ini)</source>
|
<source>Text files (*.ini)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/Menu.cpp" line="434"/>
|
<location filename="src/Menu.cpp" line="439"/>
|
||||||
<source>Save .ini config file</source>
|
<source>Save .ini config file</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -270,11 +270,16 @@ Menu::Menu() :
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(avatarOptionsMenu, MenuOption::LookAtVectors, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarOptionsMenu, MenuOption::LookAtVectors, 0, false);
|
||||||
addCheckableActionToQMenuAndActionHash(avatarOptionsMenu,
|
addCheckableActionToQMenuAndActionHash(avatarOptionsMenu,
|
||||||
MenuOption::FaceshiftTCP,
|
MenuOption::Faceshift,
|
||||||
0,
|
0,
|
||||||
false,
|
true,
|
||||||
appInstance->getFaceshift(),
|
appInstance->getFaceshift(),
|
||||||
SLOT(setTCPEnabled(bool)));
|
SLOT(setTCPEnabled(bool)));
|
||||||
|
#ifdef HAVE_VISAGE
|
||||||
|
addCheckableActionToQMenuAndActionHash(avatarOptionsMenu, MenuOption::Visage, 0, true,
|
||||||
|
appInstance->getVisage(), SLOT(setEnabled(bool)));
|
||||||
|
#endif
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(avatarOptionsMenu, MenuOption::ChatCircling, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarOptionsMenu, MenuOption::ChatCircling, 0, false);
|
||||||
|
|
||||||
QMenu* handOptionsMenu = developerMenu->addMenu("Hand Options");
|
QMenu* handOptionsMenu = developerMenu->addMenu("Hand Options");
|
||||||
|
|
|
@ -239,7 +239,7 @@ namespace MenuOption {
|
||||||
const QString DontFadeOnVoxelServerChanges = "Don't Fade In/Out on Voxel Server Changes";
|
const QString DontFadeOnVoxelServerChanges = "Don't Fade In/Out on Voxel Server Changes";
|
||||||
const QString HeadMouse = "Head Mouse";
|
const QString HeadMouse = "Head Mouse";
|
||||||
const QString HandsCollideWithSelf = "Collide With Self";
|
const QString HandsCollideWithSelf = "Collide With Self";
|
||||||
const QString FaceshiftTCP = "Faceshift (TCP)";
|
const QString Faceshift = "Faceshift";
|
||||||
const QString FirstPerson = "First Person";
|
const QString FirstPerson = "First Person";
|
||||||
const QString FrameTimer = "Show Timer";
|
const QString FrameTimer = "Show Timer";
|
||||||
const QString FrustumRenderMode = "Render Mode";
|
const QString FrustumRenderMode = "Render Mode";
|
||||||
|
@ -292,6 +292,7 @@ namespace MenuOption {
|
||||||
const QString StopAllScripts = "Stop All Scripts";
|
const QString StopAllScripts = "Stop All Scripts";
|
||||||
const QString TestPing = "Test Ping";
|
const QString TestPing = "Test Ping";
|
||||||
const QString TransmitterDrive = "Transmitter Drive";
|
const QString TransmitterDrive = "Transmitter Drive";
|
||||||
|
const QString Visage = "Visage";
|
||||||
const QString Quit = "Quit";
|
const QString Quit = "Quit";
|
||||||
const QString Voxels = "Voxels";
|
const QString Voxels = "Voxels";
|
||||||
const QString VoxelMode = "Cycle Voxel Mode";
|
const QString VoxelMode = "Cycle Voxel Mode";
|
||||||
|
|
|
@ -40,25 +40,11 @@ Visage::Visage() :
|
||||||
#ifdef HAVE_VISAGE
|
#ifdef HAVE_VISAGE
|
||||||
QByteArray licensePath = Application::resourcesPath().toLatin1() + "visage/license.vlc";
|
QByteArray licensePath = Application::resourcesPath().toLatin1() + "visage/license.vlc";
|
||||||
initializeLicenseManager(licensePath.data());
|
initializeLicenseManager(licensePath.data());
|
||||||
_tracker = new VisageTracker2(Application::resourcesPath().toLatin1() + "visage/tracker.cfg");
|
|
||||||
if (_tracker->trackFromCam()) {
|
|
||||||
_data = new FaceData();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
delete _tracker;
|
|
||||||
_tracker = NULL;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Visage::~Visage() {
|
Visage::~Visage() {
|
||||||
#ifdef HAVE_VISAGE
|
setEnabled(false);
|
||||||
if (_tracker) {
|
|
||||||
_tracker->stop();
|
|
||||||
delete _tracker;
|
|
||||||
delete _data;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_VISAGE
|
#ifdef HAVE_VISAGE
|
||||||
|
@ -160,3 +146,23 @@ void Visage::update() {
|
||||||
void Visage::reset() {
|
void Visage::reset() {
|
||||||
_headOrigin += _headTranslation / TRANSLATION_SCALE;
|
_headOrigin += _headTranslation / TRANSLATION_SCALE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Visage::setEnabled(bool enabled) {
|
||||||
|
#ifdef HAVE_VISAGE
|
||||||
|
if (enabled == (_tracker != NULL)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (enabled) {
|
||||||
|
_tracker = new VisageTracker2(Application::resourcesPath().toLatin1() + "visage/tracker.cfg");
|
||||||
|
_data = new FaceData();
|
||||||
|
if (_tracker->trackFromCam()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_tracker->stop();
|
||||||
|
delete _tracker;
|
||||||
|
delete _data;
|
||||||
|
_tracker = NULL;
|
||||||
|
_data = NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -24,11 +24,13 @@ namespace VisageSDK {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handles input from the Visage webcam feature tracking software.
|
/// Handles input from the Visage webcam feature tracking software.
|
||||||
class Visage {
|
class Visage : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Visage();
|
Visage();
|
||||||
~Visage();
|
virtual ~Visage();
|
||||||
|
|
||||||
bool isActive() const { return _active; }
|
bool isActive() const { return _active; }
|
||||||
|
|
||||||
|
@ -42,6 +44,10 @@ public:
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
void setEnabled(bool enabled);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue