Skip to content
0.2.0-dev Download ZIP
44 lines ·976 B Raw
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2022 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#include <Jolt/Math/DVec3.h>
8#include <Jolt/Math/DMat44.h>
9
10JPH_NAMESPACE_BEGIN
11
12#ifdef JPH_DOUBLE_PRECISION
13
14// Define real to double
15using Real = double;
16using Real3 = Double3;
17using RVec3 = DVec3;
18using RVec3Arg = DVec3Arg;
19using RMat44 = DMat44;
20using RMat44Arg = DMat44Arg;
21
22#define JPH_RVECTOR_ALIGNMENT JPH_DVECTOR_ALIGNMENT
23
24#else
25
26// Define real to float
27using Real = float;
28using Real3 = Float3;
29using RVec3 = Vec3;
30using RVec3Arg = Vec3Arg;
31using RMat44 = Mat44;
32using RMat44Arg = Mat44Arg;
33
34#define JPH_RVECTOR_ALIGNMENT JPH_VECTOR_ALIGNMENT
35
36#endif // JPH_DOUBLE_PRECISION
37
38// Put the 'real' operator in a namespace so that users can opt in to use it:
39// using namespace JPH::literals;
40namespace literals {
41 constexpr Real operator ""_r (long double inValue) { return Real(inValue); }
42};
43
44JPH_NAMESPACE_END