Line | |
---|
1 | #ifndef MXARCBALL_INCLUDED // -*- C++ -*-
|
---|
2 | #define MXARCBALL_INCLUDED
|
---|
3 | #if !defined(__GNUC__)
|
---|
4 | # pragma once
|
---|
5 | #endif
|
---|
6 |
|
---|
7 | /************************************************************************
|
---|
8 |
|
---|
9 | MxArcball
|
---|
10 |
|
---|
11 | Copyright (C) 1998 Michael Garland. See "COPYING.txt" for details.
|
---|
12 |
|
---|
13 | $Id: MxArcball.h,v 1.1 2002/09/24 16:53:54 wimmer Exp $
|
---|
14 |
|
---|
15 | ************************************************************************/
|
---|
16 |
|
---|
17 | #include "MxVec4.h"
|
---|
18 | #include "MxMat4.h"
|
---|
19 | #include "MxManipulator.h"
|
---|
20 |
|
---|
21 | typedef Vec4 Quat;
|
---|
22 | struct BallData;
|
---|
23 |
|
---|
24 |
|
---|
25 | class MxArcball : public MxManipulator
|
---|
26 | {
|
---|
27 | private:
|
---|
28 | int mousex, mousey;
|
---|
29 | int startx, starty;
|
---|
30 | BallData *ball;
|
---|
31 | Quat center;
|
---|
32 | float radius;
|
---|
33 |
|
---|
34 | enum {NoDrag=0, Spin, Dolly, Zoom, LightAdjust} dragging;
|
---|
35 |
|
---|
36 | double __proj_save[16];
|
---|
37 |
|
---|
38 | public:
|
---|
39 | Vec4 vNow;
|
---|
40 | float cam[3];
|
---|
41 |
|
---|
42 | public:
|
---|
43 | MxArcball() { ball=NULL; }
|
---|
44 | MxArcball(const MxBounds& bounds, float aspect)
|
---|
45 | { ball=NULL; init(bounds,aspect); }
|
---|
46 | ~MxArcball();
|
---|
47 | void init(const MxBounds& bounds, float aspect);
|
---|
48 |
|
---|
49 |
|
---|
50 | bool mouse_down(int which, int x, int y, int kind=1);
|
---|
51 | bool mouse_up(int which, int x, int y, int kind=2);
|
---|
52 | bool motion(int x, int y);
|
---|
53 |
|
---|
54 | void apply();
|
---|
55 | void unapply();
|
---|
56 | void draw();
|
---|
57 |
|
---|
58 | double *get_qnow();
|
---|
59 | };
|
---|
60 |
|
---|
61 | // MXARCBALL_INCLUDED
|
---|
62 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.