for (perturb=0; perturb < NUM_ATTEMPTS; perturb++) { Matrix3 ptb; float prop = ((float)rand()) / ((float) RAND_MAX); // gets random rotation of up to half a degree. float ang = PI*prop/360.0f; switch (perturb%3) { case 0: ptb = RotateXMatrix (ang); break; case 1: ptb = RotateYMatrix (ang); break; case 2: ptb = RotateZMatrix (ang); break; } ray.dir = ptb*ray.dir; // try IntersectRay() again, see if you get a hit. }
#include <imtl.h>

| RenderGlobalContext | ( | ) | [inline] |
: pToneOp(NULL), mpIRenderElementMgr(NULL) { }
| IRenderElementMgr* GetRenderElementMgr | ( | ) | [inline] |
{ return mpIRenderElementMgr; }
| void SetRenderElementMgr | ( | IRenderElementMgr * | pIRenderElementMgr | ) | [inline] |
{ mpIRenderElementMgr = pIRenderElementMgr; }
| int NRenderElements | ( | ) | [inline] |
{
return mpIRenderElementMgr ? mpIRenderElementMgr->NumRenderElements() : 0;
}
| IRenderElement* GetRenderElement | ( | int | n | ) | [inline] |
{
return mpIRenderElementMgr ? mpIRenderElementMgr->GetRenderElement(n) : NULL;
}
| virtual FilterKernel* GetAAFilterKernel | ( | ) | [inline, virtual] |
{ return NULL; }
| virtual float GetAAFilterSize | ( | ) | [inline, virtual] |
{ return 0.0f; }
| virtual int NumRenderInstances | ( | ) | [inline, virtual] |
| virtual RenderInstance* GetRenderInstance | ( | int | i | ) | [inline, virtual] |
{ return NULL; }
| virtual AColor EvalGlobalEnvironMap | ( | ShadeContext & | sc, |
| Ray & | r, | ||
| BOOL | applyAtmos | ||
| ) | [inline, virtual] |
{
return AColor(0.0f,0.0f,0.0f,1.0f);
}
| virtual void IntersectRay | ( | RenderInstance * | inst, |
| Ray & | ray, | ||
| ISect & | isct, | ||
| ISectList & | xpList, | ||
| BOOL | findExit | ||
| ) | [inline, virtual] |
{}
| virtual BOOL IntersectWorld | ( | Ray & | ray, |
| int | skipID, | ||
| ISect & | hit, | ||
| ISectList & | xplist, | ||
| int | blurFrame =
NO_MOTBLUR |
||
| ) | [inline, virtual] |
{ return FALSE; }
| virtual ViewParams* GetViewParams | ( | ) | [inline, virtual] |
{ return NULL; }
| virtual FILE* DebugFile | ( | ) | [inline, virtual] |
{ return NULL; }
| virtual INT_PTR Execute | ( | int | cmd, |
| ULONG_PTR | arg1 = 0, |
||
| ULONG_PTR | arg2 = 0, |
||
| ULONG_PTR | arg3 = 0 |
||
| ) | [inline, virtual] |
{ return 0; }
| float xc |
| float yc |
| TimeValue time |