VR-Forces 4.0.4 Class Documentation
include/gdb/ssTerrainIntersector.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2004 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: ssTerrainIntersector.h,v $ $Revision: 1.1 $ $State: Exp $
00007 *********************************************************************/
00008 #ifndef ssTerrainIntersector_H_
00009 #define ssTerrainIntersector_H_
00010 
00011 #include "gdb/gdbDefines.h"
00012 #include "gdb/gdbNode.h"
00013 #include "geometry/spatialSubdivision.h"
00014 
00015 class DtChord;
00016 class DtChordIntersectionRecord;
00017 class DtPoint;
00018 
00019 // class DtSSTerrainIntersector:
00020 //
00021 // The DtSSTerrainIntersector class is intersects the spatial subdivision that 
00022 // contains DtGdbNode pointers (the terrain), with the specified primitive - 
00023 // chord or otherwise, and provides the appropriate intersection values as a 
00024 // result, if an intersection occurred.
00025 // 
00026 class DT_DLL_gdb DtSSTerrainIntersector
00027 {
00028 public:
00029    DtSSTerrainIntersector() {};
00030 
00031    virtual ~DtSSTerrainIntersector() {};
00032 
00033    // Intersects the chord with the spatial subdivision and returns the point 
00034    // and time along the chord of the first intersection.
00035    //
00036    // @param chord The chord to intersect
00037    // @param spatialSubdivision The spatialSubdivision to intersect.
00038    // @param intersectionPoint The location of the intersection if any.
00039    // @param intersectionTime The time along the chord of the intersection, if any
00040    // 
00041    // @returns a boolean indicating success or failure to find any intersections.
00042    //
00043    // @note If no intersection occurs, the intersectionPoint and Time values are 
00044    // not defined.
00045    //
00046    bool intersect(const DtChord& chord, 
00047                   DtSpatialSubdivision<DtGdbNode*>& spatialSubdivision, 
00048                   DtPoint& intersectionPoint, 
00049                   double& intersectionTime) const;
00050 
00051    // Intersects the chord with the spatial subdivision and returns the point 
00052    // and time along the chord of the first intersection.
00053    //
00054    // @param chord The chord to intersect
00055    // @param spatialSubdivision The spatialSubdivision to intersect.
00056    // @param record The intersection record contained all intersection data 
00057    //               specified by the intersection flag.
00058    // @param irtFlag Flag specifying what intersection data to record in the record.
00059    // 
00060    // @returns a boolean indicating success or failure to find any intersections.
00061    //
00062    // @note If no intersection occurs, the intersectionPoint and Time values are 
00063    // not defined.
00064    //
00065    bool intersect(const DtChord& chord, 
00066                   DtSpatialSubdivision<DtGdbNode*>& spatialSubdivision, 
00067                   DtChordIntersectionRecord& record, 
00068                   DtGdbNode::DtIntersectRecordType irtFlag) const;
00069 
00070    bool allIntersectsAlongChord(const DtChord& chord,
00071                                 DtSpatialSubdivision<DtGdbNode*>& spatialSubdivision,
00072                                 DtChordIntersectRecordList& intList,
00073                                 DtGdbNode::DtIntersectRecordType irtFlag) const;
00074 
00075    int intersectBundle(const DtChordBundle& chordBundle,
00076                        DtSpatialSubdivision<DtGdbNode*>& spatialSubdivision, 
00077                        DtList& recordList, 
00078                        DtGdbNode::DtIntersectRecordType irtFlag) const;
00079 
00080    int allIntersectsAlongChordBundle(const DtChordBundle& chordBundle,
00081                                      DtSpatialSubdivision<DtGdbNode*>& spatialSubdivision,
00082                                      DtList& intListList, 
00083                                      DtGdbNode::DtIntersectRecordType irtFlag) const;
00084 
00085    // \return True if the specified sphere intersects the terrain.
00086    bool intersect(const DtSphere& sphere,
00087       DtSpatialSubdivision<DtGdbNode*>& spatialSubdivision, 
00088       DtSphereIntersectionRecord& record, 
00089       DtGdbNode::DtIntersectRecordType irtFlag) const;
00090 
00091    // \return True if the specified swept sphere volume intersects the terrain.
00092 //   bool intersect(const DtSweptSphere& sweptSphere, 
00093 //      DtSpatialSubdivision<DtGdbNode*>& spatialSubdivision, 
00094 //      DtIntersectionRecord& record, 
00095 //      DtGdbNode::DtIntersectRecordType irtFlag) const;
00096 
00097 protected:
00098    // not implemented
00099    DtSSTerrainIntersector(const DtSSTerrainIntersector& original);
00100    DtSSTerrainIntersector& operator=(const DtSSTerrainIntersector& original);
00101 
00102    // Check to see if the intersection point is in the same cell as the specified
00103    // spatial subdivision cell.
00104    bool intersectionInSameCell(const DtPoint& intersectionPoint, 
00105                                const DtSpatialSubdivision<DtGdbNode*>::DtSpatialSubCellType* spatialSubCell,
00106                                const DtSpatialSubdivision<DtGdbNode*>& spatialSubdivision) const;
00107 
00108 private:
00109 };
00110 
00111 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)