asking setLinearVelocity overload

luis

01-02-2007 20:38:16

looking at the code in Body:

void body::setLinearVelocity(Ogre::Vector3 direction, Ogre::Real velocity) {
NxVec3 vel = NxTools::convert(direction);
vel.normalize();
vel *= velocity;
mActor->setLinearVelocity(vel);
}


i dont see the point of normalize and then multiply with the lenght, since the normalize isn't free in the CPU......
would be good to have something like:

void body::setLinearVelocity(Ogre::Vector3 velocity) {
NxVec3 vel = NxTools::convert(velocity);
mActor->setLinearVelocity(vel);
}

luis

01-02-2007 20:51:50

and this function would be also helpful:

Ogre::Vector3 body::getLinearVelocity() {
return NxTools::convert(mActor->getLinearVelocity());
}


thanks !

betajaen

01-02-2007 20:56:23

Because I prefer it that way ;)

I'll add a second option to take a direct vector like you said, and I just copied and pasted your second post code into NxOgre.

Meanwhile back to Ununhexium. :evil:

luis

02-02-2007 08:14:01

Meanwhile back to Ununhexium.
:) are you studying chemistry or just curious ?

edit:
I'll add a second option to take a direct vector like you said, and I just copied and pasted your second post code into NxOgre.

i forget to say thanks !!

betajaen

02-02-2007 08:56:48

Sort of. After my experiences with NxOgre, last September I decided to abandon my Masters Degree in Software Engineering, and start a whole new career. So I'm doing a Physics Degree now, at the moment I'm studying a 6 months "Welcome to Science" module which basically covers everything, this month it's all chemistry. Then I get into the good bits of Physics afterwards.

I can say one thing - I never want to see a Chemistry book ever again! :D