MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / encodeFloat

Function encodeFloat

physx/source/lowlevelaabb/include/BpBroadPhaseUpdate.h:138–146  ·  view source on GitHub ↗

\brief Encode a single float value with lossless encoding to integer */

Source from the content-addressed store, hash-verified

136 \brief Encode a single float value with lossless encoding to integer
137 */
138 PX_FORCE_INLINE PxU32 encodeFloat(PxU32 ir)
139 {
140 //we may need to check on -0 and 0
141 //But it should make no practical difference.
142 if(ir & PX_SIGN_BITMASK) //negative?
143 return ~ir;//reverse sequence of negative numbers
144 else
145 return ir | PX_SIGN_BITMASK; // flip sign
146 }
147
148 /*
149 \brief Encode a single float value with lossless encoding to integer

Callers 8

encodeFloatMinMethod · 0.70
encodeFloatMaxMethod · 0.70
initFromFloatsMethod · 0.50
initFrom2Method · 0.50
initFromFloatsMethod · 0.50
initFrom2Method · 0.50
initFromMethod · 0.50
initFrom2Method · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected