@@ -662,16 +662,34 @@ namespace RTE {
662
662
// / first, g_NoMOID will be returned.
663
663
// / @param start The starting position.
664
664
// / @param ray The vector to trace along.
665
- // / @param ignoreMOID An MOID to ignore. Any child MO's of this MOID will also be ignored. (default: g_NoMOID)
665
+ // / @param ignoreMOIDs A vector of MOIDs to ignore. Any child MOs of an MOID will also be ignored. (default: g_NoMOID)
666
666
// / @param ignoreTeam To enable ignoring of all MOIDs associated with an object of a specific (default: Activity::NoTeam)
667
667
// / team which also has team ignoring enabled itself.
668
668
// / @param ignoreMaterial A specific material ID to ignore hits with. (default: 0)
669
669
// / @param ignoreAllTerrain Whether to ignore all terrain hits or not. (default: false)
670
670
// / @param skip For every pixel checked along the line, how many to skip between them (default: 0)
671
671
// / for optimization reasons. 0 = every pixel is checked.
672
672
// / @return The MOID of the hit non-ignored MO, or g_NoMOID if terrain or no MO was hit.
673
- MOID CastMORay (const Vector& start, const Vector& ray, MOID ignoreMOID = g_NoMOID, int ignoreTeam = Activity::NoTeam, unsigned char ignoreMaterial = 0 , bool ignoreAllTerrain = false , int skip = 0 );
673
+ MOID CastMORay (const Vector& start, const Vector& ray, const std::vector< MOID>& ignoreMOIDs = { g_NoMOID} , int ignoreTeam = Activity::NoTeam, unsigned char ignoreMaterial = 0 , bool ignoreAllTerrain = false , int skip = 0 );
674
674
675
+ // / Traces along a vector and returns MOID of the first non-ignored
676
+ // / non-NoMOID MO encountered. If a non-air terrain pixel is encountered
677
+ // / first, g_NoMOID will be returned.
678
+ // / @param start The starting position.
679
+ // / @param ray The vector to trace along.
680
+ // / @param ignoreMOID An MOID to ignore. Any child MOs of this MOID will also be ignored. (default: g_NoMOID)
681
+ // / @param ignoreTeam To enable ignoring of all MOIDs associated with an object of a specific (default: Activity::NoTeam)
682
+ // / team which also has team ignoring enabled itself.
683
+ // / @param ignoreMaterial A specific material ID to ignore hits with. (default: 0)
684
+ // / @param ignoreAllTerrain Whether to ignore all terrain hits or not. (default: false)
685
+ // / @param skip For every pixel checked along the line, how many to skip between them (default: 0)
686
+ // / for optimization reasons. 0 = every pixel is checked.
687
+ // / @return The MOID of the hit non-ignored MO, or g_NoMOID if terrain or no MO was hit.
688
+ MOID CastMORay (const Vector& start, const Vector& ray, MOID ignoreMOID = g_NoMOID, int ignoreTeam = Activity::NoTeam, unsigned char ignoreMaterial = 0 , bool ignoreAllTerrain = false , int skip = 0 ) {
689
+ std::vector<MOID> ignoreMOIDs = {ignoreMOID};
690
+ return CastMORay (start, ray, ignoreMOIDs, ignoreTeam, ignoreMaterial, ignoreAllTerrain, skip);
691
+ }
692
+
675
693
// / Traces along a vector and shows where a specific MOID has been found.
676
694
// / @param start The starting position.
677
695
// / @param ray The vector to trace along.
@@ -695,7 +713,7 @@ namespace RTE {
695
713
// / location of the last free position before hitting an obstacle, or the
696
714
// / end of the ray if none was hit. This is only altered if thre are any
697
715
// / free pixels encountered.
698
- // / @param ignoreMOID An MOID to ignore. Any child MO's of this MOID will also be ignored. (default: g_NoMOID)
716
+ // / @param ignoreMOIDs A vector of MOIDs to ignore. Any child MO's of an MOID will also be ignored. (default: g_NoMOID)
699
717
// / @param ignoreTeam To enable ignoring of all MOIDs associated with an object of a specific (default: Activity::NoTeam)
700
718
// / team which also has team ignoring enabled itself.
701
719
// / @param ignoreMaterial A specific material ID to ignore hits with. (default: 0)
@@ -704,8 +722,32 @@ namespace RTE {
704
722
// / @return How far along, in pixel units, the ray the pixel of any obstacle was
705
723
// / encountered. If no pixel of the right material was found, < 0 is returned.
706
724
// / If an obstacle on the starting position was encountered, 0 is returned.
707
- float CastObstacleRay (const Vector& start, const Vector& ray, Vector& obstaclePos, Vector& freePos, MOID ignoreMOID = g_NoMOID, int ignoreTeam = Activity::NoTeam, unsigned char ignoreMaterial = 0 , int skip = 0 );
725
+ float CastObstacleRay (const Vector& start, const Vector& ray, Vector& obstaclePos, Vector& freePos, const std::vector< MOID>& ignoreMOIDs = { g_NoMOID} , int ignoreTeam = Activity::NoTeam, unsigned char ignoreMaterial = 0 , int skip = 0 );
708
726
727
+ // / Traces along a vector and returns the length of how far the trace went
728
+ // / without hitting any non-ignored terrain material or MOID at all.
729
+ // / @param start The starting position.
730
+ // / @param ray The vector to trace along.
731
+ // / @param obstaclePos A reference to the vector screen will be filled out with the absolute
732
+ // / location of the first obstacle, or the end of the ray if none was hit.
733
+ // / @param freePos A reference to the vector screen will be filled out with the absolute
734
+ // / location of the last free position before hitting an obstacle, or the
735
+ // / end of the ray if none was hit. This is only altered if thre are any
736
+ // / free pixels encountered.
737
+ // / @param ignoreMOID An MOID to ignore. Any child MO of this MOID will also be ignored. (default: g_NoMOID)
738
+ // / @param ignoreTeam To enable ignoring of all MOIDs associated with an object of a specific (default: Activity::NoTeam)
739
+ // / team which also has team ignoring enabled itself.
740
+ // / @param ignoreMaterial A specific material ID to ignore hits with. (default: 0)
741
+ // / @param skip For every pixel checked along the line, how many to skip between them (default: 0)
742
+ // / for optimization reasons. 0 = every pixel is checked.
743
+ // / @return How far along, in pixel units, the ray the pixel of any obstacle was
744
+ // / encountered. If no pixel of the right material was found, < 0 is returned.
745
+ // / If an obstacle on the starting position was encountered, 0 is returned.
746
+ float CastObstacleRay (const Vector& start, const Vector& ray, Vector& obstaclePos, Vector& freePos, MOID ignoreMOID = g_NoMOID, int ignoreTeam = Activity::NoTeam, unsigned char ignoreMaterial = 0 , int skip = 0 ) {
747
+ std::vector<MOID> ignoreMOIDs = {ignoreMOID};
748
+ return CastObstacleRay (start, ray, obstaclePos, freePos, ignoreMOIDs, ignoreTeam, ignoreMaterial, skip);
749
+ }
750
+
709
751
// / Gets the abosulte pos of where the last cast ray hit somehting.
710
752
// / @return A vector with the absolute pos of where the last ray cast hit somehting.
711
753
const Vector& GetLastRayHitPos ();
0 commit comments