Minor opt.

pull/216/head
castano 13 years ago
parent 97f17dc6d8
commit 086bf0343c

@ -1,6 +1,8 @@
// This code is in the public domain -- castanyo@yahoo.es
#include <nvmath/SphericalHarmonic.h>
#include "SphericalHarmonic.h"
#include "Vector.h"
using namespace nv;

@ -3,20 +3,21 @@
#ifndef NV_MATH_SPHERICALHARMONIC_H
#define NV_MATH_SPHERICALHARMONIC_H
#include "Vector.h"
#include "nvmath.h"
#include <string.h> // memcpy
namespace nv
{
class Vector3;
class Matrix;
NVMATH_API float legendrePolynomial( int l, int m, float x ) NV_CONST;
NVMATH_API float shBasis( int l, int m, float theta, float phi ) NV_CONST;
NVMATH_API float shBasis( int l, int m, Vector3::Arg v ) NV_CONST;
NVMATH_API float shBasis( int l, int m, const Vector3 & v ) NV_CONST;
NVMATH_API float hshBasis( int l, int m, float theta, float phi ) NV_CONST;
NVMATH_API float hshBasis( int l, int m, Vector3::Arg v ) NV_CONST;
NVMATH_API float hshBasis( int l, int m, const Vector3 & v ) NV_CONST;
class Sh;
float dot(const Sh & a, const Sh & b) NV_CONST;
@ -185,7 +186,7 @@ namespace nv
}*/
/// Evaluate
void eval(Vector3::Arg dir)
void eval(const Vector3 & dir)
{
for(int l = 0; l <= m_order; l++) {
for(int m = -l; m <= l; m++) {
@ -196,7 +197,7 @@ namespace nv
/// Evaluate the spherical harmonic function.
float sample(Vector3::Arg dir) const
float sample(const Vector3 & dir) const
{
Sh sh(order());
sh.eval(dir);

Loading…
Cancel
Save