|
//
// MathHelper.h
//
// Set of math helper functions
//
// Copyright 2005 Paul Higinbotham
//
#ifndef __MATHHELPER_H_
#define __MATHHELPER_H_
#include "..\..\math\Vector2.h"
#include "..\..\math\Vector3.h"
#include "..\..\math\Plane.h"
namespace ZGraphics
{
// Typedefs
typedef struct _sectInfo
{
Planef fPlane;
Vector3f ptIntersect;
float fDepth;
_sectInfo()
{
ptIntersect = Vector3f::cZero;
fPlane.SetPlane(Vector3f::cZero, 0.0f);
fDepth = 0.0f;
}
_sectInfo(const Vector3f & ptIntsect, const Planef & plane)
{
fPlane = plane;
ptIntersect = ptIntsect;
fDepth = 0.0f;
}
_sectInfo(const Vector3f& ptIntsect, float fDpth, const Planef& plane)
{
fPlane = plane;
ptIntersect = ptIntsect;
fDepth = fDpth;
}
_sectInfo(_sectInfo const& sectInfo)
{
fPlane = sectInfo.fPlane;
ptIntersect = sectInfo.ptIntersect;
fDepth = sectInfo.fDepth;
}
} SectInfo;
// Helper functions
bool RayEdgeIntersect(const Vector2f vRay[2], const Vector2f ptEdge[2]);
bool EdgeEdgeIntersect(const Vector2f ptEdge1[2], const Vector2f ptEdge2[2]);
} // namespace ZGraphics
#endif /* __MATHHELPER_H_ */
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a senior software developer currently doing contract work for Microsoft. My educational background is in electrical engineering and I hold a masters degree from the University of Washington. I have experience in hardware and systems design but have done primarily software development for the last two decades. I have worked for various small companies as well as start-up companies, and have worked as a full time employee SDE at Microsoft Corporation.