VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDynamicTerrainSphere.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvUtil/vrvUtil.h>
13 
15 #include <matrix/vlVector.h>
16 #include <vector>
17 
18 namespace makVrv
19 {
22  {
23  public:
25  class Intersector : public Visitor
26  {
27  public:
28 
30  explicit Intersector(const DtDynamicTerrainSphere& sphere);
31 
33  bool value() const;
34 
36  void visitSphere(const DtVector& center, double radius);
37 
39  void visitLine(const std::vector<DtVector>& vertices);
40 
42  void visitUnion(const DtDynamicTerrainGeometry& left, const DtDynamicTerrainGeometry& right);
43 
45  void visitIntersection(const DtDynamicTerrainGeometry& left, const DtDynamicTerrainGeometry& right);
46 
47  protected:
50  };
51 
52  public:
53 
55  DtDynamicTerrainSphere(const DtVector& center, double radius);
56 
58  virtual ~DtDynamicTerrainSphere();
59 
60  // No default CTOR
61  DtDynamicTerrainSphere() = delete;
62 
63  DtDynamicTerrainSphere(const DtDynamicTerrainSphere& copy) = default;
64  DtDynamicTerrainSphere& operator=(const DtDynamicTerrainSphere& copy) = default;
65 
66  public:
67 
69  virtual DtDynamicTerrainGeometry* clone() const;
70 
72  virtual bool intersects(const DtDynamicTerrainGeometry& geometry) const;
73 
75  virtual double distanceTo(const DtVector& point) const;
76 
78  virtual bool isFinite() const;
79 
81  virtual void accept(Visitor& visitor) const;
82 
84  virtual const DtVector& center() const;
85 
87  virtual double radius() const;
88 
89  protected:
91  const double myRadius;
92  };
93 }
const DtDynamicTerrainSphere & mySphere
Definition: DtDynamicTerrainSphere.h:48
#define DT_DLL_VRVUTIL
Definition: vrvUtil.h:34
Represents (possibly infinite) area of space.
Definition: DtDynamicTerrainGeometry.h:20
const double myRadius
Definition: DtDynamicTerrainSphere.h:91
Contains DLL export macros.
Contains makVrv::DtDynamicTerrainGeometry class.
bool myCurrentValue
Definition: DtDynamicTerrainSphere.h:49
Visitor for search through geometries.
Definition: DtDynamicTerrainGeometry.h:24
DtDynamicTerrainSphere is used to represent a sphere of impact for a dynamic terrain event...
Definition: DtDynamicTerrainSphere.h:21
DT_DLL_vrfutil bool intersects(const DtVector &localPoint1, const DtVector &localPoint2, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Returns true if the line segment localPoint1-localPoint2 intersects any line segment in localVert...
This class is used by the DtDynamicTerrainWorld to determine intersections with this geometry type...
Definition: DtDynamicTerrainSphere.h:25
const DtVector myCenter
Definition: DtDynamicTerrainSphere.h:90

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)