[英]OpenVR: Implementation of virtual API functions (GetProjectionMatrix)
I couldn't find the implementation (aka. source) of the pure virtual functions from the openvr header .我无法从openvr header 找到纯虚函数的实现(又名源代码)。
I am mainly interested in the GetProjectionMatrix()
function.我主要对GetProjectionMatrix()
function 感兴趣。
Where I searched (with no results):我在哪里搜索(没有结果):
What I found so far: https://github.com/ValveSoftware/openvr/issues/103 , but this seems to deal with problems generated by different compilers.到目前为止我发现了什么: https://github.com/ValveSoftware/openvr/issues/103 ,但这似乎处理不同编译器产生的问题。 The error of this issue is generated in vrclient.dll provided by SteamVR.该问题的错误产生于SteamVR提供的vrclient.dll。 There seems to be no public source for both of them.他们两个似乎都没有公开来源。
Any idea, how (/where) these virtual functions are implemented?知道这些虚函数是如何(/在哪里)实现的吗?
You won't like the answer, because the sad reality is that it has no open sources available to us.您不会喜欢这个答案,因为可悲的现实是它没有可供我们使用的开源资源。
OpenVR is a purely virtual interface library, yes interfaces are open source, but the actual implementations of those interface are not. OpenVR 是一个纯粹的虚拟界面库,是的,界面是开源的,但这些界面的实际实现不是。 In case of libopenvr_api
(it looks like) those are appended as a binary blob to the interface build.在libopenvr_api
(看起来像)的情况下,它们作为二进制 blob 附加到接口构建中。
The way that works is through factory functions that are declared in the interface library, but defined somewhere else, those externally defined parts are like a black box to us, and unless Valve suddenly change their minds it'll remain that way.工作方式是通过在接口库中声明但在其他地方定义的工厂函数,那些外部定义的部分对我们来说就像一个黑盒子,除非 Valve 突然改变主意,否则它将保持这种状态。
Those factory functions are declared and used in the OPENVR_INTERFACE_INTERNAL
sections of openvr.h
and openvr_driver.h
(also in case of openvr.h
those factory functions are defined in openvr_capi.h
, but they use factory functions that are defined in a shared library which is just loaded at runtime and the entire pattern is very similar to the one in openvr.h
).这些工厂函数在openvr.h
和openvr_driver.h
的OPENVR_INTERFACE_INTERNAL
部分中声明和使用(在openvr.h
的情况下,这些工厂函数也在openvr_capi.h
中定义,但它们使用在共享库中定义的工厂函数只是在运行时加载,整个模式与openvr.h
中的模式非常相似)。
EDIT:编辑:
(also in case of
openvr.h
those factory functions are defined inopenvr_capi.h
, but they use factory functions that are defined in a shared library which is just loaded at runtime and the entire pattern is very similar to the one inopenvr.h
) (同样在openvr.h
的情况下,这些工厂函数在openvr_capi.h
中定义,但它们使用在共享库中定义的工厂函数,该共享库仅在运行时加载,整个模式与openvr.h
中的非常相似)
My memory is clearly failing me, the internal factory functions are defined in openvr_api_public.cpp
which is one of the source files libopenvr_api
is build from, not in openvr_capi.h
(in my defense i didn't look at libopenvr_api
sources in a while).我的 memory 显然让我失望了,内部工厂函数是在openvr_api_public.cpp
中定义的,它是libopenvr_api
的源文件之一,而不是在openvr_capi.h
中(为了我的辩护,我有一段时间没有看libopenvr_api
源) .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.