Add backface culling and option to keep unflipped hit normal in case a ray hits a back-facing triangle.

Usage: set RayResultCallback.m_flags to kF_FilterBackfaces, optionally combined with kF_KeepUnflippedNormal.
Thanks Andy O'Neil for the patch!

Remove the force_inline for some internal constraint solver methods, it makes re-use easier.
Workaround/avoid MSVC 2005 compiler error in LibXML/trionan.c
This commit is contained in:
erwin.coumans
2009-02-28 01:25:23 +00:00
parent a216ce4bf6
commit 210fe36106
6 changed files with 48 additions and 14 deletions

View File

@@ -174,11 +174,16 @@ trio_make_double
TRIO_ARGS1((values),
TRIO_CONST unsigned char *values)
{
TRIO_VOLATILE double result;
//remove the TRI_VOLATILE, because MSVC 2005 compiles crashes
// fatal error C1001: An internal error has occurred in the compiler.
// (compiler file 'f:\rtm\vctools\compiler\utc\src\P2\main.c[0x00498D00:0x00498D00]', line 182)
double result;
int i;
for (i = 0; i < (int)sizeof(double); i++) {
((TRIO_VOLATILE unsigned char *)&result)[TRIO_DOUBLE_INDEX(i)] = values[i];
(( unsigned char *)&result)[TRIO_DOUBLE_INDEX(i)] = values[i];
}
return result;
}