VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
geometry
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
8
#include "
geometry/geometryDefines.h
"
9
10
class
DtExtent
;
11
class
DtPoint
;
12
class
DtDcm;
13
class
Dt3dBoundingVolume;
14
class
DtSphere
;
15
class
DtVector
;
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).
29
DT_DLL_geometry
void
DtExpandExtentToIncludeBoundingShere
(
DtExtent
&
extent
,
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
//
42
DT_DLL_geometry
void
DtExpandExtentToIncludeBoundingVolume
(
DtExtent
&
extent
,
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.
49
DT_DLL_geometry
DtPoint
DtClosestPointOnTriangleTo
(
const
DtPoint
& 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
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)