You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Core: Replace C math headers with C++ equivalents
- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
This commit is contained in:
@@ -30,9 +30,9 @@
|
||||
|
||||
#include "openxr_util.h"
|
||||
|
||||
#include <openxr/openxr_reflection.h>
|
||||
#include "core/math/math_funcs.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <openxr/openxr_reflection.h>
|
||||
|
||||
#define XR_ENUM_CASE_STR(name, val) \
|
||||
case name: \
|
||||
@@ -155,11 +155,11 @@ void OpenXRUtil::XrMatrix4x4f_CreateProjection(XrMatrix4x4f *result, GraphicsAPI
|
||||
// Creates a projection matrix based on the specified FOV.
|
||||
void OpenXRUtil::XrMatrix4x4f_CreateProjectionFov(XrMatrix4x4f *result, GraphicsAPI graphicsApi, const XrFovf fov,
|
||||
const float nearZ, const float farZ) {
|
||||
const float tanLeft = tanf(fov.angleLeft);
|
||||
const float tanRight = tanf(fov.angleRight);
|
||||
const float tanLeft = std::tan(fov.angleLeft);
|
||||
const float tanRight = std::tan(fov.angleRight);
|
||||
|
||||
const float tanDown = tanf(fov.angleDown);
|
||||
const float tanUp = tanf(fov.angleUp);
|
||||
const float tanDown = std::tan(fov.angleDown);
|
||||
const float tanUp = std::tan(fov.angleUp);
|
||||
|
||||
XrMatrix4x4f_CreateProjection(result, graphicsApi, tanLeft, tanRight, tanUp, tanDown, nearZ, farZ);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user