75 lines
1.6 KiB
C++
75 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <osg/OperationThread>
|
|
|
|
#include <QVariant>
|
|
#include <osg/Vec3d>
|
|
#include <osg/Matrixd>
|
|
|
|
class RadarLobeOperate : public osg::Operation
|
|
{
|
|
public:
|
|
RadarLobeOperate(osg::Node *pTerrain, osg::Vec3d center, osg::Matrixd localToWorld, osg::Matrixd worldToLocal, OpenThreads::Mutex &mutex);
|
|
~RadarLobeOperate();
|
|
|
|
void SetBlockCount(OpenThreads::BlockCount *pBlockCount);
|
|
|
|
void SetComputerPara(QList<osg::Vec3d> pts, double angleYaw, double anglePitch);
|
|
void AddIntersectObject(osg::Node *pObject);
|
|
void RemoveIntersectObject(osg::Node *pObject);
|
|
|
|
virtual void operator () (osg::Object* callingObject);
|
|
|
|
QVariantList GetIntersections()
|
|
{
|
|
return _intersections;
|
|
}
|
|
|
|
//QVariantList ComputerIntersect(QList<osg::Vec3d> pts, double angleYaw, double anglePitch);
|
|
//QVariantList IntersectTerrain(QList<osg::Vec3d> pts, double angleYaw, double anglePitch);
|
|
//QVariantList IntersectObject(QVariantList pts);
|
|
|
|
osg::Vec3d GetPointMapping(osg::Vec3d org, double ang, osg::Vec3d axis, osg::Vec3d pt);
|
|
|
|
bool IsIntersectTerrain()
|
|
{
|
|
return m_bIntersectTerrain;
|
|
}
|
|
|
|
double GetIntersectDistance()
|
|
{
|
|
return m_dDisHill;
|
|
}
|
|
|
|
void ComputerAngle(osg::Vec3d hit);
|
|
|
|
double GetAngle()
|
|
{
|
|
return m_dAngle;
|
|
}
|
|
|
|
private:
|
|
OpenThreads::BlockCount *_pBlockCount;
|
|
OpenThreads::Mutex &_mutex;
|
|
|
|
QVariantList _intersections;
|
|
|
|
osg::Node *m_pTerrain;
|
|
|
|
osg::Vec3d m_center;
|
|
|
|
osg::Matrixd m_localToWorld;
|
|
osg::Matrixd m_worldToLocal;
|
|
|
|
QList<osg::Vec3d> m_pts;
|
|
double m_angleYaw;
|
|
double m_anglePitch;
|
|
|
|
QList<osg::Node *> m_Objects;
|
|
|
|
bool m_bIntersectTerrain;
|
|
double m_dDisHill;
|
|
double m_dAngle;
|
|
};
|
|
|