資源簡介
基于距離跟蹤的Gilbert-Johnson-Keerth(簡稱GJK)碰撞算法是通過支持映射來計(jì)算空間中兩個凸體間距的漸進(jìn)算法,雖然其數(shù)學(xué)模型比較復(fù)雜,且難以理解,但是基于GJK模型的算法有快速,易實(shí)施且適用于多種凸體的優(yōu)點(diǎn)。這個c程序代碼很實(shí)用!
代碼片段和文件信息
#include?“gjk.h“
/*
?*?Implementation?of?the?Gilbert?Johnson?and?Keerthi?routine?to?compute
?*?the?minimum?distance?between?two?convex?polyhedra.
?*
?*?Version?2.4?July?1998?(c)?Stephen?Cameron?1996?1997?1998
?*
?*/
/*?The?code?uses?some?tables?that?essentially?encode?the?constant
???topology?of?simplices?in?DIM-dimensional?space.??The?original
???version?of?this?program?did?this?by?constructing?the?tables
???each?time?the?code?was?activated?(but?not?once?per?run?of?gjk_distance!).
???In?this?version?of?the?code?we?can?define?the?constant?USE_CONST_TABLES
???to?use?pre-defined?versions?of?these?tables?instead.
???Not?defining?USE_CONST_TABLES?makes?the?code?behave?as?before.??This
???takes?around?5000?integer?operations?at?code?initialisation?when
???DIM==3.
???Defining?USE_CONST_
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????33939??2007-02-18?02:24??GJK算法的c程序?qū)崿F(xiàn)\gjk.c
?????文件??????14997??2007-02-18?02:24??GJK算法的c程序?qū)崿F(xiàn)\gjk.h
?????文件??????32459??2007-02-18?02:24??GJK算法的c程序?qū)崿F(xiàn)\gjkdemo.c
?????文件????????481??2007-02-18?02:24??GJK算法的c程序?qū)崿F(xiàn)\Makefile.txt
?????文件???????5996??2007-02-18?02:24??GJK算法的c程序?qū)崿F(xiàn)\Readme.txt
?????文件???????8173??2007-02-18?02:24??GJK算法的c程序?qū)崿F(xiàn)\sac.c
?????目錄??????????0??2011-05-23?11:26??GJK算法的c程序?qū)崿F(xiàn)
-----------?---------??----------?-----??----
????????????????96045????????????????????7
評論
共有 條評論