123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- #pragma once
- #include <Mathematics/Vector.h>
- namespace WwiseGTE
- {
- template <int N, typename Real>
- class ParametricSurface
- {
- protected:
-
-
-
-
-
-
-
- ParametricSurface(Real umin, Real umax, Real vmin, Real vmax, bool rectangular)
- :
- mUMin(umin),
- mUMax(umax),
- mVMin(vmin),
- mVMax(vmax),
- mRectangular(rectangular)
- {
- }
- public:
- virtual ~ParametricSurface()
- {
- }
-
-
-
- inline operator bool() const
- {
- return mConstructed;
- }
-
- inline Real GetUMin() const
- {
- return mUMin;
- }
- inline Real GetUMax() const
- {
- return mUMax;
- }
- inline Real GetVMin() const
- {
- return mVMin;
- }
- inline Real GetVMax() const
- {
- return mVMax;
- }
- inline bool IsRectangular() const
- {
- return mRectangular;
- }
-
-
-
-
-
-
-
-
- enum { SUP_ORDER = 6 };
- virtual void Evaluate(Real u, Real v, unsigned int order, Vector<N, Real>* jet) const = 0;
-
- Vector<N, Real> GetPosition(Real u, Real v) const
- {
- Vector<N, Real> position;
- Evaluate(u, v, 0, &position);
- return position;
- }
- Vector<N, Real> GetUTangent(Real u, Real v) const
- {
- std::array<Vector<N, Real>, 3> jet;
- Evaluate(u, v, 1, jet.data());
- Normalize(jet[1]);
- return jet[1];
- }
- Vector<N, Real> GetVTangent(Real u, Real v) const
- {
- std::array<Vector<N, Real>, 3> jet;
- Evaluate(u, v, 1, jet.data());
- Normalize(jet[2]);
- return jet[2];
- }
- protected:
- Real mUMin, mUMax, mVMin, mVMax;
- bool mRectangular;
- bool mConstructed;
- };
- }
|