Main Page
Namespaces
Classes
Files
File List
File Members
include
Graphics
GtePickRecord.h
Go to the documentation of this file.
1
// David Eberly, Geometric Tools, Redmond WA 98052
2
// Copyright (c) 1998-2017
3
// Distributed under the Boost Software License, Version 1.0.
4
// http://www.boost.org/LICENSE_1_0.txt
5
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6
// File Version: 3.0.1 (2016/06/26)
7
8
#pragma once
9
10
#include <
Mathematics/GteVector4.h
>
11
#include <
Graphics/GteIndexFormat.h
>
12
#include <memory>
13
14
namespace
gte
15
{
16
17
class
Visual;
18
19
class
GTE_IMPEXP
PickRecord
20
{
21
public
:
22
// Construction and destruction. The default constructor does not
23
// initialize any members. It exists to support the construction
24
// of the const static PickRecord in the Picker class.
25
~
PickRecord
();
26
PickRecord
();
27
28
// The object for which some primitive satisfies the picking criteria.
29
// The vertexIndex[] are relative to the vertex buffer array of the
30
// 'visual'. If the primitive is a triangle, then all three indices are
31
// valid. If the primitive is a segment, then the first two indices are
32
// valid. If the primitive is a point, then the first index is valid.
33
// The invalid indices are set to -1.
34
std::shared_ptr<Visual>
visual
;
35
IPType
primitiveType
;
36
int
primitiveIndex
;
37
int
vertexIndex[3];
38
39
// The linear component is parameterized by P + t*D. The t-value
40
// corresponds to the point of intersection when the primitive is a
41
// triangle. For point and segment primitives, the t-value corresponds
42
// to the closest point to the primitive. NOTE: Picking occurs in the
43
// model space of the objects. If the model-to-world transform is not
44
// rigid (i.e. the world transform has non-unit scaling), the t-values
45
// cannot be compared between objects. Therefore, the sorting of
46
// PickRecords must use the linePoint, which is computed in world
47
// coordinates.
48
float
t
;
49
Vector4<float>
linePoint
;
50
51
// The barycentric coordinates of the point of intersection when the
52
// primitive is a triangle or of the closest primitive point when the
53
// primitive is a segment or a point. The coordinates have the
54
// properties 0 <= bary[i] <= 1 and bary[0] + bary[1] + bary[2] = 1.
55
// For a triangle, all three bary[] values are potentially positive.
56
// For a segment, bary[2] = 0. For a point, bary[0] = 1 and bary[1]
57
// = bary[2] = 0. The order of the bary[] values is consistent with
58
// the ordering of the vertices of the primitive. The primitivePoint
59
// is the same as the linePoint when the primitive is a triangle.
60
// However, it is the closest primitive point to the line when the
61
// primitive is a segment or a point.
62
float
bary[3];
63
Vector4<float>
primitivePoint
;
64
65
// The distances are all measured in world coordinates. The distanceTo*
66
// values are measured from the world origin of the pick line.
67
// when the primitives are triangles. The distanceBetweenLinePrimitive
68
// is the distance between the primitive and the pick object (line, ray,
69
// or segment).
70
float
distanceToLinePoint
;
71
float
distanceToPrimitivePoint
;
72
float
distanceBetweenLinePrimitive
;
73
};
74
75
}
gte::PickRecord::primitiveType
IPType primitiveType
Definition:
GtePickRecord.h:35
gte::PickRecord::primitiveIndex
int primitiveIndex
Definition:
GtePickRecord.h:36
GteVector4.h
gte::PickRecord::distanceToPrimitivePoint
float distanceToPrimitivePoint
Definition:
GtePickRecord.h:71
GteIndexFormat.h
gte
Definition:
GLX/GteWICFileIO.h:16
gte::PickRecord::primitivePoint
Vector4< float > primitivePoint
Definition:
GtePickRecord.h:63
gte::Vector< 4, Real >
gte::PickRecord::t
float t
Definition:
GtePickRecord.h:48
gte::PickRecord::visual
std::shared_ptr< Visual > visual
Definition:
GtePickRecord.h:34
gte::PickRecord
Definition:
GtePickRecord.h:19
gte::PickRecord::distanceBetweenLinePrimitive
float distanceBetweenLinePrimitive
Definition:
GtePickRecord.h:72
gte::PickRecord::linePoint
Vector4< float > linePoint
Definition:
GtePickRecord.h:49
GTE_IMPEXP
#define GTE_IMPEXP
Definition:
GTEngineDEF.h:63
gte::PickRecord::distanceToLinePoint
float distanceToLinePoint
Definition:
GtePickRecord.h:70
geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:01