1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Java 3D 1.4: Picking Changes</title>
</head>
<body>
<h2>Java 3D<sup><font size="-2">TM</font></sup> 1.4:
Picking Changes</h2>
<p>This page describes the proposed picking changes in Java 3D 1.4. The
main motivation is to improve picking performance. It eliminates the
need to rely on the picking utility for extra pick information, such as
the
color, normal and texture coordinates of the intersection points. This
information will be returned, by the new core picking APIs, in a newly
created PickInfo class.<br>
<br>
The proposed API are :<br>
</p>
<ul>
<li>New methods in existing classes: <br>
</li>
</ul>
<h4 style="font-weight: bold; margin-left: 40px;"><span
style="font-weight: normal;">The following 4 methods will be added to <a
href="http://download.java.net/media/java3d/javadoc/1.4.0-latest/javax/media/j3d/Locale.html#pickAll%28int,%20int,%20javax.media.j3d.PickShape%29"><span
style="font-weight: bold;">Locale</span></a> and <a
href="http://download.java.net/media/java3d/javadoc/1.4.0-latest/javax/media/j3d/BranchGroup.html#pickAll%28int,%20int,%20javax.media.j3d.PickShape%29"><span
style="font-weight: bold;">BranchGroup</span></a> :</span><span
style="font-weight: normal;">
</span><br>
</h4>
<div style="font-weight: bold; margin-left: 80px;"><span
style="font-weight: normal;">method: public
PickInfo[] pickAll(
int mode, int flags, PickShape pickShape )</span><br>
<span style="font-weight: normal;">method: public PickInfo[]
pickAllSorted( int mode, int flags, PickShape pickShape )</span><br>
<span style="font-weight: normal;">method: public PickInfo pickClosest(
int mode, int flags, PickShape pickShape )</span><br>
<span style="font-weight: normal;">method: public PickInfo pickAny( int
mode, int flags, PickShape pickShape )</span><br>
</div>
<p style="margin-left: 40px;">
Where <br>
</p>
<div style="margin-left: 80px;">mode
is an enum of [ Bounds, Geometry ] <br>
flags
is a mask indicating which components are present in each returned
PickInfo object. This is specified as one or more individual flags that
are bitwise "OR"ed together to describe the returned per PickInfo data.
<br>
The flags include: <br>
<code>SCENEGRAPHPATH
- request for computed SceneGraphPath. </code> <br>
<code>NODE
- request
for computed intersected Node.</code><br>
<code>LOCAL_TO_VWORLD
- request for computed local to virtual world transform.</code><br>
<code>CLOSEST_INTERSECTION_POINT -
request for
closest intersection point.</code><br>
<code>CLOSEST_DISTANCE
-
request for the closest distance of the intersection.</code><br>
<code>CLOSEST_GEOM_INFO
- request for only the closest intersection geometry
information.</code><code><br>
ALL_GEOM_INFO
- request for all intersection geometry information. </code>
<br>
</div>
<div style="margin-left: 40px;">
NOTES : <br>
</div>
<div style="margin-left: 80px;">If <code>CLOSEST_INTERSECTION_POINT</code>
is not set, PickInfo.closestIntersectionPoint is set to null.<br>
If <code>CLOSEST_GEOM_INFO</code> is
set, PickInfo.intersectionInfos is of length 1, and
PickInfo.intersectionInfos[0]
contains the
information of the closest pick.<br>
If <code>ALL_GEOM_INFO</code> is set, PickInfo.intersectionInfos
contains all intersections of the
pickable node
in sorted order.<br>
If both <code>CLOSEST_GEOM_INFO</code>
and
<code>ALL_GEOM_INFO</code> are not set, PickInfo.intersectionInfos is
set to null.<br>
An<span style="font-style: italic;"> </span>IllegalArgumentException<span
style="font-style: italic;"></span>
is thrown if <span style="font-style: italic;"> </span>both<span
style="font-style: italic;"> </span><code>CLOSEST_GEOM_INFO</code>
and
<code>ALL_GEOM_INFO</code> are set.<br>
</div>
<ul>
<li>New classes</li>
</ul>
<div style="margin-left: 40px;">public class <a
href="http://download.java.net/media/java3d/javadoc/1.4.0-latest/javax/media/j3d/PickInfo.html"><span
style="font-weight: bold;">PickInfo</span></a> extends
Object
</div>
<p style="margin-left: 80px;"><span style="font-style: italic;">/**
Retrieves
the reference to the SceneGraphPath in this PickInfo object. */</span><br>
method: public
SceneGraphPath getSceneGraphPath()<br>
</p>
<p style="margin-left: 80px;"><span style="font-style: italic;">/**
Retrieves
the reference to the picked node, either a Shape3D or a Morph, in
this PickInfo object. */</span><br>
method: public Node
getNode()<br>
<br>
<span style="font-style: italic;">/** Retrieves
the reference to the LocalToVworld transform of the picked node in
this PickInfo object. */</span><br>
method: public
Transform3D getLocalToVWorld()<br>
</p>
<p style="margin-left: 80px;"><span style="font-style: italic;">/**
Retrieves
the reference to the closest intersection point in this PickInfo
object. */</span><br>
method: public
Point3d getClosestIntersectionPoint()<br>
</p>
<p style="margin-left: 80px;"><span style="font-style: italic;">/**
Retrieves
the distance between the start point of the pickShape and the
closest intersection point. */</span><br>
method: public
double getClosestDistance()<br>
</p>
<p style="margin-left: 80px;"><span style="font-style: italic;">/**
Retrieves
the reference to the array of intersection results in this PickInfo
object. */</span><br>
method: public
IntersectionInfo[] getIntersectionInfos()<br>
</p>
<p style="margin-left: 40px;">public class
<a
href="http://download.java.net/media/java3d/javadoc/1.4.0-latest/javax/media/j3d/PickInfo.IntersectionInfo.html"><span
style="font-weight: bold;">PickInfo.IntersectionInfo</span></a>
extends Object ( inner
class )<br>
</p>
<div style="margin-left: 80px;"><span style="font-style: italic;">/**
Retrieves
the index to the intersected geometry in the picked node, either a
Shape3D or Morph. */</span><br>
method: public
int getGeometryIndex() <br>
<br>
<span style="font-style: italic;">/** Retrieves
the reference to the intersected geometry in the picked object,
either a Shape3D or Morph. */</span><br>
method: public
Geometry getGeometry() <span style="font-style: italic;"></span><br>
<br>
<span style="font-style: italic;">/** Retrieves
the reference to the intersection point of the picked geometry in this
IntersectionInfo object. */</span><br>
method: public
Point3d getIntersectionPoint()<br>
<br>
<span style="font-style: italic;">/**
Retrieves
the distance between the start point of the pickShape and the
intersection point. */</span><br>
method: public
double getDistance()<br>
<br>
<span style="font-style: italic;">/** Retrieves
the vertex indices of the intersected primitive in the geometry. */</span><br>
method: public int[] getVertexIndices()<br>
<br>
<span style="font-style: italic;">/** Retrieves
the interpolation weights for each of the verticies of the
intersected primitive. */</span><br>
method: public
float[] getWeights()<br>
<br>
</div>
<p><font color="gray">Page last updated —
$Date$
</font></p>
</body>
</html>
|