Hi, all!
I found a problem with some objects where I need colliders composed of primitives and convex objects
and creating them in code started being problematic. I want to create collisions in Blender and have them in Ogre like I have in Godot.
Is there some people who solved this problem? https://www.khronos.org/assets/uploads/ ... cs_BOF.pdf
I guess custom python script which will additionally export collider meshes and empties as primitives as separate entities is way to go as Ogre does not support decompositing of imported gltf. Also I think external tool like python meshviewer could have this function... @paroj ?
collision shapes pipeline and gltf
-
slapin
- Bronze Sponsor

- Posts: 250
- Joined: Fri May 23, 2025 5:04 pm
- x 16
collision shapes pipeline and gltf
-
sercero
- Bronze Sponsor

- Posts: 535
- Joined: Sun Jan 18, 2015 4:20 pm
- Location: Buenos Aires, Argentina
- x 198
Re: collision shapes pipeline and gltf
Hello,
Have you seen this?
viewtopic.php?t=68588
I'm using that class (MeshStrider) that someone made to convert from OGRE Mesh to a "custom" bullet collider.
You have to be careful with the Mesh, it has to be convex and also be careful when exporting from blender the shading should be smooth (to avoid duplicate vertices) and have no materials attached.
Also, have you read this?
https://github.com/OGRECave/blender2ogr ... Physics.md
Best regards.
-
paroj
- OGRE Team Member

- Posts: 2238
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1217
Re: collision shapes pipeline and gltf
regarding gltf, you can extend the importer to load the collision shape into userAny:
https://ogrecave.github.io/ogre/api/14/ ... 84ce85ad62
that is, if you can get that passed through assimp.
Also there is:
https://ogrecave.github.io/ogre/api/14/ ... d7545214f5
which could be (ab)used to store collision data.
-
slapin
- Bronze Sponsor

- Posts: 250
- Joined: Fri May 23, 2025 5:04 pm
- x 16
Re: collision shapes pipeline and gltf
paroj wrote: Fri Sep 19, 2025 1:23 pmregarding gltf, you can extend the importer to load the collision shape into userAny:
https://ogrecave.github.io/ogre/api/14/ ... 84ce85ad62that is, if you can get that passed through assimp.
Also there is:
https://ogrecave.github.io/ogre/api/14/ ... d7545214f5which could be (ab)used to store collision data.
Sounds like lots of work and requirement for conversion tool which would split-out collider meshes (which might be a few). Looks too complicated at the moment. Having this in mind I found blender2ogre approach more workable but I have to export every mesh+scene 3 times.
The problem is also I need attachment points. the .scene which blender2ogre supports can create nodes which is good, I completely forgot why I prefer gltf (right I know the file size and generally less problems). So now I have 3 issues to solve:
- Attachment points. I realized that I don't need much physics between characters and vehicle they are on so it is much easier to disable physics for character, attach it to a point and let root motion do the thing. The vehicle physics remain and requires much less from collider (can be generated convex hull). I could even use bones for things like this but that might end up not too well if numbers get large...
- Colliders for more complex cases where convex hull won't look realistic enough in physics simulation (i.e flatbed truck) which I want to be composed from
primitives or convex hulls. This can be done with blender export script using empties or specially crafted meshes which could be used as source for collider creation in OgreBullet. The problem is how can I automate that.
I try to find approach which will work with batch processing. I think C++ code or Lua script should be generated to create whole thing as .scene does not support physics.
I was hoping there were some physics shape export scripts somewhere for Blender but found none... Just time to reinvent another wheel...
-
slapin
- Bronze Sponsor

- Posts: 250
- Joined: Fri May 23, 2025 5:04 pm
- x 16
Re: collision shapes pipeline and gltf
Looks like for characters the gltf method will do, for vehicles and static objects like buildings the .scene approach works better as supports logic and metadata. I just have physics meshes as children and create compound collider after I load the scene. The problem is still I have to load then unload them...
-
slapin
- Bronze Sponsor

- Posts: 250
- Joined: Fri May 23, 2025 5:04 pm
- x 16
Re: collision shapes pipeline and gltf
sercero wrote: Fri Sep 19, 2025 12:48 pmHello,
Have you seen this?
viewtopic.php?t=68588
I'm using that class (MeshStrider) that someone made to convert from OGRE Mesh to a "custom" bullet collider.You have to be careful with the Mesh, it has to be convex and also be careful when exporting from blender the shading should be smooth (to avoid duplicate vertices) and have no materials attached.
Also, have you read this?
https://github.com/OGRECave/blender2ogr ... Physics.mdBest regards.
I did not see MeshStrider, but I seen https://github.com/OGRECave/blender2ogr ... Physics.md which lacks practical advice.
The problem is not only making collision shapes but also effectively getting them into engine without messing things up.
Things are relatively simple for cases when you can generate the collider, but when you just need to make separate mesh are complex because that requires tools support for
- Separate physics mesh from normal mesh for it to not consume GPU memory and require no manipulation.
- Compound shapes require transforms, so scene position information is needed.
No tools support that so whole process looks ugly. I think the process should look like this: - In blender with normal model there are additional data which can be Empties, Meshes, User props which when exported produce .scene or .gltf
- When that thing loaded the software knows which colliders and how they are created. The most important here is control as automatic generation can produce too detailed meshes. Neither scene approach nor gltf approach can solve it.
- The more complex scene becomes the more important it gets to have design control over it. Tools are needed.
-
sercero
- Bronze Sponsor

- Posts: 535
- Joined: Sun Jan 18, 2015 4:20 pm
- Location: Buenos Aires, Argentina
- x 198
Re: collision shapes pipeline and gltf
slapin wrote: Fri Sep 19, 2025 5:17 pmI did not see MeshStrider, but I seen https://github.com/OGRECave/blender2ogr ... Physics.md which lacks practical advice.
The problem is not only making collision shapes but also effectively getting them into engine without messing things up.
Things are relatively simple for cases when you can generate the collider, but when you just need to make separate mesh are complex because that requires tools support for
- Separate physics mesh from normal mesh for it to not consume GPU memory and require no manipulation.
- Compound shapes require transforms, so scene position information is needed.
No tools support that so whole process looks ugly. I think the process should look like this:- In blender with normal model there are additional data which can be Empties, Meshes, User props which when exported produce .scene or .gltf
- When that thing loaded the software knows which colliders and how they are created. The most important here is control as automatic generation can produce too detailed meshes. Neither scene approach nor gltf approach can solve it.
- The more complex scene becomes the more important it gets to have design control over it. Tools are needed.
It looks like you need to customize DotScene and also how blender export things.
There is a lot of old code in blender2ogre regarding export of physics.
The idea is to export the mesh but you can also specify that the node has a collider associated with it (be it a shape or a mesh) so that the location of the collider coincides with the visual mesh.
I think all of that is now commented since the Blender guys removed the game engine from Blender istelf in 2.8.
You can check the scene.py python script of blender2ogre to see if there are things useful for you.
-
slapin
- Bronze Sponsor

- Posts: 250
- Joined: Fri May 23, 2025 5:04 pm
- x 16
Re: collision shapes pipeline and gltf
Yes, I did some customization. However I found no code to implement OgreBullet side of loading the colliders in older projects...
I found some code to export physics mesh in blender2ogre but it doesn't work so I guess I have to add some custom code there.
I think that scene xml should not make entities out of physics meshes but mark them as userData in top level or marked parent node,
and I see some part of code like that in blender2ogre but I failed to make it work...