99 {
100 float closestDist = float.MAX;
103
104 int excludeMask = 0;
106 {
107 if (indx > 32)
108 break;
109
113
114 if (crumbRadius != -1)
115 maxRadiusAllowed = crumbRadius;
116 if (dist > maxRadiusAllowed)
117 excludeMask = (excludeMask | (1 << indx));
119 {
120 int idx =
m_Player.GetBoneIndexByName(
"Head");
122 vector rayEnd = crumb.GetPosition();
124 float hitFraction;
126
128 {
129 excludeMask = (excludeMask | (1 << indx));
130 }
131 }
132
133 distances.Insert(dist);
134
135 #ifdef DIAG_DEVELOPER
138 #endif
139 }
140
141 float baseDst = distances[0];
142 float sum = 0;
143
144 foreach (float dst:distances)
145 {
146 if (dst == 0)
147 dst = 0.1;
148 float dstInv = (baseDst / dst) * baseDst;
149 sum += dstInv;
150 distancesInverted.Insert(dstInv);
151 }
152
153 float sumCheck = 0;
154 float eyeAcco = 0;
155 foreach (int i, float dstInvert:distancesInverted)
156 {
157 if ((1 << i) & excludeMask)
158 continue;
159
160 float ratio = dstInvert / sum;
163
165 {
166 #ifdef DIAG_DEVELOPER
168 {
169 float intensity = (1-ratio) * 255;
171 }
172 #endif
173
175 }
176 }
177
179 }
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)