码迷,mamicode.com
首页 > 其他好文 > 详细

ODE仿真引擎使用(二)

时间:2020-02-05 23:20:40      阅读:88      评论:0      收藏:0      [点我收藏+]

标签:ram   pos   min   lol   att   lib   win32   dep   crt   

  新建C++空项目

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

 
技术图片

D:\ODE\ode-0.16\include

D:\ODE\ode-0.16\ode\src

D:\ODE\ode-0.16\ode\demo

这三个都得添加

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

 
技术图片

D:\ODE\ode-0.16\lib\DebugDoubleDLL\ode_doubled.lib
D:\ODE\ode-0.16\lib\DebugDoubleDLL\drawstuffd.lib
user32.lib
winmm.lib
gdi32.lib
opengl32.lib
glu32.lib

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

 
技术图片

_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.

ODE仿真引擎使用(二)

标签:ram   pos   min   lol   att   lib   win32   dep   crt   

原文地址:https://www.cnblogs.com/zhaochenliang/p/12267072.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!