Physics Engine Development - C++ vs. OOP in Matlab
11 次查看(过去 30 天)
显示 更早的评论
Recently I've been interested in implementing a top-down physics engine for a group of differential robots, all inside Matlab. The thing is, there is a lot of additional computations that I want to do apart from the physics simulations asociated with the engine. However, after looking a little bit into it, its obvious that a physics engine will hog a lot of the computational resources available, in particular if you use object oriented programming to implement physical entities (Given that OOP in Matlab is relatively slow). A possible solution that came to mind was to code the physics engine in C++ and then import the .cpp file to Matlab. However, I don't know if this will result in a better performance or the possible performance gains would be undermined by the additional processing required to parse a .cpp file.
I tried a physics engine called "CapSim" and it runs too slow for my liking.
Thanks in advance!
2 个评论
James Tursa
2020-7-9
I suggest you code up a small C++ example that does something you will need and see how you like the performance. It is hard to advise you without knowing all of the things your physics engine will be doing.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robotics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!