HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TS_Ray.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: TS_Ray (C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef _TS_Ray_h_
13 #define _TS_Ray_h_
14 
15 #include "TS_API.h"
16 #include <UT/UT_Vector3.h>
17 #include <UT/UT_Interval.h>
18 #include <UT/UT_BoundingBox.h>
20 
22 {
23  public:
24  inline TS_Ray(const UT_Vector3 &xdir, const UT_Vector3 &xanchor,
25  int threadNum = -1);
26  int rayBoxHit(const UT_BoundingBox &box, UT_Interval &t) const;
27 
28  // Sets up multiple ray counts for use by seperate threads
29  static void setupThreads(int numThreads);
30  public:
33  int index;
35 };
36 
37 inline TS_Ray::TS_Ray(const UT_Vector3 &pdir, const UT_Vector3 &panchor,
38  int threadNum)
39 {
40  this->dir = pdir; this->anchor = panchor;
41 
42  index = ourRaySerial.get()+1;
44 }
45 
46 #endif
#define TS_API
Definition: TS_API.h:10
TS_Ray(const UT_Vector3 &xdir, const UT_Vector3 &xanchor, int threadNum=-1)
Definition: TS_Ray.h:37
UT_Vector3 dir
Definition: TS_Ray.h:31
static UT_ThreadSpecificValue< int > ourRaySerial
Definition: TS_Ray.h:34
Definition: TS_Ray.h:21
int index
Definition: TS_Ray.h:33
UT_Vector3 anchor
Definition: TS_Ray.h:32
GLuint index
Definition: glcorearb.h:785