diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/utils/common/polylib.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/utils/common/polylib.h')
| -rw-r--r-- | mp/src/utils/common/polylib.h | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/mp/src/utils/common/polylib.h b/mp/src/utils/common/polylib.h index 1750a82a..8753dccc 100644 --- a/mp/src/utils/common/polylib.h +++ b/mp/src/utils/common/polylib.h @@ -1,78 +1,78 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-//
-//-----------------------------------------------------------------------------
-// $Log: $
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#ifndef POLYLIB_H
-#define POLYLIB_H
-#pragma once
-
-#ifndef MATHLIB_H
-#include "mathlib/mathlib.h"
-#endif
-
-struct winding_t
-{
- int numpoints;
- Vector *p; // variable sized
- int maxpoints;
- winding_t *next;
-};
-
-#define MAX_POINTS_ON_WINDING 64
-
-// you can define on_epsilon in the makefile as tighter
-// point on plane side epsilon
-// todo: need a world-space epsilon, a lightmap-space epsilon, and a texture space epsilon
-// or at least convert from a world-space epsilon to lightmap and texture space epsilons
-#ifndef ON_EPSILON
-#define ON_EPSILON 0.1
-#endif
-
-
-winding_t *AllocWinding (int points);
-vec_t WindingArea (winding_t *w);
-void WindingCenter (winding_t *w, Vector ¢er);
-vec_t WindingAreaAndBalancePoint( winding_t *w, Vector ¢er );
-void ClipWindingEpsilon (winding_t *in, const Vector &normal, vec_t dist,
- vec_t epsilon, winding_t **front, winding_t **back);
-
-// translates everything by offset, then does the clip, then translates back (to keep precision)
-void ClipWindingEpsilon_Offset( winding_t *in, const Vector &normal, vec_t dist, vec_t epsilon, winding_t **front, winding_t **back, const Vector &offset );
-
-void ClassifyWindingEpsilon( winding_t *in, const Vector &normal, vec_t dist,
- vec_t epsilon, winding_t **front, winding_t **back, winding_t **on);
-void ClassifyWindingEpsilon_Offset( winding_t *in, const Vector &normal, vec_t dist,
- vec_t epsilon, winding_t **front, winding_t **back, winding_t **on, const Vector &offset);
-
-winding_t *ChopWinding (winding_t *in, const Vector &normal, vec_t dist);
-winding_t *CopyWinding (winding_t *w);
-winding_t *ReverseWinding (winding_t *w);
-winding_t *BaseWindingForPlane (const Vector &normal, vec_t dist);
-void CheckWinding (winding_t *w);
-void WindingPlane (winding_t *w, Vector &normal, vec_t *dist);
-void RemoveColinearPoints (winding_t *w);
-int WindingOnPlaneSide (winding_t *w, const Vector &normal, vec_t dist);
-void FreeWinding (winding_t *w);
-void WindingBounds (winding_t *w, Vector &mins, Vector &maxs);
-
-void ChopWindingInPlace (winding_t **w, const Vector &normal, vec_t dist, vec_t epsilon);
-// frees the original if clipped
-
-bool PointInWinding( Vector const &pt, winding_t *pWinding );
-
-// translates a winding by offset
-void TranslateWinding( winding_t *pWinding, const Vector &offset );
-
-void pw(winding_t *w);
-
-
-#endif // POLYLIB_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef POLYLIB_H +#define POLYLIB_H +#pragma once + +#ifndef MATHLIB_H +#include "mathlib/mathlib.h" +#endif + +struct winding_t +{ + int numpoints; + Vector *p; // variable sized + int maxpoints; + winding_t *next; +}; + +#define MAX_POINTS_ON_WINDING 64 + +// you can define on_epsilon in the makefile as tighter +// point on plane side epsilon +// todo: need a world-space epsilon, a lightmap-space epsilon, and a texture space epsilon +// or at least convert from a world-space epsilon to lightmap and texture space epsilons +#ifndef ON_EPSILON +#define ON_EPSILON 0.1 +#endif + + +winding_t *AllocWinding (int points); +vec_t WindingArea (winding_t *w); +void WindingCenter (winding_t *w, Vector ¢er); +vec_t WindingAreaAndBalancePoint( winding_t *w, Vector ¢er ); +void ClipWindingEpsilon (winding_t *in, const Vector &normal, vec_t dist, + vec_t epsilon, winding_t **front, winding_t **back); + +// translates everything by offset, then does the clip, then translates back (to keep precision) +void ClipWindingEpsilon_Offset( winding_t *in, const Vector &normal, vec_t dist, vec_t epsilon, winding_t **front, winding_t **back, const Vector &offset ); + +void ClassifyWindingEpsilon( winding_t *in, const Vector &normal, vec_t dist, + vec_t epsilon, winding_t **front, winding_t **back, winding_t **on); +void ClassifyWindingEpsilon_Offset( winding_t *in, const Vector &normal, vec_t dist, + vec_t epsilon, winding_t **front, winding_t **back, winding_t **on, const Vector &offset); + +winding_t *ChopWinding (winding_t *in, const Vector &normal, vec_t dist); +winding_t *CopyWinding (winding_t *w); +winding_t *ReverseWinding (winding_t *w); +winding_t *BaseWindingForPlane (const Vector &normal, vec_t dist); +void CheckWinding (winding_t *w); +void WindingPlane (winding_t *w, Vector &normal, vec_t *dist); +void RemoveColinearPoints (winding_t *w); +int WindingOnPlaneSide (winding_t *w, const Vector &normal, vec_t dist); +void FreeWinding (winding_t *w); +void WindingBounds (winding_t *w, Vector &mins, Vector &maxs); + +void ChopWindingInPlace (winding_t **w, const Vector &normal, vec_t dist, vec_t epsilon); +// frees the original if clipped + +bool PointInWinding( Vector const &pt, winding_t *pWinding ); + +// translates a winding by offset +void TranslateWinding( winding_t *pWinding, const Vector &offset ); + +void pw(winding_t *w); + + +#endif // POLYLIB_H |