8#ifdef JPH_ENABLE_DETERMINISM_LOG
24 JPH_INLINE
uint32 Convert(
float inValue)
const
26 return *(
uint32 *)&inValue;
29 JPH_INLINE
uint64 Convert(
double inValue)
const
31 return *(
uint64 *)&inValue;
37 mLog.open(
"detlog.txt", std::ios::out | std::ios::trunc | std::ios::binary);
41 DeterminismLog & operator << (
char inValue)
47 DeterminismLog & operator << (
const char *inValue)
49 mLog << std::dec << inValue;
53 DeterminismLog & operator << (
const string &inValue)
55 mLog << std::dec << inValue;
59 DeterminismLog & operator << (
const BodyID &inValue)
65 DeterminismLog & operator << (
const SubShapeID &inValue)
67 mLog << std::hex << std::setw(8) << inValue.
GetValue();
71 DeterminismLog & operator << (
float inValue)
73 mLog << std::hex << std::setw(8) << Convert(inValue);
77 DeterminismLog & operator << (
int inValue)
83 DeterminismLog & operator << (
uint32 inValue)
85 mLog << std::hex << std::setw(8) << inValue;
89 DeterminismLog & operator << (
uint64 inValue)
91 mLog << std::hex << std::setw(16) << inValue;
95 DeterminismLog & operator << (
Vec3Arg inValue)
97 mLog << std::hex << std::setw(8) << Convert(inValue.
GetX()) <<
" " << std::setw(8) << Convert(inValue.
GetY()) <<
" " << std::setw(8) << Convert(inValue.
GetZ());
101 DeterminismLog & operator << (
DVec3Arg inValue)
103 mLog << std::hex << std::setw(16) << Convert(inValue.
GetX()) <<
" " << std::setw(16) << Convert(inValue.
GetY()) <<
" " << std::setw(16) << Convert(inValue.
GetZ());
107 DeterminismLog & operator << (
Vec4Arg inValue)
109 mLog << std::hex << std::setw(8) << Convert(inValue.
GetX()) <<
" " << std::setw(8) << Convert(inValue.
GetY()) <<
" " << std::setw(8) << Convert(inValue.
GetZ()) <<
" " << std::setw(8) << Convert(inValue.
GetW());
113 DeterminismLog & operator << (
const Float3 &inValue)
115 mLog << std::hex << std::setw(8) << Convert(inValue.
x) <<
" " << std::setw(8) << Convert(inValue.
y) <<
" " << std::setw(8) << Convert(inValue.
z);
119 DeterminismLog & operator << (
Mat44Arg inValue)
125 DeterminismLog & operator << (
DMat44Arg inValue)
131 DeterminismLog & operator << (
QuatArg inValue)
138 static DeterminismLog sLog;
145#define JPH_DET_LOG(...) DeterminismLog::sLog << __VA_ARGS__ << '\n'
151JPH_SUPPRESS_WARNING_PUSH
155#define JPH_DET_LOG(...)
157JPH_SUPPRESS_WARNING_POP
#define JPH_SUPPRESS_WARNINGS
Definition: Core.h:282
#define JPH_SUPPRESS_WARNINGS_STD_BEGIN
Definition: Core.h:372
#define JPH_SUPPRESS_WARNINGS_STD_END
Definition: Core.h:384
std::uint64_t uint64
Definition: Core.h:443
#define JPH_NAMESPACE_END
Definition: Core.h:367
std::uint32_t uint32
Definition: Core.h:442
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition: BodyID.h:13
uint32 GetIndexAndSequenceNumber() const
Returns the index and sequence number combined in an uint32.
Definition: BodyID.h:58
Holds a 4x4 matrix of floats with the last column consisting of doubles.
Definition: DMat44.h:13
JPH_INLINE Vec4 GetColumn4(uint inCol) const
Definition: DMat44.h:115
JPH_INLINE DVec3 GetTranslation() const
Definition: DMat44.h:111
JPH_INLINE double GetZ() const
Definition: DVec3.h:149
JPH_INLINE double GetY() const
Definition: DVec3.h:148
JPH_INLINE double GetX() const
Get individual components.
Definition: DVec3.h:147
Class that holds 3 floats. Used as a storage class. Convert to Vec3 for calculations.
Definition: Float3.h:13
float y
Definition: Float3.h:39
float z
Definition: Float3.h:40
float x
Definition: Float3.h:38
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition: Mat44.h:13
JPH_INLINE Vec4 GetColumn4(uint inCol) const
Definition: Mat44.h:160
JPH_INLINE Vec4 GetXYZW() const
Get the quaternion as a Vec4.
Definition: Quat.h:84
A sub shape id contains a path to an element (usually a triangle or other primitive type) of a compou...
Definition: SubShapeID.h:23
Type GetValue() const
Get the value of the path to the sub shape ID.
Definition: SubShapeID.h:52
JPH_INLINE float GetX() const
Get individual components.
Definition: Vec3.h:123
JPH_INLINE float GetY() const
Definition: Vec3.h:124
JPH_INLINE float GetZ() const
Definition: Vec3.h:125
JPH_INLINE float GetW() const
Definition: Vec4.h:116
JPH_INLINE float GetX() const
Get individual components.
Definition: Vec4.h:113
JPH_INLINE float GetZ() const
Definition: Vec4.h:115
JPH_INLINE float GetY() const
Definition: Vec4.h:114