Skip to content

Commit

Permalink
fixed the problem in signed distance for the geometry shape. When sha…
Browse files Browse the repository at this point in the history
…pes are in collision, the distance call with signed distance enabled will return a pair of nearest points on the surface of objects
  • Loading branch information
panjia1983 committed Jan 4, 2017
1 parent 06d48b3 commit cd2c6a1
Show file tree
Hide file tree
Showing 13 changed files with 1,392 additions and 18 deletions.
50 changes: 50 additions & 0 deletions include/fcl/narrowphase/detail/convexity_based_algorithm/alloc.h
@@ -0,0 +1,50 @@
/***
* libccd
* ---------------------------------
* Copyright (c)2010 Daniel Fiser <danfis@danfis.cz>
*
*
* This file is part of libccd.
*
* Distributed under the OSI-approved BSD License (the "License");
* see accompanying file BDS-LICENSE for details or see
* <http://www.opensource.org/licenses/bsd-license.php>.
*
* This software is distributed WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the License for more information.
*/

#ifndef __CCD_ALLOC_H__
#define __CCD_ALLOC_H__

#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/**
* Functions and macros required for memory allocation.
*/

/* Memory allocation: */
#define __CCD_ALLOC_MEMORY(type, ptr_old, size) \
(type *)realloc((void *)ptr_old, (size))

/** Allocate memory for one element of type. */
#define CCD_ALLOC(type) \
__CCD_ALLOC_MEMORY(type, NULL, sizeof(type))

/** Allocate memory for array of elements of type type. */
#define CCD_ALLOC_ARR(type, num_elements) \
__CCD_ALLOC_MEMORY(type, NULL, sizeof(type) * (num_elements))

#define CCD_REALLOC_ARR(ptr, type, num_elements) \
__CCD_ALLOC_MEMORY(type, ptr, sizeof(type) * (num_elements))

#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

#endif /* __CCD_ALLOC_H__ */

0 comments on commit cd2c6a1

Please sign in to comment.