From f56bb35301836e56582a575a75864392a0177875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20P=2E=20Tjern=C3=B8?= Date: Mon, 2 Dec 2013 19:31:46 -0800 Subject: Fix line endings. WHAMMY. --- mp/src/utils/common/polylib.h | 156 +++++++++++++++++++++--------------------- 1 file changed, 78 insertions(+), 78 deletions(-) (limited to 'mp/src/utils/common/polylib.h') 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 -- cgit v1.2.3