andrewm@379: /* andrewm@379: * Copyright 2014-15 ARM Limited and Contributors. andrewm@379: * All rights reserved. andrewm@379: * andrewm@379: * Redistribution and use in source and binary forms, with or without andrewm@379: * modification, are permitted provided that the following conditions are met: andrewm@379: * * Redistributions of source code must retain the above copyright andrewm@379: * notice, this list of conditions and the following disclaimer. andrewm@379: * * Redistributions in binary form must reproduce the above copyright andrewm@379: * notice, this list of conditions and the following disclaimer in the andrewm@379: * documentation and/or other materials provided with the distribution. andrewm@379: * * Neither the name of ARM Limited nor the andrewm@379: * names of its contributors may be used to endorse or promote products andrewm@379: * derived from this software without specific prior written permission. andrewm@379: * andrewm@379: * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND andrewm@379: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED andrewm@379: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE andrewm@379: * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY andrewm@379: * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES andrewm@379: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; andrewm@379: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND andrewm@379: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT andrewm@379: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS andrewm@379: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. andrewm@379: */ andrewm@379: andrewm@379: /* andrewm@379: * NE10 Library : inc/NE10_physics.h andrewm@379: */ andrewm@379: andrewm@379: andrewm@379: #include "NE10_types.h" andrewm@379: andrewm@379: #ifndef NE10_PHYSICS_H andrewm@379: #define NE10_PHYSICS_H andrewm@379: andrewm@379: #ifdef __cplusplus andrewm@379: extern "C" { andrewm@379: #endif andrewm@379: andrewm@379: /////////////////////////// andrewm@379: // function prototypes: andrewm@379: /////////////////////////// andrewm@379: andrewm@379: /* function pointers*/ andrewm@379: extern void (*ne10_physics_compute_aabb_vec2f) (ne10_mat2x2f_t *aabb, andrewm@379: ne10_vec2f_t *vertices, andrewm@379: ne10_mat2x2f_t *xf, andrewm@379: ne10_vec2f_t *radius, andrewm@379: ne10_uint32_t vertex_count); andrewm@379: extern void (*ne10_physics_relative_v_vec2f) (ne10_vec2f_t *dv, andrewm@379: ne10_vec3f_t *v_wa, andrewm@379: ne10_vec2f_t *ra, andrewm@379: ne10_vec3f_t *v_wb, andrewm@379: ne10_vec2f_t *rb, andrewm@379: ne10_uint32_t count); andrewm@379: extern void (*ne10_physics_apply_impulse_vec2f) (ne10_vec3f_t *v_wa, andrewm@379: ne10_vec3f_t *v_wb, andrewm@379: ne10_vec2f_t *ra, andrewm@379: ne10_vec2f_t *rb, andrewm@379: ne10_vec2f_t *ima, andrewm@379: ne10_vec2f_t *imb, andrewm@379: ne10_vec2f_t *p, andrewm@379: ne10_uint32_t count); andrewm@379: andrewm@379: /* C version*/ andrewm@379: extern void ne10_physics_compute_aabb_vec2f_c (ne10_mat2x2f_t *aabb, andrewm@379: ne10_vec2f_t *vertices, andrewm@379: ne10_mat2x2f_t *xf, andrewm@379: ne10_vec2f_t *radius, andrewm@379: ne10_uint32_t vertex_count); andrewm@379: extern void ne10_physics_relative_v_vec2f_c (ne10_vec2f_t *dv, andrewm@379: ne10_vec3f_t *v_wa, andrewm@379: ne10_vec2f_t *ra, andrewm@379: ne10_vec3f_t *v_wb, andrewm@379: ne10_vec2f_t *rb, andrewm@379: ne10_uint32_t count); andrewm@379: extern void ne10_physics_apply_impulse_vec2f_c (ne10_vec3f_t *v_wa, andrewm@379: ne10_vec3f_t *v_wb, andrewm@379: ne10_vec2f_t *ra, andrewm@379: ne10_vec2f_t *rb, andrewm@379: ne10_vec2f_t *ima, andrewm@379: ne10_vec2f_t *imb, andrewm@379: ne10_vec2f_t *p, andrewm@379: ne10_uint32_t count); andrewm@379: andrewm@379: /* NEON version*/ andrewm@379: /** andrewm@379: * @addtogroup COLLISION_DETECT andrewm@379: * @{ andrewm@379: */ andrewm@379: #ifdef ENABLE_NE10_PHYSICS_COMPUTE_AABB_VEC2F_NEON andrewm@379: extern void ne10_physics_compute_aabb_vec2f_neon (ne10_mat2x2f_t *aabb, andrewm@379: ne10_vec2f_t *vertices, andrewm@379: ne10_mat2x2f_t *xf, andrewm@379: ne10_vec2f_t *radius, andrewm@379: ne10_uint32_t vertex_count); andrewm@379: #endif // ENABLE_NE10_PHYSICS_COMPUTE_AABB_VEC2F_NEON andrewm@379: andrewm@379: #ifdef ENABLE_NE10_PHYSICS_RELATIVE_V_VEC2F_NEON andrewm@379: extern void ne10_physics_relative_v_vec2f_neon (ne10_vec2f_t *dv, andrewm@379: ne10_vec3f_t *v_wa, andrewm@379: ne10_vec2f_t *ra, andrewm@379: ne10_vec3f_t *v_wb, andrewm@379: ne10_vec2f_t *rb, andrewm@379: ne10_uint32_t count) andrewm@379: asm ("ne10_physics_relative_v_vec2f_neon"); andrewm@379: #endif // ENABLE_NE10_PHYSICS_RELATIVE_V_VEC2F_NEON andrewm@379: andrewm@379: #ifdef ENABLE_NE10_PHYSICS_APPLY_IMPULSE_VEC2F_NEON andrewm@379: extern void ne10_physics_apply_impulse_vec2f_neon (ne10_vec3f_t *v_wa, andrewm@379: ne10_vec3f_t *v_wb, andrewm@379: ne10_vec2f_t *ra, andrewm@379: ne10_vec2f_t *rb, andrewm@379: ne10_vec2f_t *ima, andrewm@379: ne10_vec2f_t *imb, andrewm@379: ne10_vec2f_t *p, andrewm@379: ne10_uint32_t count) andrewm@379: asm ("ne10_physics_apply_impulse_vec2f_neon"); andrewm@379: #endif // ENABLE_NE10_PHYSICS_APPLY_IMPULSE_VEC2F_NEON andrewm@379: /** andrewm@379: * @} end of COLLISION_DETECT group andrewm@379: */ andrewm@379: andrewm@379: andrewm@379: #ifdef __cplusplus andrewm@379: } andrewm@379: #endif andrewm@379: andrewm@379: #endif