KiCad PCB EDA Suite
RAYPACKET Struct Reference

#include <raypacket.h>

Public Member Functions

 RAYPACKET (const CCAMERA &aCamera, const SFVEC2I &aWindowsPosition)
 
 RAYPACKET (const CCAMERA &aCamera, const SFVEC2I &aWindowsPosition, const SFVEC3F &aDirectionDisplacementFactor)
 
 RAYPACKET (const CCAMERA &aCamera, const SFVEC2I &aWindowsPosition, unsigned int aPixelMultiple)
 
 RAYPACKET (const CCAMERA &aCamera, const SFVEC2F &aWindowsPosition)
 
 RAYPACKET (const CCAMERA &aCamera, const SFVEC2F &aWindowsPosition, const SFVEC2F &a2DWindowsPosDisplacementFactor)
 

Public Attributes

CFRUSTUM m_Frustum
 
RAY m_ray [RAYPACKET_RAYS_PER_PACKET]
 

Detailed Description

Definition at line 43 of file raypacket.h.

Constructor & Destructor Documentation

RAYPACKET::RAYPACKET ( const CCAMERA aCamera,
const SFVEC2I aWindowsPosition 
)

Definition at line 45 of file raypacket.cpp.

References RAY::Init(), m_Frustum, m_ray, CCAMERA::MakeRay(), RAYPACKET_DIM, RAYPACKET_GenerateFrustum(), and RAYPACKET_RAYS_PER_PACKET.

46 {
47  unsigned int i = 0;
48 
49  for( unsigned int y = 0; y < RAYPACKET_DIM; ++y )
50  {
51  for( unsigned int x = 0; x < RAYPACKET_DIM; ++x )
52  {
53  SFVEC3F rayOrigin;
54  SFVEC3F rayDir;
55 
56  aCamera.MakeRay( SFVEC2I( aWindowsPosition.x + x,
57  aWindowsPosition.y + y ),
58  rayOrigin, rayDir );
59 
60  m_ray[i].Init( rayOrigin, rayDir );
61 
62  i++;
63  }
64  }
65 
66  wxASSERT( i == RAYPACKET_RAYS_PER_PACKET );
67 
69 }
#define RAYPACKET_DIM
Definition: raypacket.h:37
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:46
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:38
glm::ivec2 SFVEC2I
Definition: xv3d_types.h:42
static void RAYPACKET_GenerateFrustum(CFRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
CFRUSTUM m_Frustum
Definition: raypacket.h:45
void MakeRay(const SFVEC2I &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
MakeRay - Make a ray based on a windows screen position.
Definition: ccamera.cpp:293
#define RAYPACKET_RAYS_PER_PACKET
Definition: raypacket.h:40
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
RAYPACKET::RAYPACKET ( const CCAMERA aCamera,
const SFVEC2I aWindowsPosition,
const SFVEC3F aDirectionDisplacementFactor 
)

Definition at line 94 of file raypacket.cpp.

References Fast_RandFloat(), RAY::Init(), m_Frustum, m_ray, CCAMERA::MakeRay(), RAYPACKET_DIM, RAYPACKET_GenerateFrustum(), and RAYPACKET_RAYS_PER_PACKET.

97 {
98  unsigned int i = 0;
99  for( unsigned int y = 0; y < RAYPACKET_DIM; ++y )
100  for( unsigned int x = 0; x < RAYPACKET_DIM; ++x )
101  {
102  SFVEC3F rayOrigin;
103  SFVEC3F rayDir;
104 
105  aCamera.MakeRay( SFVEC2I( aWindowsPosition.x + x,
106  aWindowsPosition.y + y ),
107  rayOrigin, rayDir );
108 
109  const SFVEC3F randVector = SFVEC3F( Fast_RandFloat() * aDirectionDisplacementFactor.x,
110  Fast_RandFloat() * aDirectionDisplacementFactor.y,
111  Fast_RandFloat() * aDirectionDisplacementFactor.z );
112 
113  m_ray[i].Init( rayOrigin,
114  glm::normalize( rayDir + randVector ) );
115 
116  i++;
117  }
118 
119  wxASSERT( i == RAYPACKET_RAYS_PER_PACKET );
120 
122 }
#define RAYPACKET_DIM
Definition: raypacket.h:37
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:46
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:38
glm::ivec2 SFVEC2I
Definition: xv3d_types.h:42
float Fast_RandFloat()
Definition: 3d_fastmath.cpp:45
static void RAYPACKET_GenerateFrustum(CFRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
CFRUSTUM m_Frustum
Definition: raypacket.h:45
void MakeRay(const SFVEC2I &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
MakeRay - Make a ray based on a windows screen position.
Definition: ccamera.cpp:293
#define RAYPACKET_RAYS_PER_PACKET
Definition: raypacket.h:40
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
RAYPACKET::RAYPACKET ( const CCAMERA aCamera,
const SFVEC2I aWindowsPosition,
unsigned int  aPixelMultiple 
)

Definition at line 125 of file raypacket.cpp.

References RAY::Init(), m_Frustum, m_ray, CCAMERA::MakeRay(), RAYPACKET_DIM, RAYPACKET_GenerateFrustum(), and RAYPACKET_RAYS_PER_PACKET.

128 {
129  unsigned int i = 0;
130 
131  for( unsigned int y = 0; y < RAYPACKET_DIM; y++ )
132  {
133  for( unsigned int x = 0; x < RAYPACKET_DIM; x++ )
134  {
135  SFVEC3F rayOrigin;
136  SFVEC3F rayDir;
137 
138  aCamera.MakeRay( SFVEC2I( aWindowsPosition.x + x * aPixelMultiple,
139  aWindowsPosition.y + y * aPixelMultiple),
140  rayOrigin, rayDir );
141 
142  m_ray[i].Init( rayOrigin, rayDir );
143 
144  i++;
145  }
146  }
147 
148  wxASSERT( i == RAYPACKET_RAYS_PER_PACKET );
149 
151 }
#define RAYPACKET_DIM
Definition: raypacket.h:37
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:46
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:38
glm::ivec2 SFVEC2I
Definition: xv3d_types.h:42
static void RAYPACKET_GenerateFrustum(CFRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
CFRUSTUM m_Frustum
Definition: raypacket.h:45
void MakeRay(const SFVEC2I &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
MakeRay - Make a ray based on a windows screen position.
Definition: ccamera.cpp:293
#define RAYPACKET_RAYS_PER_PACKET
Definition: raypacket.h:40
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
RAYPACKET::RAYPACKET ( const CCAMERA aCamera,
const SFVEC2F aWindowsPosition 
)

Definition at line 72 of file raypacket.cpp.

References m_Frustum, m_ray, RAYPACKET_GenerateFrustum(), and RAYPACKET_InitRays().

74 {
75  RAYPACKET_InitRays( aCamera, aWindowsPosition, m_ray );
76 
78 }
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:46
void RAYPACKET_InitRays(const CCAMERA &aCamera, const SFVEC2F &aWindowsPosition, RAY *aRayPck)
Definition: raypacket.cpp:154
static void RAYPACKET_GenerateFrustum(CFRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
CFRUSTUM m_Frustum
Definition: raypacket.h:45
RAYPACKET::RAYPACKET ( const CCAMERA aCamera,
const SFVEC2F aWindowsPosition,
const SFVEC2F a2DWindowsPosDisplacementFactor 
)

Definition at line 81 of file raypacket.cpp.

References m_Frustum, m_ray, RAYPACKET_GenerateFrustum(), and RAYPACKET_InitRays_with2DDisplacement().

84 {
86  aWindowsPosition,
87  a2DWindowsPosDisplacementFactor,
88  m_ray );
89 
91 }
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:46
static void RAYPACKET_GenerateFrustum(CFRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
CFRUSTUM m_Frustum
Definition: raypacket.h:45
void RAYPACKET_InitRays_with2DDisplacement(const CCAMERA &aCamera, const SFVEC2F &aWindowsPosition, const SFVEC2F &a2DWindowsPosDisplacementFactor, RAY *aRayPck)
Definition: raypacket.cpp:174

Member Data Documentation

CFRUSTUM RAYPACKET::m_Frustum

Definition at line 45 of file raypacket.h.

Referenced by getFirstHit(), CBVH_PBRT::Intersect(), and RAYPACKET().

RAY RAYPACKET::m_ray[RAYPACKET_RAYS_PER_PACKET]

Definition at line 46 of file raypacket.h.

Referenced by getFirstHit(), getLastHit(), CBVH_PBRT::Intersect(), and RAYPACKET().


The documentation for this struct was generated from the following files: