diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-12-14 17:05:25 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-12-14 17:07:19 +0100 |
| commit | ca49968016ef47289c4350ce676e444ac33b8180 (patch) | |
| tree | 5ad43fc82b28d44683fad4227810f74f7b097608 | |
| parent | be07837122b161fe7951064da06e6468b35b29f6 (diff) | |
| download | Multimedia-ca49968016ef47289c4350ce676e444ac33b8180.tar.gz Multimedia-ca49968016ef47289c4350ce676e444ac33b8180.zip | |
Add top hit detection
| -rw-r--r-- | src/gldisc.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gldisc.cpp b/src/gldisc.cpp index bd4cb6c..5afa4d4 100644 --- a/src/gldisc.cpp +++ b/src/gldisc.cpp @@ -96,6 +96,13 @@ bool GLDisc::isHit(QVector3D p1, QVector3D p2) return true; } + QVector3D vecTop = p1 + lineVector * ((m_height - p1.z()) / lineVector.z()); + + if (vecTop.length() < m_circleRadius) + { + return true; + } + return false; } |
