bugs for old 7st september 2006 SDK. [Fixed]

hcs

18-09-2006 13:46:58

in SDK : 7st september 2006.

- in OgreOdeVehicle.cpp between line 631 and 632 missing this statement:
pObject = (PrefabObject*) geom->getUserObject();

- in OgreOdeEntityInformer.cpp line 144, if usOffset is short typed then
it there will be an owrflow when vertex count reach the 64k limit (because offset is int),
so usOffset must be unsigned int too

tuan kuranes

18-09-2006 14:28:42

Thanks a lot, fixed the indeed very well spotted first bug.

Second needs some thought, as we cannot accepts a offset > 64 in this case, as we're in the 16 bits index buffer case. What we can do is add either an assert or an exception, the latter being the better imho.
What do you think ?

hcs

19-09-2006 11:27:27

ODE uses int type for trimesh indexing, so its >= 32 bit, and our index buffer is is int* too. anyway, I tried that solution what I've suggested and it works.

tuan kuranes

19-09-2006 13:46:42

You're right. I forgot that opcode only supports unsigned int indices. I'll make that change asap. thanks a lot.

syedhs

21-09-2006 13:12:28

How about this:

Creating a static box collision doesn't take into account the size (scale) applied to the SceneNode. The change I applied is very simple:

OgreOdeEntityInformer.cpp (method createSingleStaticBox)
originally was

BoxGeometry* geom = new BoxGeometry(getSize(),space);

now changed to:

BoxGeometry* geom = new BoxGeometry(getSize()*_node->getScale(),space);

tuan kuranes

21-09-2006 13:21:14

not sure about that one shouldn't you provide transforms when you provide the entity ?

addEntity(Entity *entity, const Matrix4 &transform)

the second parameter is identity when not provided.

syedhs

21-09-2006 13:28:58

Yes originally I supplied the second parameter (transform) but the problem is the rotation is not right - it uses the original rotation. I have managed to reproduce it many times :lol: But maybe the fix can be done elsewhere but this is a problem occured so far only to StaticBox. I am no sure about the rest but the statictrimeshes were fine.

Edit: To make things clearer, I was not using addEntity.. the code look like below:-

OgreOde::EntityInformer ei(entity /*, node->_getFullTransform()*/);
geom = ei.createSingleStaticBox(mWorld->getDefaultSpace());

tuan kuranes

21-09-2006 13:34:23

Ok, added the fix.

syedhs

21-09-2006 13:40:32

On second thought, the code does not look clean although it does solve the problem. Because in order to use createSingleStaticBox, one has to omit the transform in EntityInformer constructor whereas it is needed in other cases. What do you think..?

tuan kuranes

21-09-2006 13:50:58

that's the problem...
Are you sure you cannot give it as original transform ? how you did it ?

syedhs

21-09-2006 14:17:56

I think I will have to take my time and relook into this problem; but definitely the collision transformation is okay if i used trimesh instead of BoxGeometry. I think you can easily reproduce the same problem. I will post again once I get the time to look at this problem.