1 | // |
2 | // Redistribution and use in source and binary forms, with or without |
3 | // modification, are permitted provided that the following conditions |
4 | // are met: |
5 | // * Redistributions of source code must retain the above copyright |
6 | // notice, this list of conditions and the following disclaimer. |
7 | // * Redistributions in binary form must reproduce the above copyright |
8 | // notice, this list of conditions and the following disclaimer in the |
9 | // documentation and/or other materials provided with the distribution. |
10 | // * Neither the name of NVIDIA CORPORATION nor the names of its |
11 | // contributors may be used to endorse or promote products derived |
12 | // from this software without specific prior written permission. |
13 | // |
14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY |
15 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
16 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
17 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
18 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
20 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
21 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
22 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 | // |
26 | // Copyright (c) 2008-2021 NVIDIA Corporation. All rights reserved. |
27 | // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. |
28 | // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. |
29 | |
30 | #ifndef PSFOUNDATION_PSUNIXTRIGCONSTANTS_H |
31 | #define PSFOUNDATION_PSUNIXTRIGCONSTANTS_H |
32 | |
33 | #include "foundation/PxPreprocessor.h" |
34 | |
35 | namespace physx |
36 | { |
37 | namespace shdfnd |
38 | { |
39 | namespace aos |
40 | { |
41 | |
42 | #if PX_UWP |
43 | #define PX_GLOBALCONST extern const __declspec(selectany) |
44 | #else |
45 | #define PX_GLOBALCONST extern const __attribute__((weak)) |
46 | #endif |
47 | |
48 | PX_ALIGN_PREFIX(16) |
49 | struct PX_VECTORF32 |
50 | { |
51 | float f[4]; |
52 | } PX_ALIGN_SUFFIX(16); |
53 | |
54 | PX_GLOBALCONST PX_VECTORF32 g_PXSinCoefficients0 = { .f: { 1.0f, -0.166666667f, 8.333333333e-3f, -1.984126984e-4f } }; |
55 | PX_GLOBALCONST PX_VECTORF32 |
56 | g_PXSinCoefficients1 = { .f: { 2.755731922e-6f, -2.505210839e-8f, 1.605904384e-10f, -7.647163732e-13f } }; |
57 | PX_GLOBALCONST PX_VECTORF32 |
58 | g_PXSinCoefficients2 = { .f: { 2.811457254e-15f, -8.220635247e-18f, 1.957294106e-20f, -3.868170171e-23f } }; |
59 | PX_GLOBALCONST PX_VECTORF32 g_PXCosCoefficients0 = { .f: { 1.0f, -0.5f, 4.166666667e-2f, -1.388888889e-3f } }; |
60 | PX_GLOBALCONST PX_VECTORF32 |
61 | g_PXCosCoefficients1 = { .f: { 2.480158730e-5f, -2.755731922e-7f, 2.087675699e-9f, -1.147074560e-11f } }; |
62 | PX_GLOBALCONST PX_VECTORF32 |
63 | g_PXCosCoefficients2 = { .f: { 4.779477332e-14f, -1.561920697e-16f, 4.110317623e-19f, -8.896791392e-22f } }; |
64 | PX_GLOBALCONST PX_VECTORF32 g_PXTanCoefficients0 = { .f: { 1.0f, 0.333333333f, 0.133333333f, 5.396825397e-2f } }; |
65 | PX_GLOBALCONST PX_VECTORF32 |
66 | g_PXTanCoefficients1 = { .f: { 2.186948854e-2f, 8.863235530e-3f, 3.592128167e-3f, 1.455834485e-3f } }; |
67 | PX_GLOBALCONST PX_VECTORF32 |
68 | g_PXTanCoefficients2 = { .f: { 5.900274264e-4f, 2.391290764e-4f, 9.691537707e-5f, 3.927832950e-5f } }; |
69 | PX_GLOBALCONST PX_VECTORF32 |
70 | g_PXASinCoefficients0 = { .f: { -0.05806367563904f, -0.41861972469416f, 0.22480114791621f, 2.17337241360606f } }; |
71 | PX_GLOBALCONST PX_VECTORF32 |
72 | g_PXASinCoefficients1 = { .f: { 0.61657275907170f, 4.29696498283455f, -1.18942822255452f, -6.53784832094831f } }; |
73 | PX_GLOBALCONST PX_VECTORF32 |
74 | g_PXASinCoefficients2 = { .f: { -1.36926553863413f, -4.48179294237210f, 1.41810672941833f, 5.48179257935713f } }; |
75 | PX_GLOBALCONST PX_VECTORF32 g_PXATanCoefficients0 = { .f: { 1.0f, 0.333333334f, 0.2f, 0.142857143f } }; |
76 | PX_GLOBALCONST PX_VECTORF32 |
77 | g_PXATanCoefficients1 = { .f: { 1.111111111e-1f, 9.090909091e-2f, 7.692307692e-2f, 6.666666667e-2f } }; |
78 | PX_GLOBALCONST PX_VECTORF32 |
79 | g_PXATanCoefficients2 = { .f: { 5.882352941e-2f, 5.263157895e-2f, 4.761904762e-2f, 4.347826087e-2f } }; |
80 | PX_GLOBALCONST PX_VECTORF32 |
81 | g_PXSinEstCoefficients = { .f: { 1.0f, -1.66521856991541e-1f, 8.199913018755e-3f, -1.61475937228e-4f } }; |
82 | PX_GLOBALCONST PX_VECTORF32 |
83 | g_PXCosEstCoefficients = { .f: { 1.0f, -4.95348008918096e-1f, 3.878259962881e-2f, -9.24587976263e-4f } }; |
84 | PX_GLOBALCONST PX_VECTORF32 g_PXTanEstCoefficients = { .f: { 2.484f, -1.954923183e-1f, 2.467401101f, PxInvPi } }; |
85 | PX_GLOBALCONST PX_VECTORF32 |
86 | g_PXATanEstCoefficients = { .f: { 7.689891418951e-1f, 1.104742493348f, 8.661844266006e-1f, PxPiDivTwo } }; |
87 | PX_GLOBALCONST PX_VECTORF32 |
88 | g_PXASinEstCoefficients = { .f: { -1.36178272886711f, 2.37949493464538f, -8.08228565650486e-1f, 2.78440142746736e-1f } }; |
89 | PX_GLOBALCONST PX_VECTORF32 g_PXASinEstConstants = { .f: { 1.00000011921f, PxPiDivTwo, 0.0f, 0.0f } }; |
90 | PX_GLOBALCONST PX_VECTORF32 g_PXPiConstants0 = { .f: { PxPi, PxTwoPi, PxInvPi, PxInvTwoPi } }; |
91 | PX_GLOBALCONST PX_VECTORF32 g_PXReciprocalTwoPi = { .f: { PxInvTwoPi, PxInvTwoPi, PxInvTwoPi, PxInvTwoPi } }; |
92 | PX_GLOBALCONST PX_VECTORF32 g_PXTwoPi = { .f: { PxTwoPi, PxTwoPi, PxTwoPi, PxTwoPi } }; |
93 | |
94 | } // namespace aos |
95 | } // namespace shdfnd |
96 | } // namespace physx |
97 | |
98 | #endif |
99 | |