I know...right. I wasn't trying to start any problem, I just thought the tiger might be interested in knowing. I don't think SIO did anything wrong or I would've had said so in my original post. I had been looking at IrrSpintz and was thinking about whether a newton wrapper was going to be ported or possibly doing it myself anyway. It is a good thing and I don't think the tiger has a problem with it, unless it continues with childish bickering.......BlindSide wrote:Stop this childish bickering at once....lol
IrrNewt irrlicht\newton framework >> SVN access
-
- Posts: 277
- Joined: Thu Dec 15, 2005 6:11 pm
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
you're right. try to fix itI guess what I'm asking is are the "newton::ICar->turnRight();" and "newton::ICar->turnLeft();" functions framerate independant?
create a simple vehicle (IWorld::createVechicleSimple()) add the tires you want (IVechileSimple::addTire()) and rotate (setOmega) or move (setTorque) every tire you want manuallyAlso, while I'm here, how would I make a vehicle have more than 4 wheels? I want to make a tank and I want it to have 8 wheels (4 on each side) so that it reacts realistically. And if it's possible, instead of turning the front two wheels to steer, i want to be able to make the wheels on the left side turn separately to the ones on the right side.
-
- Posts: 157
- Joined: Tue Mar 20, 2007 8:30 am
Done and done...I think...
I changed the turnLeft(), turnRight() and noTurn() functions so that the number passed to addSteerAngle() is multiplied by IWorld->getTimeElapsed(). I know it seems obvious to change addSteerAngle() rather than those 3, but I couldn't get IWorld from IVehicleTire, there's probably a way, but I just can't figure it out at the moment
Those functions look a bit like this now, and I also fixed them up so turnLeft() actually turns left and turnRight() actually turns right
EDIT EDIT: Fixed it, changed the noTurn function to the one above and the larger numbers I have to use for steer_angle_increment work fine. I'll work on having 8 wheels later (it seems simple enough to do, just do what you said and use some custom fuctions for turning), I want to put a small vehicle demo together first, think a skate park, but with a little box-car
Thanks for your help
I changed the turnLeft(), turnRight() and noTurn() functions so that the number passed to addSteerAngle() is multiplied by IWorld->getTimeElapsed(). I know it seems obvious to change addSteerAngle() rather than those 3, but I couldn't get IWorld from IVehicleTire, there's probably a way, but I just can't figure it out at the moment
Those functions look a bit like this now, and I also fixed them up so turnLeft() actually turns left and turnRight() actually turns right
Code: Select all
inline void turnRight() {
//this->fr_tire->addSteerAngle(-this->steer_angle_increment);
this->fr_tire->addSteerAngle(this->steer_angle_increment * this->getChassis()->getWorld()->getTimeElapsed());
this->fl_tire->addSteerAngle(this->steer_angle_increment * this->getChassis()->getWorld()->getTimeElapsed());
}
inline void turnLeft() {
//this->fr_tire->addSteerAngle(this->steer_angle_increment);
this->fr_tire->addSteerAngle(-this->steer_angle_increment * this->getChassis()->getWorld()->getTimeElapsed());
this->fl_tire->addSteerAngle(-this->steer_angle_increment * this->getChassis()->getWorld()->getTimeElapsed());
}
//set steer angle gradually to 0. how gradually depends on steer angle increment
inline void noTurn() {
irr::f32 steer = this->getFRTire()->getSteerAngle();
if(steer<0)
{
steer = this->steer_angle_increment;
}
else if(steer>0)
{
steer = -this->steer_angle_increment;
}
steer *= this->getChassis()->getWorld()->getTimeElapsed();
this->fr_tire->addSteerAngle(steer);
this->fl_tire->addSteerAngle(steer);
}
Thanks for your help
Tell me what you cherish most. Give me the pleasure of taking it away.
-
- Posts: 157
- Joined: Tue Mar 20, 2007 8:30 am
I'm still working on my little vehicle demo at the moment, I'm just trying to make it a little more interesting that just hitting a few jumps by adding a height, distance and time in air meter.
The only problem is that the IVehicleTire::isAirborne() function returned 0 whether the tire was on the ground or not. I had a look at the source code but I couldn't find a way to fix it, so I went to newton and found the NewtonVehicleTireIsAirBorne() function, and thanks to ICcar::getNewtonJoint() and IVehicleTire::getNewtonTireID() I've got a working isAirborne() function that looks like this (it checks if all 4 wheels of the ICar are airborne):
Also, is there any chance that there's going to be an IrrNewt 0.4 any time in the future? Or is there nothing left worth adding?
The only problem is that the IVehicleTire::isAirborne() function returned 0 whether the tire was on the ground or not. I had a look at the source code but I couldn't find a way to fix it, so I went to newton and found the NewtonVehicleTireIsAirBorne() function, and thanks to ICcar::getNewtonJoint() and IVehicleTire::getNewtonTireID() I've got a working isAirborne() function that looks like this (it checks if all 4 wheels of the ICar are airborne):
Code: Select all
bool isAirborne(newton::ICar* carBody)
{
if (NewtonVehicleTireIsAirBorne(carBody->getNewtonJoint(), carBody->getFRTire()->getNewtonTireId()) == false)
{
return false;
}
if (NewtonVehicleTireIsAirBorne(carBody->getNewtonJoint(), carBody->getFLTire()->getNewtonTireId()) == false)
{
return false;
}
if (NewtonVehicleTireIsAirBorne(carBody->getNewtonJoint(), carBody->getBRTire()->getNewtonTireId()) == false)
{
return false;
}
if (NewtonVehicleTireIsAirBorne(carBody->getNewtonJoint(), carBody->getBLTire()->getNewtonTireId()) == false)
{
return false;
}
return true;
}
Tell me what you cherish most. Give me the pleasure of taking it away.
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
Thanks for the pathes
For the first path that make turnLeft and turnRight frame rate indipendet i'm agree nad put it in the next release
for the last patch i don't agree with you. If you take a look at Newton documentation for NewtonVehicleTireIsAirBorne , it says
I don't know if it is bugged, but it should be called there
For the first path that make turnLeft and turnRight frame rate indipendet i'm agree nad put it in the next release
for the last patch i don't agree with you. If you take a look at Newton documentation for NewtonVehicleTireIsAirBorne , it says
in fact IrrNewt calls it in irr::newton::Hidden::VehicleTireCallBack. You don't call this function in the tire callback, so I think that maybe this is not good solution?This function can only be called from the vehicle update call back. It can be used by the application to generate the custom vehicle dynamics.
I don't know if it is bugged, but it should be called there
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
i've added ragdoll , compound collision (by re-write the code that create bodies to do this) and some minor adding (like speed up setScale).Also, is there any chance that there's going to be an IrrNewt 0.4 any time in the future? Or is there nothing left worth adding?
But I don't know when i'll release it. There is a bug now. I can't promise nothing. Also currently I don't have much time to work on this
-
- Posts: 157
- Joined: Tue Mar 20, 2007 8:30 am
You're probably right, but it's working fine for me at the moment and that's all I wanted, a temporary solution is better than none at allwhite tiger wrote:for the last patch i don't agree with you. If you take a look at Newton documentation for NewtonVehicleTireIsAirBorne , it says
in fact IrrNewt calls it in irr::newton::Hidden::VehicleTireCallBack. You don't call this function in the tire callback, so I think that maybe this is not good solution?This function can only be called from the vehicle update call back. It can be used by the application to generate the custom vehicle dynamics.
I don't know if it is bugged, but it should be called there
And as for the first code, glad I could help out.
EDIT: There's also a small bug in the car example that I only picked up on recently. The following code gets the center of mass and multiplies the y by 0.5f, the problem is that centre_mass.Y is 0, so centre_mass.Y *= (0.5f*NewtonToIrr); is always going to be 0
Code: Select all
core::vector3df centre_mass = chassis_p_node->getCentreOfMass();
centre_mass.Y *= (0.5f*NewtonToIrr) ;
chassis_p_node->setCentreOfMass(centre_mass);
I figured it out when I was messing around with my car and noticed that changing that 0.5f to something else didn't make a difference. That and I noticed trying to lower the center of gravity was doing some wierd things to my car, so it's staying at core::vector3df(0.0f, 0.0f, 0.0f) for now...
Tell me what you cherish most. Give me the pleasure of taking it away.
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
I found the bug. Go in hidden.cpp, function VehicleTireCallBack, you'll find those lines
as you can see I forgot the breaks, so the default statement is always executed fix it now
Code: Select all
//is air borne
//warning if I cast an int into bool
switch(NewtonVehicleTireIsAirBorne(
tires[i]->n_vehicle,
tires[i]->tire_id)) {
case 1: tires[i]->is_air_borne = true;
default: tires[i]->is_air_borne = false;
}
i've taken it from the newton car exampleThe following code gets the center of mass and multiplies the y by 0.5f, the problem is that centre_mass.Y is 0, so centre_mass.Y *= (0.5f*NewtonToIrr); is always going to be 0
-
- Posts: 157
- Joined: Tue Mar 20, 2007 8:30 am
Ah, superb I was about to start writing my own method to do it via Newton, but having compound collision would be very useful, and saves me a lot of time (yes, it was compound collision I was thinking about, by the way, in my earlier post)compound collision (by re-write the code that create bodies to do this)
Thanks very much for implementing
-
- Posts: 85
- Joined: Mon Jun 11, 2007 11:22 am
- Location: Damascus - Syria
- Contact:
hey
where is the pre-compiled irrlicht 1.3 version?This version of IrrNewt is compiled using irrlicht 1.1, but you can compile
the source also for 1.3. go here
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=17698
for pre-compiled irrlicht 1.3 version
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
I think I won't release a 0.3 version compiled with 1.3, sorry. You can do that by yourself.where is the pre-compiled irrlicht 1.3 version?
You can simply compile it with 1.3. You need only the newton library and of course irrlicht 1.3. Also there are projects for vc++ and dev-c++ in the source\ dir
-
- Posts: 85
- Joined: Mon Jun 11, 2007 11:22 am
- Location: Damascus - Syria
- Contact:
thanx
why??????
I think I won't release a 0.3 version compiled with 1.3, sorry.
I tried to compile it, but it's not working. it needs the DirectX9 libraries and it need openGL libraries also. please if you can do that, please do it. cuz know that there is plenty of guys who wants to find it already compiled with Irrlicht 1.3 support.You can simply compile it with 1.3. You need only the newton library and of course irrlicht 1.3. Also there are projects for vc++ and dev-c++ in the source\ dir Wink
thanx
Re: thanx
There are some unnecessary #includes in IrrNewt code - I saw it when I tried to compile it with Irrlicht 1.3. I mean, compiller wanted me to give him glut header, but when I've commented line with this #include rest compilled succeesfully and now it worksbeshrkayali wrote:I tried to compile it, but it's not working. it needs the DirectX9 libraries and it need openGL libraries also. please if you can do that, please do it. cuz know that there is plenty of guys who wants to find it already compiled with Irrlicht 1.3 support.
thanx
To sum it, I don't have OpenGL libraries and I compilled IrrNewt, so I think you don't have to have DirectX 9 libraries to do it
According to topic - I really really enjoy using IrrNewt, and I like it. Thanks