| 
    OWL
    
   OptiX7 Wrapper Library 
   | 
 
 
 
 
Go to the documentation of this file.
   32     template<
typename T, 
int N>
 
   39     template<
typename ScalarType>
 
  106       inline __both__ vec_t(
const uint2 v) : x(v.x), y(v.y) {}
 
  108       inline __both__ operator float2()
 const { 
return make_float2(x,y); }
 
  109       inline __both__ operator int2()
 const { 
return make_int2(x,y); }
 
  110       inline __both__ operator uint2()
 const { 
return make_uint2(x,y); }
 
  114       inline __both__ operator dim3()
 const { dim3 d; d.x = x; d.y = y; d.z = 1; 
return d; }
 
  115       inline explicit __both__ vec_t(
const dim3 v) : x(v.x), y(v.y) {}
 
  126       template<
typename OT>
 
  149       inline __both__ vec_t(
const T &_x, 
const T &_y, 
const T &_z) : x(_x), y(_y), z(_z) {}
 
  151       inline __both__ vec_t(
const int3 &v)   : x(v.x), y(v.y), z(v.z) {}
 
  152       inline __both__ vec_t(
const uint3 &v)  : x(v.x), y(v.y), z(v.z) {}
 
  153       inline __both__ vec_t(
const float3 &v) : x(v.x), y(v.y), z(v.z) {}
 
  157       inline __both__ vec_t(
const float4 v)  : x(v.x), y(v.y), z(v.z) {}
 
  161       inline __both__ vec_t(
const int4 v)  : x(v.x), y(v.y), z(v.z) {}
 
  165       inline __both__ vec_t(
const uint4 v)  : x(v.x), y(v.y), z(v.z) {}
 
  166       inline __both__ operator float3()
 const { 
return make_float3(x,y,z); }
 
  167       inline __both__ operator int3()
 const { 
return make_int3(x,y,z); }
 
  168       inline __both__ operator uint3()
 const { 
return make_uint3(x,y,z); }
 
  170       inline __both__ explicit vec_t(
const vec_t<T,4> &v);
 
  172       template<
typename OT>
 
  189       template<
typename OT, 
typename Lambda>
 
  191       { 
return vec_t<T,3>(lambda(v.x),lambda(v.y),lambda(v.z)); }
 
  194         struct { T x, y, 
z; };
 
  195         struct { T r, s, 
t; };
 
  196         struct { T u, v, 
w; };
 
  206       inline vec3a_t(
const T &t) : vec_t<T,3>(t) {}
 
  207       inline vec3a_t(
const T &x, 
const T &y, 
const T &z) : vec_t<T,3>(x,y,z) {}
 
  209       inline __both__ vec3a_t(
const int3 &v) : vec_t<T,3>(v) {};
 
  210       inline __both__ vec3a_t(
const uint3 &v) : vec_t<T,3>(v) {};
 
  211       inline __both__ vec3a_t(
const float3 &v) : vec_t<T,3>(v) {};
 
  212       inline __both__ vec3a_t(
const int4 v) : vec_t<T,3>(v) {};
 
  213       inline __both__ vec3a_t(
const uint4 v) : vec_t<T,3>(v) {};
 
  214       inline __both__ vec3a_t(
const float4 v) : vec_t<T,3>(v) {};
 
  217       template<
typename OT>
 
  218         inline vec3a_t(
const vec_t<OT,3> &v) : vec_t<T,3>(v.x,v.y,v.z) {}
 
  235         : x(t), y(t), z(t), w(t)
 
  238         : x(xyz.x), y(xyz.y), z(xyz.z), w(_w)
 
  241         : x(_x), y(_y), z(_z), w(_w)
 
  246         : x(v.x), y(v.y), z(v.z), w(v.w)
 
  249         : x(v.x), y(v.y), z(v.z), w(v.w)
 
  251       inline __both__ vec_t(
const uint4 &v)
 
  252         : x(v.x), y(v.y), z(v.z), w(v.w)
 
  254       inline __both__ operator float4()
 const { 
return make_float4(x,y,z,w); }
 
  255       inline __both__ operator uint4()
  const { 
return make_uint4(x,y,z,w); }
 
  256       inline __both__ operator int4()
   const { 
return make_int4(x,y,z,w); }
 
  259       template<
typename OT>
 
  261         : x(o.x), y(o.y), z(o.z), w(o.w)
 
  277       template<
typename OT, 
typename Lambda>
 
  279                                                     const Lambda &lambda)
 
  280       { 
return vec_t<T,4>(lambda(v.x),lambda(v.y),lambda(v.z),lambda(v.w)); }
 
  287       : x(v.x), y(v.y), z(v.z)
 
  339       return a.
x*b.
x + a.
y*b.
y + a.
z*b.
z;
 
  359       o << 
"(" << v.
x << 
")";
 
  366       o << 
"(" << v.
x << 
"," << v.
y << 
")";
 
  373       o << 
"(" << v.
x << 
"," << v.
y << 
"," << v.
z << 
")";
 
  380       o << 
"(" << v.
x << 
"," << v.
y << 
"," << v.
z <<  
"," << v.
w << 
")";
 
  388 #define _define_vec_types(T,t)                  \ 
  389     using vec2##t = vec_t<T,2>;                 \ 
  390     using vec3##t = vec_t<T,3>;                 \ 
  391     using vec4##t = vec_t<T,4>;                 \ 
  392     using vec3##t##a = vec3a_t<T>;              \ 
  405 #undef _define_vec_types 
  
 
