[Bleeding] wheel creation bug

BloodyFanatic

27-12-2007 21:10:02

after updating to the newest nxogre, i noticed that my car accelerates way too fast. after a hour or so i figured out that the inverted wheel mass wasn't correct (and also any other definded params!)

somewhere in this code snippet gone wrong...

NxOgre::Wheel *w = static_cast<NxOgre::Wheel*>
( mBody->addShape ( new NxOgre::WheelShape ( radius, sp, wp, nrp ) ) );

Real invMass = w->getNxWheelShape()->getInverseWheelMass();


inverted wheel mass is 0.1 beforehand, but 1. ( default?) afterwards... it is definitively not my fault, because it had worked flawlessly with 0.9-38.

other params are also set to their defaults ( assumed, i tested only a few which has this problem )

please fix it.. i'd try to do it myself, but right now i need to sleep.

betajaen

27-12-2007 22:53:43

Thanks for the heads up. I'll try and remember put it in when I implement the wheel class into the next bleeding again.

BloodyFanatic

28-12-2007 11:24:09

ok, i thing i found the reason:
file: NxOgreShapeBlueprintWheel.cpp

Shape* WheelShape::_bindToNxActor(Actor* actor, NxShapeIndex id) {

__paramsToDescription(mShapeDescription, mParams, actor->getScene());

Wheel* wheel = new Wheel(*this, wheelParams, renderableParams, actor); //(2)

actor->mDynamicCollisionModel.insert(actor->mDynamicCollisionModel.count(), wheel);
actor->mCollisionModel.insert(id, wheel);
actor->mCollisionModel.lock(id, true);

NxShape* s = actor->getNxActor()->createShape(mShapeDescription); //(1)

wheel->_bindNxShapeToShape(s);

return wheel;
}

reason: the wrong mShapeDescription (has only default values) is used in (1). the beforehand created NxOgre::Wheel (2) has the correct mShapeDescription :roll:
solution: none so far. i don't know how to access the correct one...

BloodyFanatic

28-12-2007 12:01:24

yay, fixed :)

the fix itself is soo simple... 2 &^^

one here:

Wheel::Wheel(WheelShape& ws, WheelParams params, NodeRenderableParams visualParams, Actor* actor)
: Shape(actor), mWheelRollAngle(0) {

and the other here:

Wheel(WheelShape&, WheelParams, NodeRenderableParams, Actor*);

files are NxOgreShapeWheel.h & .cpp

PS: your code is quite confusing :wink:

betajaen

28-12-2007 13:54:14

It is confusing. That's why I've been replacing the entire shape system with something better. I call it.

"The New Shape System".

;)

BloodyFanatic

28-12-2007 15:06:07

It is confusing. That's why I've been replacing the entire shape system with something better. I call it.

"The New Shape System".

;)


sounds cool ;) but when can we expect it? ^^