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

Method FindNormal

ogsr_engine/xrGame/Explosive.cpp:601–622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599}
600
601void CExplosive::FindNormal(Fvector& normal)
602{
603 collide::rq_result RQ;
604
605 Fvector pos, dir;
606 dir.set(0, -1.f, 0);
607 cast_game_object()->Center(pos);
608
609 BOOL result = Level().ObjectSpace.RayPick(pos, dir, cast_game_object()->Radius(), collide::rqtBoth, RQ, NULL);
610 if (!result || RQ.O)
611 {
612 normal.set(0, 1, 0);
613 //если лежим на статике
614 //найти треугольник и вычислить нормаль по нему
615 }
616 else
617 {
618 Fvector* pVerts = Level().ObjectSpace.GetStaticVerts();
619 CDB::TRI* pTri = Level().ObjectSpace.GetStaticTris() + RQ.element;
620 normal.mknormal(pVerts[pTri->verts[0]], pVerts[pTri->verts[1]], pVerts[pTri->verts[2]]);
621 }
622}
623
624void CExplosive::StartLight()
625{

Callers 2

explodeMethod · 0.80
explode_initiatorMethod · 0.80

Calls 6

mknormalMethod · 0.80
cast_game_objectFunction · 0.70
setMethod · 0.45
CenterMethod · 0.45
RayPickMethod · 0.45
RadiusMethod · 0.45

Tested by

no test coverage detected