summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gldisc.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gldisc.cpp b/src/gldisc.cpp
index a2c22b5..03a0c6b 100644
--- a/src/gldisc.cpp
+++ b/src/gldisc.cpp
@@ -82,12 +82,21 @@ void GLDisc::makeSurface(QVector<GLPoint> *pointContainer,
bool GLDisc::isHit(QVector3D p1, QVector3D p2)
{
- if(!GLBody::isHit(p1, p2))
+ if (!GLBody::isHit(p1, p2))
{
return false;
}
+ QVector3D lineVector = p2 - p1;
+ QVector3D vecBottom = p1 + lineVector * (-p1.z() / lineVector.z());
+
+ if (vecBottom.length() < m_circleRadius)
+ {
+ return true;
+ }
+
+ return false;
}
QVector2D GLDisc::calculatePoint(double sideAngle)