Skip to content

Commit

Permalink
Switch to get_predicted_display_time() and update `extension_api.js…
Browse files Browse the repository at this point in the history
…on` and godot-cpp (#141)
  • Loading branch information
dsnopek authored May 7, 2024
1 parent 32f7203 commit ab6b309
Show file tree
Hide file tree
Showing 7 changed files with 2,227 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ void OpenXRFbBodyTrackingExtensionWrapper::_on_process() {
}

// Get the next frame time
const XrTime next_frame_time = get_openxr_api()->get_next_frame_time();
if (next_frame_time == 0) {
const XrTime display_time = get_openxr_api()->get_predicted_display_time();
if (display_time == 0) {
return;
}

Expand All @@ -252,7 +252,7 @@ void OpenXRFbBodyTrackingExtensionWrapper::_on_process() {
XR_TYPE_BODY_JOINTS_LOCATE_INFO_FB, // type
nullptr, // next
(XrSpace)get_openxr_api()->get_play_space(), // baseSpace
next_frame_time // time
display_time // time
};

// Construct the locations struct.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,16 @@ void OpenXRFbFaceTrackingExtensionWrapper::_on_process() {
}

// Get the next frame time
const XrTime next_frame_time = get_openxr_api()->get_next_frame_time();
if (next_frame_time == 0) {
const XrTime display_time = get_openxr_api()->get_predicted_display_time();
if (display_time == 0) {
return;
}

// Construct the expression info struct.
XrFaceExpressionInfo2FB expression_info2 = {
XR_TYPE_FACE_EXPRESSION_INFO2_FB, // type
nullptr, // next
next_frame_time // time
display_time // time
};

// Construct the weights struct.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ void OpenXRFbPassthroughExtensionWrapper::set_geometry_instance_transform(XrGeom
XR_TYPE_GEOMETRY_INSTANCE_TRANSFORM_FB, // type
nullptr, // next
(XrSpace)get_openxr_api()->get_play_space(), // baseSpace
(XrTime)get_openxr_api()->get_next_frame_time(), // time
(XrTime)get_openxr_api()->get_predicted_display_time(), // time
xr_pose, // pose
xr_scale, // scale
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void OpenXRFbSpatialEntityExtensionWrapper::_on_process() {
} // pose
};

XrResult result = xrLocateSpace(E.value.space, reinterpret_cast<XrSpace>(get_openxr_api()->get_play_space()), get_openxr_api()->get_next_frame_time(), &location);
XrResult result = xrLocateSpace(E.value.space, reinterpret_cast<XrSpace>(get_openxr_api()->get_play_space()), get_openxr_api()->get_predicted_display_time(), &location);
if (XR_FAILED(result)) {
WARN_PRINT("OpenXR: failed to locate anchor " + E.key);
WARN_PRINT(get_openxr_api()->get_error_string(result));
Expand Down Expand Up @@ -176,7 +176,7 @@ bool OpenXRFbSpatialEntityExtensionWrapper::create_spatial_anchor(const Transfor
nullptr, // next
reinterpret_cast<XrSpace>(get_openxr_api()->get_play_space()), // space
pose, // poseInSpace
get_openxr_api()->get_next_frame_time(), // time
get_openxr_api()->get_predicted_display_time(), // time
};

const XrResult result = xrCreateSpatialAnchorFB(SESSION, &info, &request_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ void OpenXRHtcFacialTrackingExtensionWrapper::_on_process() {
}

// Get the next frame time
const XrTime next_frame_time = get_openxr_api()->get_next_frame_time();
if (next_frame_time == 0) {
const XrTime display_time = get_openxr_api()->get_predicted_display_time();
if (display_time == 0) {
return;
}

Expand All @@ -199,7 +199,7 @@ void OpenXRHtcFacialTrackingExtensionWrapper::_on_process() {
XR_TYPE_FACIAL_EXPRESSIONS_HTC, // type
nullptr, // next
XR_FALSE, // isActive
next_frame_time, // sampleTime
display_time, // sampleTime
XR_FACIAL_EXPRESSION_EYE_COUNT_HTC,
eyeWeights
};
Expand All @@ -218,7 +218,7 @@ void OpenXRHtcFacialTrackingExtensionWrapper::_on_process() {
XR_TYPE_FACIAL_EXPRESSIONS_HTC, // type
nullptr, // next
XR_FALSE, // isActive
next_frame_time, // sampleTime
display_time, // sampleTime
XR_FACIAL_EXPRESSION_LIP_COUNT_HTC,
lipWeights
};
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/godot-cpp
Submodule godot-cpp updated 80 files
+5 −5 .github/workflows/ci.yml
+1 −1 CMakeLists.txt
+1 −1 README.md
+65 −18 binding_generator.py
+400 −1 gdextension/extension_api.json
+57 −26 gdextension/gdextension_interface.h
+2 −2 include/godot_cpp/classes/editor_plugin_registration.hpp
+8 −8 include/godot_cpp/classes/ref.hpp
+9 −4 include/godot_cpp/classes/wrapped.hpp
+41 −41 include/godot_cpp/core/binder_common.hpp
+6 −6 include/godot_cpp/core/builtin_ptrcall.hpp
+22 −18 include/godot_cpp/core/class_db.hpp
+1 −1 include/godot_cpp/core/defs.hpp
+7 −7 include/godot_cpp/core/engine_ptrcall.hpp
+10 −2 include/godot_cpp/core/math.hpp
+7 −7 include/godot_cpp/core/memory.hpp
+21 −21 include/godot_cpp/core/method_bind.hpp
+7 −7 include/godot_cpp/core/method_ptrcall.hpp
+8 −8 include/godot_cpp/core/object.hpp
+36 −2 include/godot_cpp/core/property_info.hpp
+14 −4 include/godot_cpp/core/type_info.hpp
+2 −0 include/godot_cpp/godot.hpp
+16 −16 include/godot_cpp/templates/cowdata.hpp
+5 −5 include/godot_cpp/templates/hash_map.hpp
+3 −3 include/godot_cpp/templates/hash_set.hpp
+5 −5 include/godot_cpp/templates/hashfuncs.hpp
+5 −5 include/godot_cpp/templates/list.hpp
+7 −3 include/godot_cpp/templates/local_vector.hpp
+8 −8 include/godot_cpp/templates/pair.hpp
+1 −1 include/godot_cpp/templates/rb_map.hpp
+1 −1 include/godot_cpp/templates/rb_set.hpp
+3 −3 include/godot_cpp/templates/rid_owner.hpp
+2 −2 include/godot_cpp/templates/safe_refcount.hpp
+1 −1 include/godot_cpp/templates/search_array.hpp
+1 −1 include/godot_cpp/templates/self_list.hpp
+2 −2 include/godot_cpp/templates/sort_array.hpp
+3 −3 include/godot_cpp/templates/thread_work_pool.hpp
+8 −8 include/godot_cpp/templates/vector.hpp
+1 −1 include/godot_cpp/templates/vmap.hpp
+1 −1 include/godot_cpp/templates/vset.hpp
+2 −1 include/godot_cpp/variant/aabb.hpp
+1 −0 include/godot_cpp/variant/basis.hpp
+10 −10 include/godot_cpp/variant/callable_method_pointer.hpp
+4 −4 include/godot_cpp/variant/char_string.hpp
+1 −0 include/godot_cpp/variant/plane.hpp
+1 −0 include/godot_cpp/variant/quaternion.hpp
+6 −9 include/godot_cpp/variant/rect2.hpp
+5 −9 include/godot_cpp/variant/rect2i.hpp
+1 −0 include/godot_cpp/variant/transform2d.hpp
+1 −0 include/godot_cpp/variant/transform3d.hpp
+1 −1 include/godot_cpp/variant/typed_array.hpp
+2 −2 include/godot_cpp/variant/variant.hpp
+11 −0 include/godot_cpp/variant/vector2.hpp
+11 −0 include/godot_cpp/variant/vector2i.hpp
+12 −0 include/godot_cpp/variant/vector3.hpp
+11 −0 include/godot_cpp/variant/vector3i.hpp
+12 −0 include/godot_cpp/variant/vector4.hpp
+11 −0 include/godot_cpp/variant/vector4i.hpp
+58 −0 src/core/object.cpp
+4 −0 src/godot.cpp
+4 −0 src/variant/aabb.cpp
+4 −0 src/variant/basis.cpp
+4 −4 src/variant/char_string.cpp
+19 −0 src/variant/packed_arrays.cpp
+4 −0 src/variant/plane.cpp
+1 −1 src/variant/projection.cpp
+4 −0 src/variant/quaternion.cpp
+4 −0 src/variant/rect2.cpp
+4 −0 src/variant/transform2d.cpp
+4 −0 src/variant/transform3d.cpp
+16 −0 src/variant/vector2.cpp
+18 −0 src/variant/vector2i.cpp
+23 −0 src/variant/vector3.cpp
+21 −0 src/variant/vector3i.cpp
+25 −0 src/variant/vector4.cpp
+24 −0 src/variant/vector4i.cpp
+1 −1 test/CMakeLists.txt
+4 −0 test/project/main.gd
+9 −9 test/src/register_types.cpp
+72 −1 tools/godotcpp.py
Loading

0 comments on commit ab6b309

Please sign in to comment.