MCPcopy Create free account
hub / github.com/JACoders/OpenJK / setup_edge

Method setup_edge

code/game/g_navigator.cpp:716–733  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////////// setup the edge (For Triangulation) This function is here because it evaluates the base cost from NodeA to NodeB, which ///////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

714 //
715 ////////////////////////////////////////////////////////////////////////////////////
716 virtual void setup_edge(CWayEdge& Edge, int A, int B, bool OnHull, const CWayNode& NodeA, const CWayNode& NodeB, bool CanBeInvalid=false)
717 {
718 Edge.mNodeA = A;
719 Edge.mNodeB = B;
720 Edge.mDistance = NodeA.mPoint.Dist(NodeB.mPoint);
721 Edge.mEntityNum = ENTITYNUM_NONE;
722 Edge.mOwnerNum = ENTITYNUM_NONE;
723 Edge.mFlags.clear();
724 Edge.mFlags.set_bit(CWayEdge::WE_VALID);
725 if (CanBeInvalid)
726 {
727 Edge.mFlags.set_bit(CWayEdge::WE_CANBEINVAL);
728 }
729 if (OnHull)
730 {
731 Edge.mFlags.set_bit(CWayEdge::WE_ONHULL);
732 }
733 }
734};
735
736

Callers 2

finishMethod · 0.80

Calls 3

DistMethod · 0.80
clearMethod · 0.45
set_bitMethod · 0.45

Tested by

no test coverage detected