KiCad PCB EDA Suite
Loading...
Searching...
No Matches
track_ball.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
25
26#ifndef TRACK_BALL_H
27#define TRACK_BALL_H
28
29#include <gal/3d/camera.h>
30
31
32class TRACK_BALL : public CAMERA
33{
34public:
35 explicit TRACK_BALL( float aInitialDistance );
36 explicit TRACK_BALL( SFVEC3F aInitPos, SFVEC3F aLookat, PROJECTION_TYPE aProjectionType );
37
38 virtual ~TRACK_BALL()
39 {
40 }
41
42 void Drag( const wxPoint& aNewMousePosition ) override;
43
44 void Pan( const wxPoint& aNewMousePosition ) override;
45
46 void Pan( const SFVEC3F& aDeltaOffsetInc ) override;
47
48 void Pan_T1( const SFVEC3F& aDeltaOffsetInc ) override;
49
50 void Reset_T1() override;
51
52 void SetT0_and_T1_current_T() override;
53
54 void Interpolate( float t ) override;
55
56private:
57 void initQuat();
58
62 double m_quat_t0[4];
63 double m_quat_t1[4];
64};
65
66#endif // TRACK_BALL_H
Define an abstract camera.
PROJECTION_TYPE
Definition camera.h:36
CAMERA(float aInitialDistance)
Initialize a camera.
Definition camera.cpp:50
void initQuat()
void Pan_T1(const SFVEC3F &aDeltaOffsetInc) override
void SetT0_and_T1_current_T() override
This will set T0 and T1 with the current values.
void Interpolate(float t) override
It will update the matrix to interpolate between T0 and T1 values.
TRACK_BALL(float aInitialDistance)
void Pan(const wxPoint &aNewMousePosition) override
void Reset_T1() override
double m_quat_t1[4]
Definition track_ball.h:63
double m_quat_t0[4]
interpolate quaternions of the trackball
Definition track_ball.h:62
virtual ~TRACK_BALL()
Definition track_ball.h:38
void Drag(const wxPoint &aNewMousePosition) override
Calculate a new mouse drag position.
glm::vec3 SFVEC3F
Definition xv3d_types.h:40