Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
4DVector.h
1
// 4DVector.h: interface for the C4DVector class.
2
//
3
//////////////////////////////////////////////////////////////////////
4
5
#if !defined(AFX_4DVECTOR_H__E08BA9B4_51FD_11D2_A14A_000000000000__INCLUDED_)
6
#define AFX_4DVECTOR_H__E08BA9B4_51FD_11D2_A14A_000000000000__INCLUDED_
7
8
#ifdef _MSC_VER
9
#pragma once
10
#endif
// _MSC_VER
11
12
BEGIN_MOOTOOLS_NAMESPACE
13
14
template
<
class
TYPE>
class
C4DTVector
15
{
16
public
:
17
// C4DTVector is mainly used for real time computation. We use double for better quadric measure computation (particularly on Polygon Cruncher)
18
C3DTVector<TYPE>
dir;
19
TYPE
t;
// normal to the plane and offset
20
21
C4DTVector
();
22
C4DTVector
(
const
C4DTVector
& vector);
23
C4DTVector
(
const
C3DTPoint<TYPE>
&
pt1
,
const
C3DTPoint<TYPE>
&
pt2
,
const
C3DTPoint<TYPE>
&
pt3
,
bool
normalize
=
true
);
24
25
void
Serialize(
CXArchive
&
ar
);
// not virtual,as the class is mainly used directly.
26
27
bool
InitPlane(
const
C3DTPoint<TYPE>
&
pt1
,
const
C3DTPoint<TYPE>
&
pt2
,
const
C3DTPoint<TYPE>
&
pt3
,
bool
normalize
=
true
);
28
double
GetSignedDistance(
const
C3DTPoint<TYPE>
&
pt
)
const
;
29
double
GetDistance(
const
C3DTPoint<TYPE>
&
pt
)
const
;
// Return the signed distance of pt to the plane
30
C3DTPoint<TYPE>
GetProjection(
const
C3DTPoint<TYPE>
&
pt
)
const
;
// Return the projection of pt on the plane
31
32
//////////////////////
33
// Mix type conversion (C4DTVector<float> to C4DTVector<double> for example)
34
template
<
class
TYPE2>
C4DTVector
(
const
C4DTVector<TYPE2>
&
plane
);
35
template
<
class
TYPE2>
C4DTVector
& operator=(
const
C4DTVector<TYPE2>
&
plane
);
36
};
37
38
END_MOOTOOLS_NAMESPACE
39
40
#include "4DVector.inl"
41
42
43
#endif
// !defined(AFX_4DVECTOR_H__E08BA9B4_51FD_11D2_A14A_000000000000__INCLUDED_)
C3DTPoint
The class defines an x, y, z 3D point which can use int, float or double.
Definition
3DPoint.h:27
C4DTVector
Definition
4DVector.h:15
CXArchive
Definition
XArchive.h:17
VS2022-PolygonCruncherSDK-Full-IO
SDK
Includes
4DVector.h
Generated by
1.9.8