Exporting Models in Blender with the correct Rotation

aherber

Member
Contributor
Architecture
Im having some Problems to understand how i have to export my models out of blender so that when i am using the mesh with a collsion shape the rotation of the mesh fits the rotation of the collision shape.
I know that i can define the axis for the up and forward vector in blender when i export the model but for some reason the rotation of the model is alway different than the rotation of the collision shape. So is it possible that Blender and Bullet are using different rules (left and rigth hand rules ) for the coordinate system ? What are the standard up and forward axis for the collsion shapes in bullet ? In the Code i see that when the CollisonShape is created we use
new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), pos, 1.0f)); to define the starttranform of the collsion shape. So i assumed that the rotation of the exported Model needs to be equal to the starttransform of the collsion shape or am i wrong. Thanks for your help.
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
Most collision shapes do not rotate with the mesh (sphere, obviously, cylinder/capsule are always vertically aligned). I think the only ones that would are box and hull collision shapes - these should take rotation from the location component, same as the mesh. The hull just takes a mesh, so either the one you want collision for or create a simplified one - align it the same way in blender. Box would require knowing the axes the mesh fills when it has no rotation.

If this is not the observed behaviour then there is a bug.
 

aherber

Member
Contributor
Architecture
Thank you Immortius for the Information :) . It helps alot. I will use a simplified HullShape or the BoxShape for my Arrow and my other models then.
 
Top