Developer knowledge network · moderated exchange

UnreliableCode қауымдастығы

Әзірлеушілерді зерттеу, кері инженерия және кодтау қауымдастығы

Knowledge indexТірі
4Categories
919Threads
2.8KЖазбалар
Tutorial

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

matrix_math_guy
Math Specialist
MEMBER
Өкіл: 105
Қосылу күні: Aug 2018
Хабарламалар: 52
Рахмет: 41
1 ай бұрын · 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
Өкіл: 202
Қосылу күні: Apr 2019
Хабарламалар: 54
Рахмет: 28
1 ай бұрын · 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
Өкіл: 72
Қосылу күні: Sep 2019
Хабарламалар: 32
Рахмет: 16
1 ай бұрын · Jul 21, 2026 6:00 PM
#3

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