Skip to content

Commit 5c217f1

Browse files
authored
Merge pull request #39 from spookynova/main
2 parents bf7efc7 + 48d7367 commit 5c217f1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

UnityResolve.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#include <string>
6161
#include <unordered_map>
6262
#include <vector>
63-
#include <functional>
63+
#include <functional>
6464
#include <numbers>
6565

6666
#ifdef USE_GLM
@@ -2381,6 +2381,20 @@ class UnityResolve final {
23812381
if (method) return method->Invoke<Matrix4x4>(this);
23822382
return {};
23832383
}
2384+
2385+
2386+
auto ScreenPointToRay(const Vector2 &position, const Eye eye = Eye::Mono) -> Ray {
2387+
2388+
static Method *method;
2389+
if (!method) method = Get("UnityEngine.CoreModule.dll")->Get("Camera")->Get<Method>(mode_ == Mode::Mono ? "ScreenPointToRay_Injected" : "ScreenPointToRay");
2390+
if (mode_ == Mode::Mono && method) {
2391+
Ray ray{};
2392+
method->Invoke<void>(this, position, eye, &ray);
2393+
return ray;
2394+
}
2395+
if (method) return method->Invoke<Ray>(this, position, eye);
2396+
return {};
2397+
}
23842398
};
23852399

23862400
struct Transform : Component {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy