KiCad PCB EDA Suite
RAYPACKET Struct Reference

#include <raypacket.h>

Public Member Functions

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

Public Attributes

FRUSTUM m_Frustum
 
RAY m_ray [RAYPACKET_RAYS_PER_PACKET]
 

Detailed Description

Definition at line 43 of file raypacket.h.

Constructor & Destructor Documentation

◆ RAYPACKET() [1/5]

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

Definition at line 45 of file raypacket.cpp.

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, aWindowsPosition.y + y ),
57  rayOrigin, rayDir );
58 
59  m_ray[i].Init( rayOrigin, rayDir );
60 
61  i++;
62  }
63  }
64 
65  wxASSERT( i == RAYPACKET_RAYS_PER_PACKET );
66 
68 }
#define RAYPACKET_DIM
Definition: raypacket.h:37
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:59
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:41
glm::ivec2 SFVEC2I
Definition: xv3d_types.h:39
static void RAYPACKET_GenerateFrustum(FRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
void MakeRay(const SFVEC2I &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on a windows screen position.
Definition: camera.cpp:308
FRUSTUM m_Frustum
Definition: raypacket.h:58
#define RAYPACKET_RAYS_PER_PACKET
Definition: raypacket.h:40
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44

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

◆ RAYPACKET() [2/5]

RAYPACKET::RAYPACKET ( const CAMERA aCamera,
const SFVEC2I aWindowsPosition,
const SFVEC3F aDirectionDisplacementFactor 
)

Definition at line 89 of file raypacket.cpp.

91 {
92  unsigned int i = 0;
93 
94  for( unsigned int y = 0; y < RAYPACKET_DIM; ++y )
95  {
96  for( unsigned int x = 0; x < RAYPACKET_DIM; ++x )
97  {
98  SFVEC3F rayOrigin;
99  SFVEC3F rayDir;
100 
101  aCamera.MakeRay( SFVEC2I( aWindowsPosition.x + x, aWindowsPosition.y + y ),
102  rayOrigin, rayDir );
103 
104  const SFVEC3F randVector = SFVEC3F( Fast_RandFloat() * aDirectionDisplacementFactor.x,
105  Fast_RandFloat() * aDirectionDisplacementFactor.y,
106  Fast_RandFloat() * aDirectionDisplacementFactor.z );
107 
108  m_ray[i].Init( rayOrigin, glm::normalize( rayDir + randVector ) );
109 
110  i++;
111  }
112  }
113 
114  wxASSERT( i == RAYPACKET_RAYS_PER_PACKET );
115 
117 }
#define RAYPACKET_DIM
Definition: raypacket.h:37
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:59
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:41
glm::ivec2 SFVEC2I
Definition: xv3d_types.h:39
float Fast_RandFloat()
Definition: 3d_fastmath.cpp:45
static void RAYPACKET_GenerateFrustum(FRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
void MakeRay(const SFVEC2I &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on a windows screen position.
Definition: camera.cpp:308
FRUSTUM m_Frustum
Definition: raypacket.h:58
#define RAYPACKET_RAYS_PER_PACKET
Definition: raypacket.h:40
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44

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

◆ RAYPACKET() [3/5]

RAYPACKET::RAYPACKET ( const CAMERA aCamera,
const SFVEC2I aWindowsPosition,
unsigned int  aPixelMultiple 
)

Definition at line 120 of file raypacket.cpp.

122 {
123  unsigned int i = 0;
124 
125  for( unsigned int y = 0; y < RAYPACKET_DIM; y++ )
126  {
127  for( unsigned int x = 0; x < RAYPACKET_DIM; x++ )
128  {
129  SFVEC3F rayOrigin;
130  SFVEC3F rayDir;
131 
132  aCamera.MakeRay( SFVEC2I( aWindowsPosition.x + x * aPixelMultiple,
133  aWindowsPosition.y + y * aPixelMultiple),
134  rayOrigin, rayDir );
135 
136  m_ray[i].Init( rayOrigin, rayDir );
137 
138  i++;
139  }
140  }
141 
142  wxASSERT( i == RAYPACKET_RAYS_PER_PACKET );
143 
145 }
#define RAYPACKET_DIM
Definition: raypacket.h:37
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:59
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:41
glm::ivec2 SFVEC2I
Definition: xv3d_types.h:39
static void RAYPACKET_GenerateFrustum(FRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
void MakeRay(const SFVEC2I &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on a windows screen position.
Definition: camera.cpp:308
FRUSTUM m_Frustum
Definition: raypacket.h:58
#define RAYPACKET_RAYS_PER_PACKET
Definition: raypacket.h:40
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44

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

◆ RAYPACKET() [4/5]

RAYPACKET::RAYPACKET ( const CAMERA aCamera,
const SFVEC2F aWindowsPosition 
)

Definition at line 71 of file raypacket.cpp.

72 {
73  RAYPACKET_InitRays( aCamera, aWindowsPosition, m_ray );
74 
76 }
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:59
static void RAYPACKET_GenerateFrustum(FRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
FRUSTUM m_Frustum
Definition: raypacket.h:58
void RAYPACKET_InitRays(const CAMERA &aCamera, const SFVEC2F &aWindowsPosition, RAY *aRayPck)
Definition: raypacket.cpp:148

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

◆ RAYPACKET() [5/5]

RAYPACKET::RAYPACKET ( const CAMERA aCamera,
const SFVEC2F aWindowsPosition,
const SFVEC2F a2DWindowsPosDisplacementFactor 
)

Definition at line 79 of file raypacket.cpp.

81 {
82  RAYPACKET_InitRays_with2DDisplacement( aCamera, aWindowsPosition,
83  a2DWindowsPosDisplacementFactor, m_ray );
84 
86 }
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:59
void RAYPACKET_InitRays_with2DDisplacement(const CAMERA &aCamera, const SFVEC2F &aWindowsPosition, const SFVEC2F &a2DWindowsPosDisplacementFactor, RAY *aRayPck)
Definition: raypacket.cpp:167
static void RAYPACKET_GenerateFrustum(FRUSTUM *m_Frustum, RAY *m_ray)
Definition: raypacket.cpp:35
FRUSTUM m_Frustum
Definition: raypacket.h:58

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

Member Data Documentation

◆ m_Frustum

FRUSTUM RAYPACKET::m_Frustum

Definition at line 58 of file raypacket.h.

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

◆ m_ray


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