OptiX  3.9
NVIDIA OptiX Acceleration Engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
optix_datatypes.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
4  *
5  * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6  * rights in and to this software, related documentation and any modifications thereto.
7  * Any use, reproduction, disclosure or distribution of this software and related
8  * documentation without an express license agreement from NVIDIA Corporation is strictly
9  * prohibited.
10  *
11  * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12  * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14  * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15  * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16  * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17  * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18  * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19  * SUCH DAMAGES
20  */
21 
30 #ifndef __optix_optix_datatypes_h__
31 #define __optix_optix_datatypes_h__
32 
33 #include <host_defines.h> /* for __inline__ */
34 #include "../optixu/optixu_vector_types.h" /* for float3 */
35 #include "optix_declarations.h" /* for RT_HOSTDEVICE */
36 
37 #ifdef __cplusplus
38 namespace optix {
39 #endif
40 
42 #define RT_DEFAULT_MAX 1.e27f
43 
44 /*
45  Rays
46 */
47 
120 struct Ray {
121 
122 #ifdef __cplusplus
123 
124  __inline__ RT_HOSTDEVICE
125  Ray(){}
126 
128  __inline__ RT_HOSTDEVICE
129  Ray( const Ray &r)
130  :origin(r.origin),direction(r.direction),ray_type(r.ray_type),tmin(r.tmin),tmax(r.tmax){}
131 
133  __inline__ RT_HOSTDEVICE
134  Ray( float3 origin_, float3 direction_, unsigned int ray_type_, float tmin_, float tmax_ = RT_DEFAULT_MAX )
135  :origin(origin_),direction(direction_),ray_type(ray_type_),tmin(tmin_),tmax(tmax_){}
136 #endif
137 
139  float3 origin;
141  float3 direction;
143  unsigned int ray_type;
145  float tmin;
147  float tmax;
148 };
149 
150 static __inline__ RT_HOSTDEVICE
151 Ray make_Ray( float3 origin, float3 direction, unsigned int ray_type, float tmin, float tmax )
152 {
153  Ray ray;
154  ray.origin = origin;
155  ray.direction = direction;
156  ray.ray_type = ray_type;
157  ray.tmin = tmin;
158  ray.tmax = tmax;
159  return ray;
160 }
161 
162 #ifdef __cplusplus
163 } // namespace
164 #endif
165 
166 #endif /* __optix_optix_datatypes_h__ */
float3 origin
Definition: optix_datatypes.h:139
unsigned int ray_type
Definition: optix_datatypes.h:143
float tmax
Definition: optix_datatypes.h:147
float tmin
Definition: optix_datatypes.h:145
#define RT_DEFAULT_MAX
Definition: optix_datatypes.h:42
float3 direction
Definition: optix_datatypes.h:141
Ray class.
Definition: optix_datatypes.h:120
OptiX public API declarations.