You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Generals/Code/GameEngine/Include/GameClient/View.h
+12-1
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,16 @@ class View : public Snapshot
83
83
SHAKE_COUNT
84
84
};
85
85
86
+
// Return values for worldToScreenTriReturn
87
+
enum WorldToScreenReturn CPP_11(: Int)
88
+
{
89
+
WTS_INSIDE_FRUSTUM = 0, // On the screen (inside frustum of camera)
90
+
WTS_OUTSIDE_FRUSTUM, // Return is valid but off the screen (outside frustum of camera)
91
+
WTS_INVALID, // No transform possible
92
+
93
+
WTS_COUNT
94
+
};
95
+
86
96
public:
87
97
88
98
View( void );
@@ -183,7 +193,8 @@ class View : public Snapshot
183
193
virtualvoidsetFieldOfView( Real angle ) { m_FOV = angle; } ///< Set the horizontal field of view angle
184
194
virtual Real getFieldOfView( void ) { return m_FOV; } ///< Get the horizontal field of view angle
185
195
186
-
virtual Bool worldToScreen( const Coord3D *w, ICoord2D *s ) = 0; ///< Transform world coordinate "w" into screen coordinate "s"
196
+
Bool worldToScreen( const Coord3D *w, ICoord2D *s ) { returnworldToScreenTriReturn( w, s ) == WTS_INSIDE_FRUSTUM; } ///< Transform world coordinate "w" into screen coordinate "s"
197
+
virtual WorldToScreenReturn worldToScreenTriReturn(const Coord3D *w, ICoord2D *s ) = 0; ///< Like worldToScreen(), but with a more informative return value
187
198
virtualvoidscreenToWorld( const ICoord2D *s, Coord3D *w ) = 0; ///< Transform screen coordinate "s" into world coordinate "w"
188
199
virtualvoidscreenToTerrain( const ICoord2D *screen, Coord3D *world ) = 0; ///< transform screen coord to a point on the 3D terrain
189
200
virtualvoidscreenToWorldAtZ( const ICoord2D *s, Coord3D *w, Real z ) = 0; ///< transform screen point to world point at the specified world Z value
//DEBUG_ASSERTCRASH(distSqr < 5*5 || distSqr < attackRangeSqr*1.2f, ("*** victim is out of range (%f vs %f) of this weapon -- why did we attempt to fire?\n",sqrtf(distSqr),sqrtf(attackRangeSqr)));
DEBUG_ASSERTCRASH(distSqr > minAttackRangeSqr*0.8f, ("*** victim is closer than min attack range (%f vs %f) of this weapon -- why did we attempt to fire?\n",sqrtf(distSqr),sqrtf(minAttackRangeSqr)));
0 commit comments