ソースを参照

rotation/freefly cameras

develop
Robin Thoni 8年前
コミット
5042377289

+ 26
- 68
TheGame/renderwidget.cpp ファイルの表示

@@ -6,18 +6,17 @@
6 6
 #include "entities/ugeentityaxes.h"
7 7
 #include "utils/wavefrontobj.h"
8 8
 #include "entities/ugeentitywavefrontobj.h"
9
+#include "cameras/rotationcamera.h"
10
+#include "cameras/freeflycamera.h"
9 11
 
10 12
 RenderWidget::RenderWidget(QWidget *parent) :
11 13
     QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
12
-  , _radius(5.0)
13
-  , _phi(45.0)
14
-  , _theta(45.0)
15 14
 {
16 15
     setMouseTracking(true);
17 16
     setFocusPolicy(Qt::StrongFocus);
18 17
 
19
-    _device = new OpenGLRenderDevice(this);
20
-    _engine = new UGameEngine(_device);
18
+    _engine = new UGameEngine(new OpenGLRenderDevice(this));
19
+    _camera = new FreeFlyCamera(_engine, this);
21 20
 
22 21
     _engine->addEntity(new UGEEntityAxes(_engine));
23 22
 
@@ -27,7 +26,6 @@ RenderWidget::RenderWidget(QWidget *parent) :
27 26
         cube->rotate(Vector3D(0.0, 45.0, 45.0));
28 27
         cube->move(Vector3D(0, i, i));
29 28
         cube->setScale(Vector3D(1.0, 2.0, 1.0));
30
-    //    cube->hide();
31 29
         _engine->addEntity(cube);
32 30
         _entities.append(cube);
33 31
     }
@@ -37,30 +35,21 @@ RenderWidget::RenderWidget(QWidget *parent) :
37 35
     UGEEntityWaveFrontObj* obj = new UGEEntityWaveFrontObj(wavefrontObj, this);
38 36
     _engine->addEntity(obj);
39 37
     _entities.append(obj);
40
-//    obj->hide();
41
-//    _entity = cube;
42 38
     animate();
43 39
 }
44 40
 
45 41
 void RenderWidget::initializeGL()
46 42
 {
47 43
     makeCurrent();
48
-    _device->setClearColor(Qt::gray);
49
-    _device->initialize(70, width(), height());
44
+    _engine->setClearColor(Qt::gray);
45
+    _engine->initialize(70, width(), height());
50 46
 
51
-    _device->loadTextureFromFile("test", "/home/robin/Downloads/test.png");
47
+    _engine->loadTextureFromFile("test", "/home/robin/Downloads/test.png");
52 48
 }
53 49
 
54 50
 void RenderWidget::paintGL()
