KiCad PCB EDA Suite
Loading...
Searching...
No Matches
raypacket.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2015-2016 Mario Luzeiro <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef RAYPACKET_H
22#define RAYPACKET_H
23
24#include "ray.h"
25#include "frustum.h"
26#include <gal/3d/camera.h>
27
28#define RAYPACKET_DIM (1 << 3)
29#define RAYPACKET_MASK (unsigned int) ( ( RAYPACKET_DIM - 1 ) )
30#define RAYPACKET_INVMASK (unsigned int) ( ~( RAYPACKET_DIM - 1 ) )
31#define RAYPACKET_RAYS_PER_PACKET ( RAYPACKET_DIM * RAYPACKET_DIM )
32
33
35{
36 RAYPACKET( const CAMERA& aCamera, const SFVEC2I& aWindowsPosition );
37
38 RAYPACKET( const CAMERA& aCamera, const SFVEC2I& aWindowsPosition,
39 const SFVEC3F& aDirectionDisplacementFactor );
40
41 RAYPACKET( const CAMERA& aCamera, const SFVEC2I& aWindowsPosition,
42 unsigned int aPixelMultiple );
43
44 RAYPACKET( const CAMERA& aCamera, const SFVEC2F& aWindowsPosition );
45
46 RAYPACKET( const CAMERA& aCamera, const SFVEC2F& aWindowsPosition,
47 const SFVEC2F& a2DWindowsPosDisplacementFactor );
48
51};
52
53void RAYPACKET_InitRays( const CAMERA& aCamera, const SFVEC2F& aWindowsPosition, RAY* aRayPck );
54
55void RAYPACKET_InitRays_with2DDisplacement( const CAMERA& aCamera, const SFVEC2F& aWindowsPosition,
56 const SFVEC2F& a2DWindowsPosDisplacementFactor,
57 RAY* aRayPck );
58
59#endif // RAYPACKET_H
Define an abstract camera.
A class used to derive camera objects from.
Definition camera.h:99
Implement a frustum that is used for ray packet tests.
#define RAYPACKET_RAYS_PER_PACKET
Definition raypacket.h:31
void RAYPACKET_InitRays_with2DDisplacement(const CAMERA &aCamera, const SFVEC2F &aWindowsPosition, const SFVEC2F &a2DWindowsPosDisplacementFactor, RAY *aRayPck)
void RAYPACKET_InitRays(const CAMERA &aCamera, const SFVEC2F &aWindowsPosition, RAY *aRayPck)
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition raypacket.h:50
FRUSTUM m_Frustum
Definition raypacket.h:49
RAYPACKET(const CAMERA &aCamera, const SFVEC2I &aWindowsPosition)
Definition raypacket.cpp:36
Definition ray.h:59
glm::ivec2 SFVEC2I
Definition xv3d_types.h:35
glm::vec2 SFVEC2F
Definition xv3d_types.h:38
glm::vec3 SFVEC3F
Definition xv3d_types.h:40