double type
Definition: vec.h:47
 
#define OWL_INTERFACE
Definition: owl-common.h:63
 
#define __owl_host
Definition: owl-common.h:99
 
uint64_t type
Definition: vec.h:30
 
__both__ vec_t< T, 3 > cross(const vec_t< T, 3 > &a, const vec_t< T, 3 > &b)
Definition: vec.h:328
 
__both__ vec_t()
Definition: vec.h:61
 
__both__ T & operator[](size_t dim)
Definition: vec.h:74
 
std::ostream & operator<<(std::ostream &cout, const AffineSpaceT< L > &m)
Definition: AffineSpace.h:153
 
__both__ vec_t(const vec_t< OT, 2 > &o)
Definition: vec.h:127
 
__both__ vec_t< T, 4 > & operator=(const vec_t< T, 4 > &other)
Definition: vec.h:266
 
float type
Definition: vec.h:42
 
double type
Definition: vec.h:50
 
double type
Definition: vec.h:48
 
__both__ vec_t(const T &t)
Definition: vec.h:148
 
__both__ vec_t< T, 1 > & operator=(const vec_t< T, 1 > &other)
Definition: vec.h:65
 
__both__ vec_t(const vec_t< OT, 3 > &o)
Definition: vec.h:173
 
__both__ vec_t()
Definition: vec.h:147
 
__both__ const T & operator[](size_t dim) const
Definition: vec.h:187
 
T scalar_t
Definition: vec.h:98
 
__both__ vec_t(const T &x, const T &y)
Definition: vec.h:102
 
T x
just to allow all vec types to use x,y,z,w,...
Definition: vec.h:88
 
__both__ const T & operator[](size_t dim) const
Definition: vec.h:275
 
__both__ vec_t(const T &_x, const T &_y, const T &_z, const T &_w)
Definition: vec.h:240
 
__both__ vec_t(const T &_x, const T &_y, const T &_z)
Definition: vec.h:149
 
__both__ vec_t(const T &t)
Definition: vec.h:234
 
__both__ vec_t< T, 3 > & operator=(const vec_t< T, 3 > &other)
Definition: vec.h:179
 
__both__ vec_t(const T &v)
Definition: vec.h:62
 
__both__ vec_t< T, 2 > & operator=(const vec_t< T, 2 > &other)
Definition: vec.h:119
 
__both__ T & operator[](size_t dim)
Definition: vec.h:129
 
T scalar_t
Definition: vec.h:59
 
T scalar_t
Definition: vec.h:230
 
__both__ float sqrt(const float f)
Definition: owl-common.h:194
 
__both__ vec_t< T, 3 > yzx() const
Definition: vec.h:176
 
__both__ float rsqrt(const float f)
Definition: owl-common.h:198
 
__both__ const T & operator[](size_t dim) const
Definition: vec.h:79
 
__both__ long_type_of< T >::type area(const box_t< vec_t< T, 2 >> &b)
Definition: box.h:170
 
float type
Definition: vec.h:45
 
__both__ vec_t(const vec_t< OT, 1 > &o)
Definition: vec.h:72
 
T type
Definition: vec.h:28
 
__both__ vec_t(const vec_t< T, 3 > &xyz, const T &_w)
Definition: vec.h:237
 
__both__ vec_t(const vec_t< OT, 4 > &o)
Definition: vec.h:260
 
ScalarType type
Definition: vec.h:40
 
__both__ T dot(const vec_t< T, 3 > &a, const vec_t< T, 3 > &b)
Definition: vec.h:337
 
__both__ vec_t(const vec_t< T, 4 > &o)
Definition: vec.h:263
 
__both__ vec_t(const T &t)
Definition: vec.h:101
 
float type
Definition: vec.h:43
 
double type
Definition: vec.h:49
 
Definition: APIContext.cpp:36
 
#define OWL_ALIGN(alignment)
Definition: owl-common.h:135
 
__both__ QuaternionT< T > normalize(const QuaternionT< T > &a)
Definition: Quaternion.h:103
 
static __both__ vec_t< T, 3 > make_from(const vec_t< OT, 3 > &v, const Lambda &lambda)
Definition: vec.h:190
 
__both__ vec_t()
Definition: vec.h:232
 
T scalar_t
Definition: vec.h:145
 
__both__ T & operator[](size_t dim)
Definition: vec.h:274
 
float type
Definition: vec.h:44
 
__both__ T & operator[](size_t dim)
Definition: vec.h:186
 
int64_t type
Definition: vec.h:29
 
__both__ vec_t()
Definition: vec.h:100
 
#define __both__
Definition: owl-common.h:102
 
__both__ long_type_of< T >::type volume(const box_t< vec_t< T, 3 >> &b)
Definition: box.h:183
 
__both__ const T & operator[](size_t dim) const
Definition: vec.h:130
 
__both__ T length(const vec_t< T, 3 > &v)
Definition: vec.h:351
 
_define_vec_types(int8_t, c)
 
static __both__ vec_t< T, 4 > make_from(const vec_t< OT, 4 > &v, const Lambda &lambda)
Definition: vec.h:278