Hi,
I found that after scale some entity's parentscenenode, there will be position error occured. That is, the wire frame parsed by ogreNewt will be away from the entity's rendered image, after translation. How to solve this problem?
By the way, how to paste an image? So that will be more intuitive.
1) you should scale first, then let it parse. if you have to scale afterwards, you should update the collision, too.
2) you should move the newton body, not the scenenode. and if you want to simulate movement, you should add forces/velocity instead of translating it
Let me explain some detail. I have a xml-like file format to read, and it contains the infomation to adjust those entities. For examle:
<entity name="Box1" filename="Box1.mesh" hidden="false" CastShadows="true">
<position x="39.725" y="15.1489" z="147.065" />
<rotation w="-1" x="0" y="0" z="0" />
<scale x="1" y="1" z="1" />
</entity>
and then:
sn.SetPosition(...);
sn.SetOritation(...);
sn.SetScale(...);
I create my scene graph like this, then parse the phisical scene:
MogreNewt.CollisionPrimitives.TreeCollisionSceneParser colTree =
new MogreNewt.CollisionPrimitives.TreeCollisionSceneParse(mWorld);
colTree.parseScene(physicalRoot, true);
MogreNewt.Body body = new MogreNewt.Body(mWorld, colTree);
colTree.Dispose();
body.attachToNode(physicalRoot);
body.setMaterialGroupID(geometryID);
while, I choosed the MogreNewt, but I dont think that does matters. And the scaled nodes will display wrong. Is there something wrong with my code?
walaber
17-06-2007 04:56:16
this was very recently fixed... Mogre is probably not updated to the latest version of OgreNewt yet.