VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtTritonIntersector.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvTriton/vrvTriton.h>
13 
15 
16 class DtVector;
17 
18 namespace makVrv
19 {
20  class DtCameraNode;
21 
28  {
29  public:
31  DtTritonIntersector( DtDe& de, int modelSet );
32 
34  virtual ~DtTritonIntersector();
35 
55  virtual bool findNearestIntersection(double x, double y, double z,
56  double vx, double vy, double vz, DtOsgIntersectorResult& intersection,
57  const DtOsgRenderer::RootList& intersectionRoots, osg::Node::NodeMask mask,
58  std::list<osg::Node*>* excludeNodeList, bool returnHitTriangle,
59  double maxIsectorLength, bool useHighLod );
60 
74  virtual bool findIntersectionsThroughPoint(double x, double y, double z,
75  double vx, double vy, double vz,
77  const DtOsgRenderer::RootList& intersectionRoots, osg::Node::NodeMask mask,
78  std::list<osg::Node*>* excludeNodeList, bool returnHitTriangle,
79  double maxIsectorLength, bool sort, bool useHighLod );
80 
86  virtual bool intersectLineSegmentWithScene( double x, double y, double z,
87  double end_x, double end_y, double end_z,
88  DtOsgIntersectorResult& intersection,
89  const DtOsgRenderer::RootList& intersectionRoots,
90  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
91  std::list<osg::Node*>* excludeNodeList=0,
92  bool returnHitTriangle=false, bool useHighLod=false );
93 
99  virtual bool intersectLineSegmentWithScene( double x, double y, double z,
100  double end_x, double end_y, double end_z,
101  DtOsgIntersector::DtOsgIntersections& intersections,
102  const DtOsgRenderer::RootList& intersectionRoots,
103  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
104  std::list<osg::Node*>* excludeNodeList=0,
105  bool returnHitTriangle=false, bool sort=true, bool useHighLod=false );
106 
109  virtual bool pick( osgViewer::View& view, double mx, double my,
110  DtOsgIntersectorResult& intersection,
111  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
112  std::list<osg::Node*>* excludeNodeList=0,
113  bool returnHitTriangle=false );
114 
117  virtual bool pick( osgViewer::View& view, double mx, double my,
119  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
120  std::list<osg::Node*>* excludeNodeList=0,
121  bool returnHitTriangle=false );
122 
123  protected:
124  virtual bool doOceanPick( const DtCameraNode& sceneCamera, double mx,
125  double my, DtVector& oceanIntersectLocation, DtVector& oceanIntersectNormal,
126  DtVector* nearPlanePosition=0 );
127 
128  virtual bool pickTritonWaves( const DtCameraNode& sceneCamera, double mx,
129  double my, DtVector& result, DtVector& normal,
130  DtVector* nearPlanePosition=0 );
131 
132  virtual bool pickTritonSeaLevel( const DtCameraNode& sceneCamera,
133  double mx, double my, DtVector& result, DtVector& normal,
134  DtVector* nearPlanePosition=0 );
135 
136  virtual bool doOceanIntersect( const DtVector& start, const DtVector& end,
137  DtVector& oceanIntersectLocation, DtVector& oceanIntersectNormal );
138 
139  virtual bool intersectTritonWaves( const DtVector& start, const DtVector& dir,
140  DtVector& result, DtVector& normal );
141 
142  virtual bool intersectTritonSeaLevel( const DtVector& start, const DtVector& dir,
143  DtVector& seaPlane, DtVector& normal );
144 
145  virtual bool intersectionBelowSeaLevel(const DtIntersectorResult& intersection );
146 
147  // Returns true if there is a valid intersection in 'intersection'
148  virtual bool addOceanIntersectIfCloser( const DtVector& start, const DtVector& end,
149  bool intersectionHasResult, DtOsgIntersectorResult& intersection );
150 
151  virtual void fillOceanIntersection( const DtVector& oceanIntersectLocation,
152  const DtVector& oceanIntersectNormal, DtIntersectorResult& intersection );
153 
154  virtual bool calcEndpointsFromDirectionAndLength( double x, double y,
155  double z, double vx, double vy, double vz, double length,
156  const DtOsgRenderer::RootList& intersectionRoots, DtVector& startPoint,
157  DtVector& endPoint ) const;
158 
159  };
160 
164  {
165  public:
167  virtual DtIntersector* create(DtDe& de, int modelSet );
168  };
169 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)