cast_ray / cast_hull
Jump to navigation
Jump to search


cast_ray
and cast_hull
are console commands available in all Source games. Casts a ray or hull and shows what it hit in console.

bind e cast_ray
)Information it gives
DevMsg(1, "Hit %s\nposition %.2f, %.2f, %.2f\nangles %.2f, %.2f, %.2f\n", tr.m_pEnt->GetClassname(),
tr.m_pEnt->GetAbsOrigin().x, tr.m_pEnt->GetAbsOrigin().y, tr.m_pEnt->GetAbsOrigin().z,
tr.m_pEnt->GetAbsAngles().x, tr.m_pEnt->GetAbsAngles().y, tr.m_pEnt->GetAbsAngles().z );
DevMsg(1, "Hit: hitbox %d, hitgroup %d, physics bone %d, solid %d, surface %s, surfaceprop %s, contents %08x\n", tr.hitbox, tr.hitgroup, tr.physicsbone, tr.m_pEnt->GetSolid(), tr.surface.name, physprops->GetPropName( tr.surface.surfaceProps ), tr.contents );
Examples
] cast_ray Hit func_breakable position -456.00, -346.00, -132.00 angles 0.00, 0.00, 0.00 Hit: hitbox 0, hitgroup 0, physics bone 0, solid 1, surface maps/c1a0/halflife/glass_med_-521_-303_-144, surfaceprop glass, contents 00000001
] cast_hull Hit monster_gman position -360.00, -316.00, -215.00 angles 0.00, 93.00, 0.00 Hit: hitbox 0, hitgroup 0, physics bone 0, solid 2, surface **studio**, surfaceprop default