Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
Real.h
Go to the documentation of this file.
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
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;
31using RMat44 = Mat44;
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
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
const Vec3 Vec3Arg
Definition: MathTypes.h:20
const DVec3 & DVec3Arg
Definition: MathTypes.h:24
const DMat44 & DMat44Arg
Definition: MathTypes.h:32
const Mat44 & Mat44Arg
Definition: MathTypes.h:31
float Real
Definition: Real.h:27
Holds a 4x4 matrix of floats with the last column consisting of doubles.
Definition: DMat44.h:13
Definition: DVec3.h:14
Class that holds 3 doubles. Used as a storage class. Convert to DVec3 for calculations.
Definition: Double3.h:13
Class that holds 3 floats. Used as a storage class. Convert to Vec3 for calculations.
Definition: Float3.h:13
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition: Mat44.h:13
Definition: Vec3.h:16
Definition: Real.h:40