Developer knowledge network ยท moderated exchange

Komunitas Kode Tidak Dapat Diandalkan

Riset Pengembang, Rekayasa Terbalik & Komunitas Pengkodean

Knowledge indexHidup
4Categories
919Threads
2.8KPostingan
Tutorial

Grenade Trajectory Prediction Physics with Collision Normals & Bounce Elasticity [v2.4 Technical Discussion]

matrix_math_guy
Math Specialist
MEMBER
Reputasi: 105
Tanggal Bergabung: Aug 2018
Postingan: 52
Terima kasih: 41
1 bulan yang lalu ยท Jul 20, 2026 5:01 PM
#1

Simulating CS2 smoke, flashbang, and HE grenade trajectories:

  1. Initial grenade throw velocity:
    $$V_0 = \text{EyeAnglesToVector}(\text{pitch}, \text{yaw}) \times \text{ThrowPower} + \text{PawnVelocity} \times 1.25$$
  2. Each physics simulation step ($dt = 0.015625\text{s}$):
    $$P_{t+1} = P_t + V_t \cdot dt$$
    $$V_{t+1} = V_t + (0, 0, -800.0) \cdot dt$$
  3. On surface collision trace hit:
    $$V_{\text{bounce}} = (V_t - 2(V_t \cdot N)N) \times 0.45$$

Rendering the resulting 3D polyline with ImDrawList::AddPolyline displays the exact landing zone before releasing mouse button!

imgui_artisan
UI Designer
MEMBER
Reputasi: 202
Tanggal Bergabung: Apr 2019
Postingan: 54
Terima kasih: 28
1 bulan yang lalu ยท Jul 20, 2026 8:09 PM
#2

The bounce reflection formula with the 0.45 elasticity coefficient matches the Source 2 grenade physics perfectly!

raycast_ryan
Ballistics Dev
MEMBER
Reputasi: 72
Tanggal Bergabung: Sep 2019
Postingan: 32
Terima kasih: 16
1 bulan yang lalu ยท Jul 21, 2026 6:00 PM
#3

Lineups for Mirage window smoke and Inferno B CT smoke become 100% consistent.