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 (C) 1992-2021 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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef RAYPACKET_H
26#define RAYPACKET_H
27
28#include "ray.h"
29#include "frustum.h"
30#include <gal/3d/camera.h>
31
32#define RAYPACKET_DIM (1 << 3)
33#define RAYPACKET_MASK (unsigned int) ( ( RAYPACKET_DIM - 1 ) )
34#define RAYPACKET_INVMASK (unsigned int) ( ~( RAYPACKET_DIM - 1 ) )
35#define RAYPACKET_RAYS_PER_PACKET ( RAYPACKET_DIM * RAYPACKET_DIM )
36
37
39{
40 RAYPACKET( const CAMERA& aCamera, const SFVEC2I& aWindowsPosition );
41
42 RAYPACKET( const CAMERA& aCamera, const SFVEC2I& aWindowsPosition,
43 const SFVEC3F& aDirectionDisplacementFactor );
44
45 RAYPACKET( const CAMERA& aCamera, const SFVEC2I& aWindowsPosition,
46 unsigned int aPixelMultiple );
47
48 RAYPACKET( const CAMERA& aCamera, const SFVEC2F& aWindowsPosition );
49
50 RAYPACKET( const CAMERA& aCamera, const SFVEC2F& aWindowsPosition,
51 const SFVEC2F& a2DWindowsPosDisplacementFactor );
52
55};
56
57void RAYPACKET_InitRays( const CAMERA& aCamera, const SFVEC2F& aWindowsPosition, RAY* aRayPck );
58
59void RAYPACKET_InitRays_with2DDisplacement( const CAMERA& aCamera, const SFVEC2F& aWindowsPosition,
60 const SFVEC2F& a2DWindowsPosDisplacementFactor,
61 RAY* aRayPck );
62
63#endif // RAYPACKET_H
Define an abstract camera.
A class used to derive camera objects from.
Definition: camera.h:103
Implement a frustum that is used for ray packet tests.
#define RAYPACKET_RAYS_PER_PACKET
Definition: raypacket.h:35
void RAYPACKET_InitRays_with2DDisplacement(const CAMERA &aCamera, const SFVEC2F &aWindowsPosition, const SFVEC2F &a2DWindowsPosDisplacementFactor, RAY *aRayPck)
Definition: raypacket.cpp:162
void RAYPACKET_InitRays(const CAMERA &aCamera, const SFVEC2F &aWindowsPosition, RAY *aRayPck)
Definition: raypacket.cpp:143
RAY m_ray[RAYPACKET_RAYS_PER_PACKET]
Definition: raypacket.h:54
FRUSTUM m_Frustum
Definition: raypacket.h:53
Definition: ray.h:63
glm::ivec2 SFVEC2I
Definition: xv3d_types.h:39
glm::vec2 SFVEC2F
Definition: xv3d_types.h:42
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44