Merge pull request #44261 from madmiraal/rename-trackerhand-enums
Rename TrackerHand enums
This commit is contained in:
commit
bccbd4be90
@ -101,10 +101,10 @@
|
|||||||
<constant name="TRACKER_HAND_UNKNOWN" value="0" enum="TrackerHand">
|
<constant name="TRACKER_HAND_UNKNOWN" value="0" enum="TrackerHand">
|
||||||
The hand this tracker is held in is unknown or not applicable.
|
The hand this tracker is held in is unknown or not applicable.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="TRACKER_LEFT_HAND" value="1" enum="TrackerHand">
|
<constant name="TRACKER_HAND_LEFT" value="1" enum="TrackerHand">
|
||||||
This tracker is the left hand controller.
|
This tracker is the left hand controller.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="TRACKER_RIGHT_HAND" value="2" enum="TrackerHand">
|
<constant name="TRACKER_HAND_RIGHT" value="2" enum="TrackerHand">
|
||||||
This tracker is the right hand controller.
|
This tracker is the right hand controller.
|
||||||
</constant>
|
</constant>
|
||||||
</constants>
|
</constants>
|
||||||
|
@ -305,9 +305,9 @@ godot_int GDAPI godot_xr_add_controller(char *p_device_name, godot_int p_hand, g
|
|||||||
new_tracker->set_name(p_device_name);
|
new_tracker->set_name(p_device_name);
|
||||||
new_tracker->set_type(XRServer::TRACKER_CONTROLLER);
|
new_tracker->set_type(XRServer::TRACKER_CONTROLLER);
|
||||||
if (p_hand == 1) {
|
if (p_hand == 1) {
|
||||||
new_tracker->set_hand(XRPositionalTracker::TRACKER_LEFT_HAND);
|
new_tracker->set_hand(XRPositionalTracker::TRACKER_HAND_LEFT);
|
||||||
} else if (p_hand == 2) {
|
} else if (p_hand == 2) {
|
||||||
new_tracker->set_hand(XRPositionalTracker::TRACKER_RIGHT_HAND);
|
new_tracker->set_hand(XRPositionalTracker::TRACKER_HAND_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// also register as joystick...
|
// also register as joystick...
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
|
|
||||||
void XRPositionalTracker::_bind_methods() {
|
void XRPositionalTracker::_bind_methods() {
|
||||||
BIND_ENUM_CONSTANT(TRACKER_HAND_UNKNOWN);
|
BIND_ENUM_CONSTANT(TRACKER_HAND_UNKNOWN);
|
||||||
BIND_ENUM_CONSTANT(TRACKER_LEFT_HAND);
|
BIND_ENUM_CONSTANT(TRACKER_HAND_LEFT);
|
||||||
BIND_ENUM_CONSTANT(TRACKER_RIGHT_HAND);
|
BIND_ENUM_CONSTANT(TRACKER_HAND_RIGHT);
|
||||||
|
|
||||||
// this class is read only from GDScript, so we only have access to getters..
|
// this class is read only from GDScript, so we only have access to getters..
|
||||||
ClassDB::bind_method(D_METHOD("get_tracker_type"), &XRPositionalTracker::get_tracker_type);
|
ClassDB::bind_method(D_METHOD("get_tracker_type"), &XRPositionalTracker::get_tracker_type);
|
||||||
@ -182,11 +182,11 @@ void XRPositionalTracker::set_hand(const XRPositionalTracker::TrackerHand p_hand
|
|||||||
ERR_FAIL_COND((type != XRServer::TRACKER_CONTROLLER) && (p_hand != XRPositionalTracker::TRACKER_HAND_UNKNOWN));
|
ERR_FAIL_COND((type != XRServer::TRACKER_CONTROLLER) && (p_hand != XRPositionalTracker::TRACKER_HAND_UNKNOWN));
|
||||||
|
|
||||||
hand = p_hand;
|
hand = p_hand;
|
||||||
if (hand == XRPositionalTracker::TRACKER_LEFT_HAND) {
|
if (hand == XRPositionalTracker::TRACKER_HAND_LEFT) {
|
||||||
if (!xr_server->is_tracker_id_in_use_for_type(type, 1)) {
|
if (!xr_server->is_tracker_id_in_use_for_type(type, 1)) {
|
||||||
tracker_id = 1;
|
tracker_id = 1;
|
||||||
};
|
};
|
||||||
} else if (hand == XRPositionalTracker::TRACKER_RIGHT_HAND) {
|
} else if (hand == XRPositionalTracker::TRACKER_HAND_RIGHT) {
|
||||||
if (!xr_server->is_tracker_id_in_use_for_type(type, 2)) {
|
if (!xr_server->is_tracker_id_in_use_for_type(type, 2)) {
|
||||||
tracker_id = 2;
|
tracker_id = 2;
|
||||||
};
|
};
|
||||||
|
@ -50,8 +50,8 @@ class XRPositionalTracker : public Object {
|
|||||||
public:
|
public:
|
||||||
enum TrackerHand {
|
enum TrackerHand {
|
||||||
TRACKER_HAND_UNKNOWN, /* unknown or not applicable */
|
TRACKER_HAND_UNKNOWN, /* unknown or not applicable */
|
||||||
TRACKER_LEFT_HAND, /* controller is the left hand controller */
|
TRACKER_HAND_LEFT, /* controller is the left hand controller */
|
||||||
TRACKER_RIGHT_HAND /* controller is the right hand controller */
|
TRACKER_HAND_RIGHT /* controller is the right hand controller */
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user