ODE仿真引擎使用(二)

  新建C++空项目

  1、ode相关头文件加入工程文件中
属性->配置属性->C/C++ ->常规->附加包含目录 :

 
ODE仿真引擎使用(二)

D:ODEode-0.16include

D:ODEode-0.16odesrc

D:ODEode-0.16odedemo

这三个都得添加

  2、引入 ode 依赖的库文件 ode_doubled.lib, drawstuffd.lib
属性->配置属性->链接器->输入->附加依赖项:

 
ODE仿真引擎使用(二)

D:ODEode-0.16libDebugDoubleDLLode_doubled.lib
D:ODEode-0.16libDebugDoubleDLLdrawstuffd.lib
user32.lib
winmm.lib
gdi32.lib
opengl32.lib
glu32.lib

  3、加入预编译定义 dDOUBLE
属性->配置属性->C/C++ ->预处理器->预处理器定义->

 
ODE仿真引擎使用(二)

_MT
_DEBUG
dIDEDOUBLE
CCD_IDEDOUBLE
WIN32
_CRT_SECURE_NO_DEPRECATE
_SCL_SECURE_NO_WARNINGS
_USE_MATH_DEFINES

  4、资源文件设置

  对应的dll文件复制到C/windows/sys32 or sysWOW64
  Drawstuffd.dll
  ode_doubled.dll

  #include "texturepath.h"
  头文件里面对应的位置F:/ODE/drawstuff/textures

  A typical simulation will proceed like this:

  • Create a dynamics world.
  • Create bodies in the dynamics world.
  • Set the state (position etc) of all bodies.
  • Create joints in the dynamics world.
  • Attach the joints to the bodies.
  • Set the parameters of all joints.
  • Create a collision world and collision geometry objects, as necessary.
  • Create a joint group to hold the contact joints.
  • Loop:
  • •     Apply forces to the bodies as necessary.
  • •     Adjust the joint parameters as necessary.
  • •     Call collision detection.
  • •     Create a contact joint for every collision point, and put it in the contact joint group.
  • •     Take a simulation step.
  • •     Remove all joints in the contact joint group.
  • Destroy the dynamics and collision worlds.

原文链接: https://www.cnblogs.com/zhaochenliang/p/12267072.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍;

也有高质量的技术群,里面有嵌入式、搜广推等BAT大佬

    ODE仿真引擎使用(二)

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/327303

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年3月1日 下午4:12
下一篇 2023年3月1日 下午4:13

相关推荐