29 #ifndef NVBLASTPXSHAREDTYPESHELPERS_H 30 #define NVBLASTPXSHAREDTYPESHELPERS_H 36 #include <PxTransform.h> 40 #include <PxBounds3.h> 42 #define WCast(type, name) reinterpret_cast<type>(name) 43 #define RCast(type, name) reinterpret_cast<const type>(name) 45 #define CONVERT(BlastType, PxSharedType) \ 46 static inline PxSharedType& toPxShared(BlastType& v) \ 48 return WCast(PxSharedType&, v); \ 50 static inline const PxSharedType& toPxShared(const BlastType& v) \ 52 return RCast(PxSharedType&, v); \ 54 static inline const BlastType& fromPxShared(const PxSharedType& v) \ 56 return RCast(BlastType&, v); \ 58 static inline BlastType& fromPxShared(PxSharedType& v) \ 60 return WCast(BlastType&, v); \ 62 static inline PxSharedType* toPxShared(BlastType* v) \ 64 return WCast(PxSharedType*, v); \ 66 static inline const PxSharedType* toPxShared(const BlastType* v) \ 68 return RCast(PxSharedType*, v); \ 70 static inline const BlastType* fromPxShared(const PxSharedType* v) \ 72 return RCast(BlastType*, v); \ 74 static inline BlastType* fromPxShared(PxSharedType* v) \ 76 return WCast(BlastType*, v); \ 131 return{ v1.
x + v2.
x, v1.
y + v2.
y };
135 return{ v1.
x - v2.
x, v1.
y - v2.
y };
139 return{ v.
x + f, v.
y + f };
143 return{ v.
x + f, v.
y + f };
147 return{ v.
x * f, v.
y * f };
151 return{ v.
x * f, v.
y * f };
155 return{ v.
x / f, v.
y / f };
159 return v1.
x * v2.
x + v1.
y * v2.
y;
163 return{ -v.
x, -v.
y };
168 return{ v1.
x + v2.
x, v1.
y + v2.
y, v1.
z + v2.
z };
172 return{ v1.
x - v2.
x, v1.
y - v2.
y, v1.
z - v2.
z };
176 return{ v1.
x * v2.
x, v1.
y * v2.
y, v1.
z * v2.
z };
180 return{ v1.
x / v2.
x, v1.
y / v2.
y, v1.
z / v2.
z };
184 return{ v.
x + f, v.
y + f, v.
z + f };
188 return{ v.
x + f, v.
y + f, v.
z + f };
192 return{ v.
x * f, v.
y * f, v.
z * f };
196 return{ v.
x * f, v.
y * f, v.
z * f };
200 return{ v.
x / f, v.
y / f, v.
z / f };
204 return v1.
x * v2.
x + v1.
y * v2.
y + v1.
z * v2.
z;
208 return{ -v.
x, -v.
y, -v.
z };
211 #endif // #ifndef NVBLASTPHYSXTYPESHELPERS_H NvcVec2 operator+(const NvcVec2 &v1, const NvcVec2 &v2)
Definition: NvBlastPxSharedHelpers.h:129
Definition: NvCTypes.h:55
SIMD_FORCE_INLINE const btScalar & x() const
Return the x value.
Definition: btVector3.h:275
float z
Definition: NvCTypes.h:51
Definition: NvCTypes.h:99
#define NV_OFFSET_OF(X, Y)
Definition: NvPreprocessor.h:450
Definition: NvCTypes.h:43
Definition: NvCTypes.h:80
float x
Definition: NvCTypes.h:51
SIMD_FORCE_INLINE const btScalar & y() const
Return the y value.
Definition: btVector3.h:277
float dot(const NvcVec2 &v1, const NvcVec2 &v2)
Definition: NvBlastPxSharedHelpers.h:157
float x
Definition: NvCTypes.h:45
Definition: NvCTypes.h:86
Definition: NvCTypes.h:92
NV_COMPILE_TIME_ASSERT(sizeof(NvcVec2)==sizeof(physx::PxVec2))
NvcVec2 operator/(const NvcVec2 &v, float f)
Definition: NvBlastPxSharedHelpers.h:153
NvcVec2 operator*(const NvcVec2 &v, float f)
Definition: NvBlastPxSharedHelpers.h:145
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition: btVector3.h:279
#define CONVERT(BlastType, PxSharedType)
Definition: NvBlastPxSharedHelpers.h:45
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btVector3.h:281
NvcVec2 operator-(const NvcVec2 &v1, const NvcVec2 &v2)
Definition: NvBlastPxSharedHelpers.h:133
float y
Definition: NvCTypes.h:45
Definition: NvCTypes.h:49
Definition: NvCTypes.h:61
NvcVec2 neg(const NvcVec2 &v)
Definition: NvBlastPxSharedHelpers.h:161
float y
Definition: NvCTypes.h:51