andrewm@379
|
1 /*
|
andrewm@379
|
2 * Copyright 2014-15 ARM Limited and Contributors.
|
andrewm@379
|
3 * All rights reserved.
|
andrewm@379
|
4 *
|
andrewm@379
|
5 * Redistribution and use in source and binary forms, with or without
|
andrewm@379
|
6 * modification, are permitted provided that the following conditions are met:
|
andrewm@379
|
7 * * Redistributions of source code must retain the above copyright
|
andrewm@379
|
8 * notice, this list of conditions and the following disclaimer.
|
andrewm@379
|
9 * * Redistributions in binary form must reproduce the above copyright
|
andrewm@379
|
10 * notice, this list of conditions and the following disclaimer in the
|
andrewm@379
|
11 * documentation and/or other materials provided with the distribution.
|
andrewm@379
|
12 * * Neither the name of ARM Limited nor the
|
andrewm@379
|
13 * names of its contributors may be used to endorse or promote products
|
andrewm@379
|
14 * derived from this software without specific prior written permission.
|
andrewm@379
|
15 *
|
andrewm@379
|
16 * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND
|
andrewm@379
|
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
andrewm@379
|
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
andrewm@379
|
19 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY
|
andrewm@379
|
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
andrewm@379
|
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
andrewm@379
|
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
andrewm@379
|
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
andrewm@379
|
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
andrewm@379
|
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
andrewm@379
|
26 */
|
andrewm@379
|
27
|
andrewm@379
|
28 /*
|
andrewm@379
|
29 * NE10 Library : inc/NE10_physics.h
|
andrewm@379
|
30 */
|
andrewm@379
|
31
|
andrewm@379
|
32
|
andrewm@379
|
33 #include "NE10_types.h"
|
andrewm@379
|
34
|
andrewm@379
|
35 #ifndef NE10_PHYSICS_H
|
andrewm@379
|
36 #define NE10_PHYSICS_H
|
andrewm@379
|
37
|
andrewm@379
|
38 #ifdef __cplusplus
|
andrewm@379
|
39 extern "C" {
|
andrewm@379
|
40 #endif
|
andrewm@379
|
41
|
andrewm@379
|
42 ///////////////////////////
|
andrewm@379
|
43 // function prototypes:
|
andrewm@379
|
44 ///////////////////////////
|
andrewm@379
|
45
|
andrewm@379
|
46 /* function pointers*/
|
andrewm@379
|
47 extern void (*ne10_physics_compute_aabb_vec2f) (ne10_mat2x2f_t *aabb,
|
andrewm@379
|
48 ne10_vec2f_t *vertices,
|
andrewm@379
|
49 ne10_mat2x2f_t *xf,
|
andrewm@379
|
50 ne10_vec2f_t *radius,
|
andrewm@379
|
51 ne10_uint32_t vertex_count);
|
andrewm@379
|
52 extern void (*ne10_physics_relative_v_vec2f) (ne10_vec2f_t *dv,
|
andrewm@379
|
53 ne10_vec3f_t *v_wa,
|
andrewm@379
|
54 ne10_vec2f_t *ra,
|
andrewm@379
|
55 ne10_vec3f_t *v_wb,
|
andrewm@379
|
56 ne10_vec2f_t *rb,
|
andrewm@379
|
57 ne10_uint32_t count);
|
andrewm@379
|
58 extern void (*ne10_physics_apply_impulse_vec2f) (ne10_vec3f_t *v_wa,
|
andrewm@379
|
59 ne10_vec3f_t *v_wb,
|
andrewm@379
|
60 ne10_vec2f_t *ra,
|
andrewm@379
|
61 ne10_vec2f_t *rb,
|
andrewm@379
|
62 ne10_vec2f_t *ima,
|
andrewm@379
|
63 ne10_vec2f_t *imb,
|
andrewm@379
|
64 ne10_vec2f_t *p,
|
andrewm@379
|
65 ne10_uint32_t count);
|
andrewm@379
|
66
|
andrewm@379
|
67 /* C version*/
|
andrewm@379
|
68 extern void ne10_physics_compute_aabb_vec2f_c (ne10_mat2x2f_t *aabb,
|
andrewm@379
|
69 ne10_vec2f_t *vertices,
|
andrewm@379
|
70 ne10_mat2x2f_t *xf,
|
andrewm@379
|
71 ne10_vec2f_t *radius,
|
andrewm@379
|
72 ne10_uint32_t vertex_count);
|
andrewm@379
|
73 extern void ne10_physics_relative_v_vec2f_c (ne10_vec2f_t *dv,
|
andrewm@379
|
74 ne10_vec3f_t *v_wa,
|
andrewm@379
|
75 ne10_vec2f_t *ra,
|
andrewm@379
|
76 ne10_vec3f_t *v_wb,
|
andrewm@379
|
77 ne10_vec2f_t *rb,
|
andrewm@379
|
78 ne10_uint32_t count);
|
andrewm@379
|
79 extern void ne10_physics_apply_impulse_vec2f_c (ne10_vec3f_t *v_wa,
|
andrewm@379
|
80 ne10_vec3f_t *v_wb,
|
andrewm@379
|
81 ne10_vec2f_t *ra,
|
andrewm@379
|
82 ne10_vec2f_t *rb,
|
andrewm@379
|
83 ne10_vec2f_t *ima,
|
andrewm@379
|
84 ne10_vec2f_t *imb,
|
andrewm@379
|
85 ne10_vec2f_t *p,
|
andrewm@379
|
86 ne10_uint32_t count);
|
andrewm@379
|
87
|
andrewm@379
|
88 /* NEON version*/
|
andrewm@379
|
89 /**
|
andrewm@379
|
90 * @addtogroup COLLISION_DETECT
|
andrewm@379
|
91 * @{
|
andrewm@379
|
92 */
|
andrewm@379
|
93 #ifdef ENABLE_NE10_PHYSICS_COMPUTE_AABB_VEC2F_NEON
|
andrewm@379
|
94 extern void ne10_physics_compute_aabb_vec2f_neon (ne10_mat2x2f_t *aabb,
|
andrewm@379
|
95 ne10_vec2f_t *vertices,
|
andrewm@379
|
96 ne10_mat2x2f_t *xf,
|
andrewm@379
|
97 ne10_vec2f_t *radius,
|
andrewm@379
|
98 ne10_uint32_t vertex_count);
|
andrewm@379
|
99 #endif // ENABLE_NE10_PHYSICS_COMPUTE_AABB_VEC2F_NEON
|
andrewm@379
|
100
|
andrewm@379
|
101 #ifdef ENABLE_NE10_PHYSICS_RELATIVE_V_VEC2F_NEON
|
andrewm@379
|
102 extern void ne10_physics_relative_v_vec2f_neon (ne10_vec2f_t *dv,
|
andrewm@379
|
103 ne10_vec3f_t *v_wa,
|
andrewm@379
|
104 ne10_vec2f_t *ra,
|
andrewm@379
|
105 ne10_vec3f_t *v_wb,
|
andrewm@379
|
106 ne10_vec2f_t *rb,
|
andrewm@379
|
107 ne10_uint32_t count)
|
andrewm@379
|
108 asm ("ne10_physics_relative_v_vec2f_neon");
|
andrewm@379
|
109 #endif // ENABLE_NE10_PHYSICS_RELATIVE_V_VEC2F_NEON
|
andrewm@379
|
110
|
andrewm@379
|
111 #ifdef ENABLE_NE10_PHYSICS_APPLY_IMPULSE_VEC2F_NEON
|
andrewm@379
|
112 extern void ne10_physics_apply_impulse_vec2f_neon (ne10_vec3f_t *v_wa,
|
andrewm@379
|
113 ne10_vec3f_t *v_wb,
|
andrewm@379
|
114 ne10_vec2f_t *ra,
|
andrewm@379
|
115 ne10_vec2f_t *rb,
|
andrewm@379
|
116 ne10_vec2f_t *ima,
|
andrewm@379
|
117 ne10_vec2f_t *imb,
|
andrewm@379
|
118 ne10_vec2f_t *p,
|
andrewm@379
|
119 ne10_uint32_t count)
|
andrewm@379
|
120 asm ("ne10_physics_apply_impulse_vec2f_neon");
|
andrewm@379
|
121 #endif // ENABLE_NE10_PHYSICS_APPLY_IMPULSE_VEC2F_NEON
|
andrewm@379
|
122 /**
|
andrewm@379
|
123 * @} end of COLLISION_DETECT group
|
andrewm@379
|
124 */
|
andrewm@379
|
125
|
andrewm@379
|
126
|
andrewm@379
|
127 #ifdef __cplusplus
|
andrewm@379
|
128 }
|
andrewm@379
|
129 #endif
|
andrewm@379
|
130
|
andrewm@379
|
131 #endif
|