55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
/*
|
|
This file is part of Mitsuba, a physically based rendering system.
|
|
|
|
Copyright (c) 2007-2011 by Wenzel Jakob and others.
|
|
|
|
Mitsuba is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License Version 3
|
|
as published by the Free Software Foundation.
|
|
|
|
Mitsuba is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#if !defined(__CONSTANTS_H)
|
|
#define __CONSTANTS_H
|
|
|
|
/* Choice of precision */
|
|
#ifdef DOUBLE_PRECISION
|
|
#define Epsilon 1e-6
|
|
#else
|
|
#define Epsilon 1e-4f
|
|
#endif
|
|
|
|
/// relative eps. for shadow rays
|
|
#define ShadowEpsilon 1e-3f
|
|
|
|
#ifdef M_PI
|
|
#undef M_PI
|
|
#endif
|
|
|
|
#ifdef INFINITY
|
|
#undef INFINITY
|
|
#endif
|
|
|
|
#ifdef SINGLE_PRECISION
|
|
#define M_PI 3.14159265358979323846f
|
|
#define INV_PI 0.31830988618379067154f
|
|
#define INV_TWOPI 0.15915494309189533577f
|
|
#define SQRT_TWO 1.41421356237309504880f
|
|
#define INV_SQRT_TWO 0.70710678118654752440f
|
|
#else
|
|
#define M_PI 3.14159265358979323846
|
|
#define INV_PI 0.31830988618379067154
|
|
#define INV_TWOPI 0.15915494309189533577
|
|
#define SQRT_TWO 1.41421356237309504880
|
|
#define INV_SQRT_TWO 0.70710678118654752440
|
|
#endif
|
|
|
|
#endif /* __CONSTANTS_H */
|