VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
geometricUtilities.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <matrix/vlVector.h>
10 
11 class DtExtent;
12 class DtPoint;
13 class DtDcm;
14 class Dt3dBoundingVolume;
15 class DtSphere;
16 class DtChord;
17 
18 // Expand the specified extent to include the extent created by the radius and
19 // specified local position.
20 // @param extent The extent to expand.
21 // @param localPosition The position of the new extent.
22 // @param halfLength The half-length of the heigh/width/length of the cube extent,
23 // of the new extent. The new extent is a @b cube,
24 // and so the length = width = height.
25 //
26 // @note This is commonly used to create an extent from a bounding sphere, which
27 // is why the radius is really the half-width/length/height and why those are
28 // all equal to each other (cube).
30  const DtPoint& localPosition,
31  double halfLength);
32 
33 // Expand the specified extent to include the extent created by the radius and
34 // specified local position.
35 //
36 // @param extent The extent to expand
37 // @param localBoundingVolume The local bounding volume to place and orient, and
38 // then expand the specified extent by.
39 // @param worldOrientation The world orientation transformation for the bounding volume.
40 // @param worldLocation The location, in the world, of the bounding volume.
41 //
43  const Dt3dBoundingVolume& localBoundingVolume,
44  const DtDcm& worldOrientation,
45  const DtPoint& worldLocation);
46 
47 // \return The point on the triangle defined by triangleA, triangleB, triangleC
48 // which is closest to testPoint.
50  const DtPoint& triangleA,
51  const DtPoint& triangleB,
52  const DtPoint& triangleC);
53 
54 // Tests the intersection of a ray with a sphere.
55 // \return True only if they intersect.
56 // If they do intersect, t will have the distance along the ray (in meters)
57 // where the intersection occurs, and intersectPoint will be the point of
58 // intersection. If a chord is specified, the chord will contain the segment
59 // through the sphere where the ray intersects.
60 DT_DLL_geometry bool DtIntersectRaySphere(const DtPoint& rayStartPoint,
61  const DtVector& rayDirection,
62  const DtSphere& sphere,
63  double& t, DtPoint& intersectPoint);
64 
65 DT_DLL_geometry bool DtIntersectRaySphere(const DtPoint& rayStartPoint,
66  const DtVector& rayDirection,
67  const DtSphere& sphere,
68  double& t, DtPoint& intersectPoint,
69  DtChord& segmentThroughSphere);
70 
71 
72 // Returns the bounding radius for a given boundingVolume, in the
73 // bounding volume's X-Y plane only (takes into account length and
74 // width only -- ignores height).
75 DT_DLL_geometry double DtBoundingRadiusInXY(const Dt3dBoundingVolume& boundingVolume);
76 
77 // Same as DtBoundingRadiusInXY(), but it returns the square of the value.
78 // Faster than DtBoundingRadiusInXY().
79 DT_DLL_geometry double DtBoundingRadiusInXYSquared(const Dt3dBoundingVolume& boundingVolume);
80 
81 
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
const DtExtent & extent() const
Definition: chord.h:153
Definition: sphere.h:22
DT_DLL_geometry void DtExpandExtentToIncludeBoundingVolume(DtExtent &extent, const Dt3dBoundingVolume &localBoundingVolume, const DtDcm &worldOrientation, const DtPoint &worldLocation)
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
#define DT_DLL_geometry
Definition: geometryDefines.h:23
DT_DLL_geometry bool DtIntersectRaySphere(const DtPoint &rayStartPoint, const DtVector &rayDirection, const DtSphere &sphere, double &t, DtPoint &intersectPoint)
DT_DLL_geometry double DtBoundingRadiusInXYSquared(const Dt3dBoundingVolume &boundingVolume)
DT_DLL_geometry DtPoint DtClosestPointOnTriangleTo(const DtPoint &testPoint, const DtPoint &triangleA, const DtPoint &triangleB, const DtPoint &triangleC)
DT_DLL_geometry void DtExpandExtentToIncludeBoundingShere(DtExtent &extent, const DtPoint &localPosition, double halfLength)
DT_DLL_geometry double DtBoundingRadiusInXY(const Dt3dBoundingVolume &boundingVolume)
Definition: point.h:34

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)