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
|
/* */ package NET.worlds.scape;
/* */
/* */ import java.io.IOException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class PlaneBumpCalc
/* */ extends BumpCalc
/* */ {
/* */ public void detectBump(BumpEventTemp b, WObject owner)
/* */ {
/* 57 */ WObject source = (WObject)b.source;
/* 58 */ Point3Temp sourceStart = source.getWorldPosition();
/* */
/* 60 */ Transform xfrm = owner.getObjectToWorldMatrix();
/* 61 */ Point3Temp start = xfrm.getPosition();
/* 62 */ Point3Temp right = owner.getPlaneExtent().times(xfrm);
/* 63 */ Point3Temp d = Point3Temp.make(right).minus(start);
/* 64 */ xfrm.recycle();
/* */
/* */
/* */
/* */
/* 69 */ BoundBoxTemp sourceBox = source.getBoundBox();
/* */ Point2 corner;
/* 71 */ Point2 corner; if (d.x > 0.0F) { Point2 corner;
/* 72 */ if (d.y > 0.0F) {
/* 73 */ corner = new Point2(sourceBox.lo.x, sourceBox.hi.y);
/* */ } else
/* 75 */ corner = new Point2(sourceBox.hi.x, sourceBox.hi.y);
/* */ } else { Point2 corner;
/* 77 */ if (d.y > 0.0F) {
/* 78 */ corner = new Point2(sourceBox.lo.x, sourceBox.lo.y);
/* */ } else {
/* 80 */ corner = new Point2(sourceBox.hi.x, sourceBox.lo.y);
/* */ }
/* */ }
/* 83 */ Point2 dn = new Point2(-d.y, d.x).normalize();
/* 84 */ corner.x -= sourceStart.x;
/* 85 */ corner.y -= sourceStart.y;
/* 86 */ float dist = corner.dot(dn);
/* */
/* 88 */ Point3Temp extent = Point3Temp.make(dn.x * dist, dn.y * dist, 0.0F);
/* */
/* */
/* */
/* */
/* */
/* 94 */ if (b.hitRegion(owner, Point3Temp.make(start).minus(extent), d, extent)) {
/* 95 */ return;
/* */ }
/* */
/* 98 */ Point3Temp ccwNormal = Point3Temp.make(extent.y, -extent.x, 0.0F);
/* 99 */ d = Point3Temp.make(ccwNormal).minus(extent);
/* 100 */ Point3Temp extentL = Point3Temp.make(-d.y, d.x, 0.0F).normalize()
/* 101 */ .times(dist / 1.5F);
/* */
/* */
/* 104 */ Point3Temp startL = Point3Temp.make(start).minus(ccwNormal);
/* */
/* */
/* */
/* 108 */ if (b.hitRegion(owner, startL, d, extentL)) {
/* 109 */ return;
/* */ }
/* */
/* */
/* */
/* */
/* 115 */ if (b.hitRegion(owner, Point3Temp.make(right).minus(extent), Point3Temp.make(-d.y, d.x, 0.0F), Point3Temp.make(-extentL.y, extentL.x, 0.0F))) {}
/* */ }
/* */
/* */
/* */
/* */
/* */
/* 122 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 126 */ s.saveVersion(0, classCookie);
/* 127 */ super.saveState(s);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException
/* */ {
/* 132 */ switch (r.restoreVersion(classCookie)) {
/* */ case 0:
/* 134 */ super.restoreState(r);
/* 135 */ break;
/* */ default:
/* 137 */ throw new TooNewException();
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\PlaneBumpCalc.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|