98 {
99 float closestDist = float.MAX;
102
103 int excludeMask = 0;
105 {
106 if (indx > 32)
107 break;
108
112
113 if (crumbRadius != -1)
114 maxRadiusAllowed = crumbRadius;
115 if (dist > maxRadiusAllowed)
116 excludeMask = (excludeMask | (1 << indx));
118 {
119 int idx =
m_Player.GetBoneIndexByName(
"Head");
121 vector rayEnd = crumb.GetPosition();
123 float hitFraction;
125
127 {
128 excludeMask = (excludeMask | (1 << indx));
129 }
130 }
131
132 distances.Insert(dist);
133
134 #ifdef DIAG_DEVELOPER
137 #endif
138 }
139
140 float baseDst = distances[0];
141 float sum = 0;
142
143 foreach (float dst:distances)
144 {
145 if (dst == 0)
146 dst = 0.1;
147 float dstInv = (baseDst / dst) * baseDst;
148 sum += dstInv;
149 distancesInverted.Insert(dstInv);
150 }
151
152 float sumCheck = 0;
153 float eyeAcco = 0;
154 foreach (int i, float dstInvert:distancesInverted)
155 {
156 if ((1 << i) & excludeMask)
157 continue;
158
159 float ratio = dstInvert / sum;
162
164 {
165 #ifdef DIAG_DEVELOPER
167 {
168 float intensity = (1-ratio) * 255;
170 }
171 #endif
172
174 }
175 }
176
178 }
const float DISTANCE_CUTOFF
UndergroundTrigger m_TransitionalTrigger
const float ACCO_MODIFIER
static proto bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
int ARGB(int a, int r, int g, int b)