MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / AffectThrow

Method AffectThrow

ogsr_engine/xrGame/GraviZone.cpp:205–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203 GO->PPhysicsShell()->applyImpulse(throw_in_dir, dist * m_fThrowInImpulse * GO->GetMass() / 100.f);
204}
205void CBaseGraviZone ::AffectThrow(SZoneObjectInfo* O, CPhysicsShellHolder* GO, const Fvector& throw_in_dir, float dist)
206{
207 Fvector position_in_bone_space;
208
209 float power = Power(dist); // Power(GO->Position().distance_to(zone_center));
210 float impulse = m_fHitImpulseScale * power * GO->GetMass();
211
212 // if(fis_zero(dist))
213 //{
214 // impulse = 0.f;
215 // throw_in_dir.set(0,1,0);
216 // }
217 // else
218 // throw_in_dir.normalize();
219
220 //статистика по объекту
221 O->total_damage += power;
222 O->hit_num++;
223
224 if (power > 0.01f)
225 {
226 m_dwDeltaTime = 0;
227 position_in_bone_space.set(0.f, 0.f, 0.f);
228 CreateHit(GO->ID(), ID(), throw_in_dir, power, 0, position_in_bone_space, impulse, m_eHitTypeBlowout);
229 PlayHitParticles(GO);
230 }
231}
232
233void CBaseGraviZone ::PlayTeleParticles(CGameObject* pObject)
234{

Callers

nothing calls this directly

Calls 4

PowerFunction · 0.85
IDFunction · 0.85
GetMassMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected