I used Blender, created a new castle from boxes, and exported it to the Three.js format. If you set the mass to 0 of a CANNON.Body, it remains static. This worked out perfectly...推荐答案这取决于您的模型的物理表示应该有多精确.我对 cannon.js 不是很熟悉,但这里有一些我知道的选项:Well it depends on how exact the physical representatin of your model should be. I'm not very familiar with cannon.js, but here are some options I know:在您的塔上使用computeBoundingBox"并使用这些边界创建一个 cannon.js 框以类似的方式使用computeBoundingSphere"将物理用于凹面(即任意)网格.这是最消耗性能的方式.Cannon.js 有一个例子:http://schteppe.github.io/cannon.js/demos/bunny.html非 cannon.js 相关的方法是例如使用重铸.Recast 会为您加载 .obj 文件并根据您的设置为您创建导航网格.然后你可以在那里四处走走(如果你有像游戏一样的 RTS 鸟瞰图,或者跑来跑去的机器人,那就太好了).可以在此处找到重铸的 javascript 端口:https://github.com/vincent/recast.jsA non cannon.js related approach would be to e.g. use Recast. Recast would load your .obj file for you and create a navigation mesh for you according to your settings. Then you could walk around there (absolutely great if you have a RTS birdview like game, or bots running around). A recast javascript port can be found here: https://github.com/vincent/recast.js希望这有帮助! 这篇关于从 THREE.Mesh 或 THREE.Geometry 创建 CANNON.RigidBody的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-10 02:09