HOG2
gui
Trackball.h
Go to the documentation of this file.
1
/*
2
* $Id: trackball.h
3
* hog2
4
*
5
* Created by ggs 12/06/02.
6
* Modified by Nathan Sturtevant on 02/29/20.
7
*
8
Copyright: Copyright © 2002-2003 Apple Computer, Inc., All Rights Reserved
9
10
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
11
("Apple") in consideration of your agreement to the following terms, and your
12
use, installation, modification or redistribution of this Apple software
13
constitutes acceptance of these terms. If you do not agree with these terms,
14
please do not use, install, modify or redistribute this Apple software.
15
16
In consideration of your agreement to abide by the following terms, and subject
17
to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
18
copyrights in this original Apple software (the "Apple Software"), to use,
19
reproduce, modify and redistribute the Apple Software, with or without
20
modifications, in source and/or binary forms; provided that if you redistribute
21
the Apple Software in its entirety and without modifications, you must retain
22
this notice and the following text and disclaimers in all such redistributions of
23
the Apple Software. Neither the name, trademarks, service marks or logos of
24
Apple Computer, Inc. may be used to endorse or promote products derived from the
25
Apple Software without specific prior written permission from Apple. Except as
26
expressly stated in this notice, no other rights or licenses, express or implied,
27
are granted by Apple herein, including but not limited to any patent rights that
28
may be infringed by your derivative works or by other works in which the Apple
29
Software may be incorporated.
30
31
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
32
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
33
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
34
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
35
COMBINATION WITH YOUR PRODUCTS.
36
37
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
38
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
39
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40
ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
41
OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
42
(INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
43
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44
*
45
*/
46
#ifndef __trackball_h__
47
#define __trackball_h__
48
49
#ifdef __cplusplus
50
extern
"C"
{
51
#endif
52
53
// called with the start position and the window origin + size
54
void
startTrackball
(
long
x,
long
y,
long
originX,
long
originY,
long
width
,
long
height
);
55
56
// calculated rotation based on current mouse position
57
void
rollToTrackball
(
long
x,
long
y,
float
rot [4]);
// rot is output rotation angle
58
59
// add a GL rotation (dA) to an existing GL rotation (A)
60
void
addToRotationTrackball
(
float
* dA,
float
* A);
61
62
#ifdef __cplusplus
63
}
64
#endif
65
66
#endif
width
int width
Definition:
SFML_HOG.cpp:54
startTrackball
void startTrackball(long x, long y, long originX, long originY, long width, long height)
Definition:
Trackball.cpp:62
height
int height
Definition:
SFML_HOG.cpp:54
addToRotationTrackball
void addToRotationTrackball(float *dA, float *A)
Definition:
Trackball.cpp:168
rollToTrackball
void rollToTrackball(long x, long y, float rot[4])
Definition:
Trackball.cpp:104
Generated by
1.8.17