/** Returns the closest value to 'a' that is in between 'low' and 'high' */ public final static float clamp(final float a, final float low, final float high) { return max(low, min(a, high)); }
public void record(float value) { longAvg = longAvg * (1 - LONG_FRACTION) + value * LONG_FRACTION; shortAvg = shortAvg * (1 - SHORT_FRACTION) + value * SHORT_FRACTION; min = JBoxUtils.min(value, min); max = JBoxUtils.max(value, max); }
m_proxyBuffer, m_proxyCount, computeTag(m_inverseDiameter * JBoxUtils.min(point1.x, point2.x) - 1, m_inverseDiameter * JBoxUtils.min(point1.y, point2.y) - 1)); int lastProxy = upperBound( point.y = point1.y + t * vy; float f = callback.reportParticle(i, point, n, t); fraction = JBoxUtils.min(fraction, f); if (fraction <= 0) { break;
triad.indexC = c; triad.flags = af | bf | cf; triad.strength = JBoxUtils.min(groupA.m_strength, groupB.m_strength); final float midPointx = (float) 1 / 3 * (pa.x + pb.x + pc.x); final float midPointy = (float) 1 / 3 * (pa.y + pb.y + pc.y);
minSeparation = JBoxUtils.min(minSeparation, separation);
float h = pressurePerWeight * JBoxUtils.max(0.0f, JBoxUtils.min(w, JBoxSettings.maxParticleWeight) - JBoxSettings.minParticleWeight); m_accumulationBuffer[i] = h;
minSeparation = JBoxUtils.min(minSeparation, separation);
tempy = vB.y - m_v2.y; float s2 = n.x * tempx + n.y * tempy; float s = JBoxUtils.min(s1, s2);
m_impulse = JBoxUtils.min(0.0f, m_impulse + impulse); impulse = m_impulse - oldImpulse;
pair.indexB = b; pair.flags = contact.flags; pair.strength = JBoxUtils.min(groupA.m_strength, groupB.m_strength); pair.distance = JBoxUtils.distance(m_positionBuffer.data[a], m_positionBuffer.data[b]); m_pairCount++;
j = newIndices[i]; if (j >= 0) { firstIndex = JBoxUtils.min(firstIndex, j); lastIndex = JBoxUtils.max(lastIndex, j + 1); } else {
int n = JBoxUtils.min(num, JBoxSettings.maxPolygonVertices);
g.center.x = inverseRadius * (g.center.x - lower.x); g.center.y = inverseRadius * (g.center.y - lower.y); int x = JBoxUtils.max(0, JBoxUtils.min((int) g.center.x, m_countX - 1)); int y = JBoxUtils.max(0, JBoxUtils.min((int) g.center.y, m_countY - 1)); queue.push(taskPool.pop().set(x, y, x + y * m_countX, g));
} else { b.setSleepTime(b.getSleepTime() + h); minSleepTime = JBoxUtils.min(minSleepTime, b.getSleepTime());
m_impulse.z = JBoxUtils.max(m_impulse.z, 0.0f); } else if (m_limitState == LimitState.AT_UPPER) { m_impulse.z = JBoxUtils.min(m_impulse.z, 0.0f);
alpha = JBoxUtils.min(alpha0 + (1.0f - alpha0) * beta, 1.0f); } else { alpha = 1.0f;