Explorar o código

Merge pull request #68384 from cheece/expose_get_transform_for_eye

expose ARVRInterface::get_transform_for_eye to gdscript
Rémi Verschelde %!s(int64=2) %!d(string=hai) anos
pai
achega
322bfec275
Modificáronse 2 ficheiros con 9 adicións e 0 borrados
  1. 8 0
      doc/classes/ARVRInterface.xml
  2. 1 0
      servers/arvr/arvr_interface.cpp

+ 8 - 0
doc/classes/ARVRInterface.xml

@@ -41,6 +41,14 @@
 				If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking.
 				If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking.
 			</description>
 			</description>
 		</method>
 		</method>
+		<method name="get_transform_for_eye">
+			<return type="Transform" />
+			<argument index="0" name="eye" type="int" enum="ARVRInterface.Eyes" />
+			<argument index="1" name="transform" type="Transform" />
+			<description>
+				Returns the transform for an eye multiplied by [code]transform[/code]. The usual value for [code]transform[/code] is the global_transform of the current ARVROrigin.
+			</description>
+		</method>
 		<method name="initialize">
 		<method name="initialize">
 			<return type="bool" />
 			<return type="bool" />
 			<description>
 			<description>

+ 1 - 0
servers/arvr/arvr_interface.cpp

@@ -46,6 +46,7 @@ void ARVRInterface::_bind_methods() {
 
 
 	ClassDB::bind_method(D_METHOD("get_render_targetsize"), &ARVRInterface::get_render_targetsize);
 	ClassDB::bind_method(D_METHOD("get_render_targetsize"), &ARVRInterface::get_render_targetsize);
 	ClassDB::bind_method(D_METHOD("is_stereo"), &ARVRInterface::is_stereo);
 	ClassDB::bind_method(D_METHOD("is_stereo"), &ARVRInterface::is_stereo);
+	ClassDB::bind_method(D_METHOD("get_transform_for_eye", "eye", "transform"), &ARVRInterface::get_transform_for_eye);
 
 
 	ADD_GROUP("Interface", "interface_");
 	ADD_GROUP("Interface", "interface_");
 	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interface_is_primary"), "set_is_primary", "is_primary");
 	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interface_is_primary"), "set_is_primary", "is_primary");