if (m_mode == Mode.e_closest) {
ccallback.init();
getWorld().raycast(ccallback, point1, point2);
if (ccallback.m_hit) {
getDebugDraw().drawPoint(ccallback.m_point, 5.0f, new Color3f(0.4f, 0.9f, 0.4f));
getDebugDraw().drawSegment(point1, ccallback.m_point, new Color3f(0.8f, 0.8f, 0.8f));
pooledHead.set(ccallback.m_normal);
pooledHead.mulLocal(.5f).addLocal(ccallback.m_point);
getDebugDraw().drawSegment(ccallback.m_point, pooledHead, new Color3f(0.9f, 0.9f, 0.4f));
} else {
getDebugDraw().drawSegment(point1, point2, new Color3f(0.8f, 0.8f, 0.8f));
}
} else if (m_mode == Mode.e_any) {
acallback.init();
getWorld().raycast(acallback, point1, point2);
if (acallback.m_hit) {
getDebugDraw().drawPoint(acallback.m_point, 5.0f, new Color3f(0.4f, 0.9f, 0.4f));
getDebugDraw().drawSegment(point1, acallback.m_point, new Color3f(0.8f, 0.8f, 0.8f));
pooledHead.set(acallback.m_normal);
pooledHead.mulLocal(.5f).addLocal(acallback.m_point);
getDebugDraw().drawSegment(acallback.m_point, pooledHead, new Color3f(0.9f, 0.9f, 0.4f));
} else {
getDebugDraw().drawSegment(point1, point2, new Color3f(0.8f, 0.8f, 0.8f));
}
} else if (m_mode == Mode.e_multiple) {
mcallback.init();
getWorld().raycast(mcallback, point1, point2);
getDebugDraw().drawSegment(point1, point2, new Color3f(0.8f, 0.8f, 0.8f));
for (int i = 0; i < mcallback.m_count; ++i) {
Vec2 p = mcallback.m_points[i];
Vec2 n = mcallback.m_normals[i];
getDebugDraw().drawPoint(p, 5.0f, new Color3f(0.4f, 0.9f, 0.4f));
getDebugDraw().drawSegment(point1, p, new Color3f(0.8f, 0.8f, 0.8f));
pooledHead.set(n);
pooledHead.mulLocal(.5f).addLocal(p);
getDebugDraw().drawSegment(p, pooledHead, new Color3f(0.9f, 0.9f, 0.4f));
}
}
if (advanceRay) {
m_angle += 0.25f * MathUtils.PI / 180.0f;