55 51
 {
56
-    float theta = fabs(_theta / 180.0 * M_PI);
57
-    float phi = _phi / 180.0 * M_PI;
58
-    Vector3D center = Vector3D(
59
-                _radius * sin(theta) * sin(phi),
60
-                _radius * cos(theta),
61
-                _radius * sin(theta) * cos(phi)
62
-                );
63
-    _device->lookAt(center, Vector3D(0.0f, 0.0f, 0.0f));
52
+    _camera->updateLookAt();
64 53
     _engine->draw();
65 54
 //    _device->drawLine(ColorVector3D(Qt::black, 0, 0, 0), ColorVector3D(Qt::black, pos));
66 55
 //    _device->drawPoint(ColorVector3D(Qt::magenta, 0.5, 0.5, 0.5));
@@ -68,35 +57,22 @@ void RenderWidget::paintGL()
68 57
 
69 58
 void RenderWidget::resizeGL(int width, int height)
70 59
 {
71
-    _device->resize(width, height);
60
+    _engine->resize(width, height);
72 61
 }
73 62
 
74
-float RenderWidget::normalizeAngle(float angle)
63
+void RenderWidget::mousePressEvent(QMouseEvent *event)
75 64
 {
76
-    while (angle >= 360.0) {
77
-        angle -= 360.0;
78
-    }
79
-    while (angle < 0.0) {
80
-        angle += 360.0;
81
-    }
82
-    return angle;
65
+    _camera->mousePressEvent(event);
83 66
 }
84 67
 
85
-void RenderWidget::mousePressEvent(QMouseEvent *event)
68
+void RenderWidget::mouseReleaseEvent(QMouseEvent *event)
86 69
 {
87
-    _lastPoint = event->pos();
70
+    _camera->mouseReleaseEvent(event);
88 71
 }
89 72
 
90 73
 void RenderWidget::mouseMoveEvent(QMouseEvent *event)
91 74
 {
92
-    if (event->buttons() & Qt::LeftButton) {
93
-        QPoint diff = event->pos() - _lastPoint;
94
-
95
-        rotate(-diff.x(), -diff.y());
96
-
97
-        _lastPoint = event->pos();
98
-        update();
99
-    }
75
+    _camera->mouseMoveEvent(event);
100 76
 
101 77
 //    Vector3D dd = _device->get2DFrom3D(Vector3D(0.5, 0.5, 0.5));
102 78
 //    dd.setY(height() - dd.getY());
@@ -105,49 +81,31 @@ void RenderWidget::mouseMoveEvent(QMouseEvent *event)
105 81
 
106 82
 }
107 83
 
84
+void RenderWidget::mouseDoubleClickEvent(QMouseEvent *event)
85
+{
86
+    _camera->mouseDoubleClickEvent(event);
87
+}
88
+
108 89
 void RenderWidget::wheelEvent(QWheelEvent *event)
109 90
 {
110
-    _radius = qMax(2.0, _radius - event->delta() / 30.0);
111
-    update();
91
+    _camera->wheelEvent(event);
112 92
 }
113 93
 
114 94
 void RenderWidget::keyPressEvent(QKeyEvent *event)
115 95
 {
116
-    if (event->key() == Qt::Key_Up) {
117
-        rotate(0.0, 1.0);
118
-    }
119
-    else if (event->key() == Qt::Key_Down) {
120
-        rotate(0.0, -1.0);
121
-    }
122
-    else if (event->key() == Qt::Key_Left) {
123
-        rotate(1.0, 0.0);
124
-    }
125
-    else if (event->key() == Qt::Key_Right) {
126
-        rotate(-1.0, 0.0);
127
-    }
96
+    _camera->keyPressEvent(event);
128 97
 }
129 98
 
130
-void RenderWidget::rotate(float phi, float theta)
99
+void RenderWidget::keyReleaseEvent(QKeyEvent *event)
131 100
 {
132
-    _phi = normalizeAngle(_phi + phi);
133
-    if (_theta + theta >= 180.0) {
134
-        theta = 179.0;
135
-    }
136
-    else if (_theta + theta < 1.0) {
137
-        theta = 1.0;
138
-    }
139
-    else {
140
-        _theta = normalizeAngle(_theta + theta);
141
-    }
142
-    update();
101
+    _camera->keyReleaseEvent(event);
143 102
 }
144 103
 
145 104
 void RenderWidget::animate()
146 105
 {
147
-//    _angle += 0.1;
148
-    for (int i = 0; i < _entities.size(); ++i) {
149
-        _entities[i]->rotate(Vector3D(0.0, 2.0, 2.0));
150
-    }
106
+//    for (int i = 0; i < _entities.size(); ++i) {
107
+//        _entities[i]->rotate(Vector3D(0.0, 2.0, 2.0));
108
+//    }
151 109
     QTimer::singleShot(20, this, SLOT(animate()));
152 110
     update();
153 111
 }

+ 6
- 14
TheGame/renderwidget.h ファイルの表示

@@ -7,6 +7,7 @@
7 7
 #include <QKeyEvent>
8 8
 #include "engine/ugameengine.h"
9 9
 #include "openglrenderdevice.h"
10
+#include "cameras/abstractcamera.h"
10 11
 
11 12
 class RenderWidget : public QGLWidget
12 13
 {
@@ -19,14 +20,13 @@ protected:
19 20
     void paintGL();
20 21
     void resizeGL(int width, int height);
21 22
 
22
-    float normalizeAngle(float angle);
23
-
24 23
     void mousePressEvent(QMouseEvent* event);
24
+    void mouseReleaseEvent(QMouseEvent *event);
25 25
     void mouseMoveEvent(QMouseEvent* event);
26
+    void mouseDoubleClickEvent(QMouseEvent* event);
26 27
     void wheelEvent(QWheelEvent* event);
27 28
     void keyPressEvent(QKeyEvent* event);
28
-
29
-    void rotate(float phi, float theta);
29
+    void keyReleaseEvent(QKeyEvent* event);
30 30
 
31 31
 signals:
32 32
 
@@ -34,21 +34,13 @@ public slots:
34 34
     void animate();
35 35
 
36 36
 private:
37
-    AbstractRenderDevice* _device;
38
-
39 37
     UGameEngine* _engine;
40 38
 
41
-    QPoint _lastPoint;
42
-
43
-    double _radius;
44
-
45
-    double _phi;
46
-
47
-    double _theta;
48
-
49 39
     Vector3D pos;
50 40
 
51 41
     QList<UGEEntity*> _entities;
42
+
43
+    AbstractCamera* _camera;
52 44
 };
53 45
 
54 46
 #endif // RENDERWIDGET_H

+ 10
- 2
UGameEngine/UGameEngine.pro ファイルの表示

@@ -25,7 +25,10 @@ SOURCES += engine/ugameengine.cpp \
25 25
     utils/vector2d.cpp \
26 26
     utils/vector3d.cpp \
27 27
     utils/matrix3x3.cpp \
28
-    utils/tools.cpp
28
+    utils/tools.cpp \
29
+    cameras/abstractcamera.cpp \
30
+    cameras/rotationcamera.cpp \
31
+    cameras/freeflycamera.cpp
29 32
 
30 33
 HEADERS += engine/ugameengine.h\
31 34
     engine/abstractrenderdevice.h \
@@ -44,7 +47,12 @@ HEADERS += engine/ugameengine.h\
44 47
     utils/matrixmxn.hxx \
45 48
     utils/matrix3x3.h \
46 49
     utils/tools.h \
47
-    utils/tools.hxx
50
+    utils/tools.hxx \
51
+    cameras/abstractcamera.h \
52
+    cameras/rotationcamera.h \
53
+    cameras/freeflycamera.h \
54
+    utils/matrixdebug.h \
55
+    utils/matrixdebug.hxx
48 56
 
49 57
 
50 58
 # FLEX && BISON

+ 43
- 0
UGameEngine/cameras/abstractcamera.cpp ファイルの表示

@@ -0,0 +1,43 @@
1
+#include "abstractcamera.h"
2
+
3
+AbstractCamera::AbstractCamera(UGameEngine* engine, QWidget* widget)
4
+    : _engine(engine)
5
+    , _widget(widget)
6
+{
7
+}
8
+
9
+void AbstractCamera::mousePressEvent(QMouseEvent* event)
10
+{
11
+    (void) event;
12
+}
13
+
14
+void AbstractCamera::mouseReleaseEvent(QMouseEvent *event)
15
+{
16
+    (void) event;
17
+}
18
+
19
+void AbstractCamera::mouseMoveEvent(QMouseEvent* event)
20
+{
21
+    (void) event;
22
+}
23
+
24
+void AbstractCamera::mouseDoubleClickEvent(QMouseEvent* event)
25
+{
26
+    (void) event;
27
+}
28
+
29
+void AbstractCamera::wheelEvent(QWheelEvent* event)
30
+{
31
+    (void) event;
32
+}
33
+
34
+void AbstractCamera::keyPressEvent(QKeyEvent* event)
35
+{
36
+    (void) event;
37
+}
38
+
39
+void AbstractCamera::keyReleaseEvent(QKeyEvent* event)
40
+{
41
+    (void) event;
42
+}
43
+

+ 34
- 0
UGameEngine/cameras/abstractcamera.h ファイルの表示

@@ -0,0 +1,34 @@
1
+#ifndef ABSTRACTCAMERA_H
2
+#define ABSTRACTCAMERA_H
3
+
4
+#include <QMouseEvent>
5
+#include <QWheelEvent>
6
+#include <QKeyEvent>
7
+#include <QtWidgets/QWidget>
8
+
9
+#include "engine/ugameengine.h"
10
+
11
+class AbstractCamera
12
+{
13
+public:
14
+    AbstractCamera(UGameEngine* engine, QWidget* widget);
15
+
16
+    virtual void mousePressEvent(QMouseEvent* event);
17
+    virtual void mouseReleaseEvent(QMouseEvent *event);
18
+    virtual void mouseMoveEvent(QMouseEvent* event);
19
+    virtual void mouseDoubleClickEvent(QMouseEvent* event);
20
+
21
+    virtual void wheelEvent(QWheelEvent* event);
22
+
23
+    virtual void keyPressEvent(QKeyEvent* event);
24
+    virtual void keyReleaseEvent(QKeyEvent* event);
25
+
26
+    virtual void updateLookAt() = 0;
27
+
28
+protected:
29
+    UGameEngine* _engine;
30
+
31
+    QWidget* _widget;
32
+};
33
+
34
+#endif // ABSTRACTCAMERA_H

+ 85
- 0
UGameEngine/cameras/freeflycamera.cpp ファイルの表示

@@ -0,0 +1,85 @@
1
+#include "freeflycamera.h"
2
+#include <QCursor>
3
+#include "utils/tools.h"
4
+
5
+FreeFlyCamera::FreeFlyCamera(UGameEngine *engine, QWidget* widget)
6
+    : AbstractCamera(engine, widget)
7
+    , _speed(0.2)
8
+    , _phi(45)
9
+    , _theta(45)
10
+{
11
+    _widget->setCursor(Qt::BlankCursor);
12
+    _lastPoint = QPoint(_widget->width()/2,_widget->height()/2);
13
+    rotate(0, 0);
14
+}
15
+
16
+void FreeFlyCamera::mouseMoveEvent(QMouseEvent *event)
17
+{
18
+    QPoint diff = (event->pos() - _lastPoint) / 2;
19
+
20
+    rotate(-diff.x(), diff.y());
21
+
22
+    QPoint glob = _widget->mapToGlobal(QPoint(_widget->width()/2,_widget->height()/2));
23
+    QCursor::setPos(glob);
24
+    _lastPoint = QPoint(_widget->width()/2,_widget->height()/2);
25
+}
26
+
27
+void FreeFlyCamera::keyPressEvent(QKeyEvent *event)
28
+{
29
+    if (event->isAutoRepeat()) {
30
+        return;
31
+    }
32
+    if (event->key() == Qt::Key_Z) {
33
+        _speedVector.setX(1);
34
+    }
35
+    else if (event->key() == Qt::Key_S) {
36
+        _speedVector.setX(-1);
37
+    }
38
+    else if (event->key() == Qt::Key_Q) {
39
+        _speedVector.setY(1);
40
+    }
41
+    else if (event->key() == Qt::Key_D) {
42
+        _speedVector.setY(-1);
43
+    }
44
+}
45
+
46
+void FreeFlyCamera::keyReleaseEvent(QKeyEvent *event)
47
+{
48
+    if (event->key() == Qt::Key_Z || event->key() == Qt::Key_S) {
49
+        _speedVector.setX(0);
50
+    }
51
+    else if (event->key() == Qt::Key_Q || event->key() == Qt::Key_D) {
52
+        _speedVector.setY(0);
53
+    }
54
+}
55
+
56
+void FreeFlyCamera::updateLookAt()
57
+{
58
+    Vector3D perp(_direction.getZ(), 0, -_direction.getX());
59
+    qDebug() << perp.getX() << perp.getY() << perp.getZ() << perp.norm() << _direction.getX() << _direction.getY() << _direction.getZ() << _direction.norm();
60
+    perp /= perp.norm();
61
+    _position += Vector3D(_direction * _speedVector.getX()).mult(_speed);
62
+    _position += Vector3D(perp * _speedVector.getY()).mult(_speed);
63
+    _engine->lookAt(_position, _direction + _position);
64
+}
65
+
66
+void FreeFlyCamera::rotate(float phi, float theta)
67
+{
68
+    _phi = Tools::normalizeAngle(_phi + phi);
69
+    if (_theta + theta >= 180.0) {
70
+        theta = 179.0;
71
+    }
72
+    else if (_theta + theta < 1.0) {
73
+        theta = 1.0;
74
+    }
75
+    else {
76
+        _theta = Tools::normalizeAngle(_theta + theta);
77
+    }
78
+    float thetaRad = fabs(_theta / 180.0 * M_PI);
79
+    float phiRad = _phi / 180.0 * M_PI;
80
+    _direction = Vector3D(
81
+                sin(thetaRad) * sin(phiRad),
82
+                cos(thetaRad),
83
+                sin(thetaRad) * cos(phiRad)
84
+                );
85
+}

+ 37
- 0
UGameEngine/cameras/freeflycamera.h ファイルの表示

@@ -0,0 +1,37 @@
1
+#ifndef FREEFLYCAMERA_H
2
+#define FREEFLYCAMERA_H
3
+
4
+#include "cameras/abstractcamera.h"
5
+#include "utils/vector3d.h"
6
+
7
+class FreeFlyCamera : public AbstractCamera
8
+{
9
+public:
10
+    FreeFlyCamera(UGameEngine* engine, QWidget *widget);
11
+
12
+    virtual void mouseMoveEvent(QMouseEvent* event);
13
+
14
+    virtual void keyPressEvent(QKeyEvent* event);
15
+    virtual void keyReleaseEvent(QKeyEvent* event);
16
+
17
+    virtual void updateLookAt();
18
+
19
+    void rotate(float phi, float theta);
20
+
21
+private:
22
+    Vector3D _direction;
23
+
24
+    Vector3D _position;
25
+
26
+    Vector2D _speedVector;
27
+
28
+    double _speed;
29
+
30
+    double _phi;
31
+
32
+    double _theta;
33
+
34
+    QPoint _lastPoint;
35
+};
36
+
37
+#endif // FREEFLYCAMERA_H

+ 73
- 0
UGameEngine/cameras/rotationcamera.cpp ファイルの表示

@@ -0,0 +1,73 @@
1
+#include "rotationcamera.h"
2
+#include "utils/tools.h"
3
+
4
+RotationCamera::RotationCamera(UGameEngine* engine, QWidget* widget, double radius, double phi, double theta)
5
+    : AbstractCamera(engine, widget)
6
+    , _radius(radius)
7
+    , _phi(phi)
8
+    , _theta(theta)
9
+{
10
+}
11
+
12
+void RotationCamera::mousePressEvent(QMouseEvent *event)
13
+{
14
+    _lastPoint = event->pos();
15
+}
16
+
17
+void RotationCamera::mouseMoveEvent(QMouseEvent *event)
18
+{
19
+    if (event->buttons() & Qt::LeftButton) {
20
+        QPoint diff = event->pos() - _lastPoint;
21
+
22
+        rotate(-diff.x(), -diff.y());
23
+
24
+        _lastPoint = event->pos();
25
+    }
26
+}
27
+
28
+void RotationCamera::wheelEvent(QWheelEvent *event)
29
+{
30
+    _radius = qMax(2.0, _radius - event->delta() / 30.0);
31
+}
32
+
33
+void RotationCamera::keyPressEvent(QKeyEvent *event)
34
+{
35
+    if (event->key() == Qt::Key_Up) {
36
+        rotate(0.0, 1.0);
37
+    }
38
+    else if (event->key() == Qt::Key_Down) {
39
+        rotate(0.0, -1.0);
40
+    }
41
+    else if (event->key() == Qt::Key_Left) {
42
+        rotate(1.0, 0.0);
43
+    }
44
+    else if (event->key() == Qt::Key_Right) {
45
+        rotate(-1.0, 0.0);
46
+    }
47
+}
48
+
49
+void RotationCamera::updateLookAt()
50
+{
51
+    float theta = fabs(_theta / 180.0 * M_PI);
52
+    float phi = _phi / 180.0 * M_PI;
53
+    Vector3D center = Vector3D(
54
+                _radius * sin(theta) * sin(phi),
55
+                _radius * cos(theta),
56
+                _radius * sin(theta) * cos(phi)
57
+                );
58
+    _engine->lookAt(center, Vector3D(0.0f, 0.0f, 0.0f));
59
+}
60
+
61
+void RotationCamera::rotate(float phi, float theta)
62
+{
63
+    _phi = Tools::normalizeAngle(_phi + phi);
64
+    if (_theta + theta >= 180.0) {
65
+        theta = 179.0;
66
+    }
67
+    else if (_theta + theta < 1.0) {
68
+        theta = 1.0;
69
+    }
70
+    else {
71
+        _theta = Tools::normalizeAngle(_theta + theta);
72
+    }
73
+}

+ 32
- 0
UGameEngine/cameras/rotationcamera.h ファイルの表示

@@ -0,0 +1,32 @@
1
+#ifndef ROTATIONCAMERA_H
2
+#define ROTATIONCAMERA_H
3
+
4
+#include "abstractcamera.h"
5
+
6
+class RotationCamera : public AbstractCamera
7
+{
8
+public:
9
+    RotationCamera(UGameEngine* engine, QWidget *widget, double radius, double phi, double theta);
10
+
11
+    virtual void mousePressEvent(QMouseEvent* event);
12
+    virtual void mouseMoveEvent(QMouseEvent* event);
13
+
14
+    virtual void wheelEvent(QWheelEvent* event);
15
+
16
+    virtual void keyPressEvent(QKeyEvent* event);
17
+
18
+    virtual void updateLookAt();
19
+
20
+    void rotate(float phi, float theta);
21
+
22
+private:
23
+    double _radius;
24
+
25
+    double _phi;
26
+
27
+    double _theta;
28
+
29
+    QPoint _lastPoint;
30
+};
31
+
32
+#endif // ROTATIONCAMERA_H

+ 1
- 1
UGameEngine/engine/abstractrenderdevice.h ファイルの表示

@@ -30,7 +30,7 @@ public:
30 30
     virtual Vector3D get3DFrom2D(int x, int y) = 0;
31 31
 
32 32
 public slots:
33
-    virtual void setClearColor(const QColor &getClearColor);
33
+    virtual void setClearColor(const QColor &clearColor);
34 34
 
35 35
     virtual void setCurrentColor(const QColor &color);
36 36
 

+ 25
- 0
UGameEngine/engine/ugameengine.cpp ファイルの表示

@@ -28,3 +28,28 @@ void UGameEngine::addEntity(UGEEntity *entity)
28 28
 {
29 29
     _entitites.append(entity);
30 30
 }
31
+
32
+void UGameEngine::lookAt(const Vector3D &eye, const Vector3D &center, const Vector3D &up)
33
+{
34
+    _device->lookAt(eye, center, up);
35
+}
36
+
37
+void UGameEngine::setClearColor(const QColor &clearColor)
38
+{
39
+    _device->setClearColor(clearColor);
40
+}
41
+
42
+void UGameEngine::initialize(int fov, int width, int height)
43
+{
44
+    _device->initialize(fov, width, height);
45
+}
46
+
47
+void UGameEngine::resize(int width, int height)
48
+{
49
+    _device->resize(width, height);
50
+}
51
+
52
+void UGameEngine::loadTextureFromFile(const QVariant &id, const QString &filename)
53
+{
54
+    _device->loadTextureFromFile(id, filename);
55
+}

+ 10
- 0
UGameEngine/engine/ugameengine.h ファイルの表示

@@ -16,6 +16,16 @@ public:
16 16
 public slots:
17 17
     void addEntity(UGEEntity* entity);
18 18
 
19
+    void lookAt(const Vector3D& eye, const Vector3D& center, const Vector3D& up = Vector3D(0.0, 1.0, 0.0));
20
+
21
+    void setClearColor(const QColor &clearColor);
22
+
23
+    void initialize(int fov, int width, int height);
24
+
25
+    void resize(int width, int height);
26
+
27
+    void loadTextureFromFile(const QVariant& id, const QString& filename);
28
+
19 29
 protected:
20 30
     QList<UGEEntity*> _entitites;
21 31
 

+ 11
- 0
UGameEngine/utils/matrixdebug.h ファイルの表示

@@ -0,0 +1,11 @@
1
+#ifndef MATRIXDEBUG_H
2
+#define MATRIXDEBUG_H
3
+
4
+#include <QDebug>
5
+#include "matrixmxn.h"
6
+
7
+uge_gm_tmpl_mn QDebug operator<<(QDebug dbg, const MatrixMxN<M, N>& v);
8
+
9
+#include "matrixdebug.hxx"
10
+
11
+#endif // MATRIXDEBUG_H

+ 13
- 0
UGameEngine/utils/matrixdebug.hxx ファイルの表示

@@ -0,0 +1,13 @@
1
+#include "matrixdebug.h"
2
+
3
+uge_gm_tmpl_mn QDebug operator<<(QDebug dbg, const MatrixMxN<M, N> &v)
4
+{
5
+    QDebug d = dbg.nospace();
6
+    for (int i = 0; i < M; ++i) {
7
+        for (int j = 0; j < N; ++j) {
8
+            d << v.getScalar(i, j) << (j == N - 1 ? "" : " ");
9
+        }
10
+        d << "\n";
11
+    }
12
+    return dbg.nospace() << "(" << v.getX() << ", " << v.getY() << ", " << v.getZ() << ")";
13
+}

+ 0
- 2
UGameEngine/utils/vectorxd.h ファイルの表示

@@ -46,8 +46,6 @@ protected:
46 46
     using GenericMatrix<X, 1, VectorXD<X>>::_scalars;
47 47
 };
48 48
 
49
-//tmplx QDebug operator<<(QDebug dbg, const VectorXD<X>& v);
50
-
51 49
 #include "vectorxd.hxx"
52 50
 
53 51
 #endif // VECTORXD_H

+ 0
- 5
UGameEngine/utils/vectorxd.hxx ファイルの表示

@@ -78,8 +78,3 @@ uge_gv_tmpl_xt T* GenericVector<X, T>::getThis() const
78 78
 {
79 79
     return (T*)this;
80 80
 }
81
-
82
-//uge_gv_tmpl_xt QDebug operator<<(QDebug dbg, const T &v)
83
-//{
84
-//    return dbg.nospace() << "(" << v.getX() << ", " << v.getY() << ", " << v.getZ() << ")";
85
-//}

読み込み中…
キャンセル
保存