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 | |
| 10 | JPH_NAMESPACE_BEGIN |
| 11 | |
| 12 | #ifdef JPH_DOUBLE_PRECISION |
| 13 | |
| 14 | // Define real to double |
| 15 | using Real = double; |
| 16 | using Real3 = Double3; |
| 17 | using RVec3 = DVec3; |
| 18 | using RVec3Arg = DVec3Arg; |
| 19 | using RMat44 = DMat44; |
| 20 | using RMat44Arg = DMat44Arg; |
| 21 | |
| 22 | #define JPH_RVECTOR_ALIGNMENT JPH_DVECTOR_ALIGNMENT |
| 23 | |
| 24 | #else |
| 25 | |
| 26 | // Define real to float |
| 27 | using Real = float; |
| 28 | using Real3 = Float3; |
| 29 | using RVec3 = Vec3; |
| 30 | using RVec3Arg = Vec3Arg; |
| 31 | using RMat44 = Mat44; |
| 32 | using 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; |
| 40 | namespace literals { |
| 41 | constexpr Real operator ""_r (long double inValue) { return Real(inValue); } |
| 42 | }; |
| 43 | |
| 44 | JPH_NAMESPACE_END |