History

Support for LeapMotion and worklist 19734

- Introduce the DeviceTracker class to abstract all the possible devices - Introduce the MotionTracker ( a DeviceTracker ) that contains a transform tree of joints - Add Leapmotion class as a MotionTracker and the support for the Leapmotion sdk in external - Add InputController as the abstraction of a MotionTracker/Joint for Javascript

samcake committed 12 years ago

Commit 3ce455a1 parent fe0374333 files · +7810 −197Browse files

Showing the changes to libraries/script-engine/src/EventTypes.cpp (1 of 33 files). Show all

Unified · Split

libraries/script-engine/src/EventTypes.cpp+32−0
@@ -19,6 +19,7 @@ void registerEventTypes(QScriptEngine* engine) { · 18 unmodified lines
1919 qScriptRegisterMetaType(engine, mouseEventToScriptValue, mouseEventFromScriptValue);
2020 qScriptRegisterMetaType(engine, touchEventToScriptValue, touchEventFromScriptValue);
2121 qScriptRegisterMetaType(engine, wheelEventToScriptValue, wheelEventFromScriptValue);
22+ qScriptRegisterMetaType(engine, spatialEventToScriptValue, spatialEventFromScriptValue);
2223 }
2324
2425 KeyEvent::KeyEvent() :
@@ -600,3 +601,34 @@ void wheelEventFromScriptValue(const QScriptValue& object, WheelEvent& event) { · 575 unmodified lines
600601 }
601602
602603
604+
605+SpatialEvent::SpatialEvent() :
606+ locTranslation(0.0f),
607+ locRotation(),
608+ absTranslation(0.0f),
609+ absRotation()
610+{
611+};
612+
613+SpatialEvent::SpatialEvent(const SpatialEvent& event) {
614+ locTranslation = event.locTranslation;
615+ locRotation = event.locRotation;
616+ absTranslation = event.absTranslation;
617+ absRotation = event.absRotation;
618+}
619+
620+
621+QScriptValue spatialEventToScriptValue(QScriptEngine* engine, const SpatialEvent& event) {
622+ QScriptValue obj = engine->newObject();
623+
624+ obj.setProperty("locTranslation", vec3toScriptValue(engine, event.locTranslation) );
625+ obj.setProperty("locRotation", quatToScriptValue(engine, event.locRotation) );
626+ obj.setProperty("absTranslation", vec3toScriptValue(engine, event.absTranslation) );
627+ obj.setProperty("absRotation", quatToScriptValue(engine, event.absRotation) );
628+
629+ return obj;
630+}
631+
632+void spatialEventFromScriptValue(const QScriptValue& object,SpatialEvent& event) {
633+ // nothing for now...
634+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t