spinout Posted August 4, 2011 Share Posted August 4, 2011 Very interesting, nice to see someone continuing where JTH left off. What makes you so sure there isn't any model data, and that it is all collision? Are there collision normals of any sort? Also: The vertex coordinates were single precision floats, so I had to write a function that converted them to decimal (like the IEEE-754 calculator online).You do realize you can just do (int)float_var to get an integer from a float, right? There are other tricky things you can do, such as union { uint32_t i; float f; } value;, then value.i = U32(data); (int)value.f;. In n64tool, I made a macro which directly gets floats from data, using a union - union {uint32_t u; float f;} ____u32_f32_union____; /* This variable is ONLY for the F32 macro ! */ #define U32(x) ((uint32_t)( (((uint8_t*)(x))[0]<<24)|(((uint8_t*)(x))[1]<<16)|(((uint8_t*)(x))[2]<<8)|((uint8_t*)(x))[3] )) #define F32(x) ( ( (____u32_f32_union____.u = U32(x)) & 0) + ____u32_f32_union____.f) Note to admins/management: [tt] tags and/or tags with better CSS that don't screw shit up, please and thanks! Link to comment Share on other sites More sharing options...
Recommended Posts