Implementation of Dave Gravel's raycast car

Share with us how are you using the powerrrr of the force

Moderator: Alain

Re: Implementation of Dave Gravel's raycast car

Postby Julio Jerez » Tue Jun 30, 2009 6:17 pm

Ok I can load teh demos know isther a way to navegate?
when I run teh test 17 I see teh car loaded, it falls down bu I do no see where it lad because I do not know how to move
I tryed few keys but nohing happens.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Implementation of Dave Gravel's raycast car

Postby VeT » Tue Jun 30, 2009 6:27 pm

open map101.c (as i remember), there are all car's code... it must obey you :D
maybe there is still old code, just replace car action with our last code
Code: Select all
action newton_car()
{
   NewtonBody* car_body = newton_addentity(me, 130, NEWTON_CONVEXHULL, onforceandtorque);

   float tire_offset[16] = {0,1,0,0,   0,0,1,0,   1,0,0,0,    0,0,0,1};
NewtonJoint* car_joint = DGRaycastVehicleCreate(4, tire_offset, car_body);

DGRaycastVehicleAddTire(car_joint,NULL,vector(5,-5,-1),   0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(5,5,-1) ,   0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(-5,5,-1),   0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(-5,-5,-1),   0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);
   
   while(me!=NULL)
   {   
      DGRaycastVehicleSetCustomTireTorque(car_joint,1,1500);
      DGRaycastVehicleSetCustomTireTorque(car_joint,0,1500);
     
      camera_func();
     
      wait(1);
   }
}


action - is the same as the function, but it can be applied in World Editor
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Implementation of Dave Gravel's raycast car

Postby Julio Jerez » Tue Jun 30, 2009 6:38 pm

Thsi si waht I see in fiel Map101.c

Code: Select all
action Newton_Car()
{
   int tireMass = 30;
   float suspensionLength = 0.25;
   float suspensionSpring =700.0;
   float suspensionShock = 60.0;
   float wheelradius = 0.4;
   float tirePin[3] = {0.0, 1.0, 0.0};
   D3DXMATRIX tire_offset;
   VECTOR tirepos;
   
   car = me;
   wait(3);
   
   NewtonBody* car_body = newton_addentity(me, 1000, NEWTON_CONVEXHULL, onforceandtorque);
//   NewtonBodySetAutoFreeze( car_body, 0);
   NewtonBodySetLinearDamping(car_body,0.005);
   
   float upDir[3] = {0.0, 0.0, 1.0};
   float frontDir[3] = {0.0, 0.0, 1.0};
//   NewtonJoint* car_joint = CreateCustomMultiBodyVehicle(frontDir[0], upDir[0], car_body);
   
   
   FLwheelPtr = ent_create("tekerlekL.mdl",nullvector,NULL);
   FRwheelPtr = ent_create("tekerlekR.mdl",nullvector,NULL);
   BLwheelPtr = ent_create("tekerlekL.mdl",nullvector,NULL);
   BRwheelPtr = ent_create("tekerlekR.mdl",nullvector,NULL);
}


The car is comneted oout and is is not right, is this old code?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Implementation of Dave Gravel's raycast car

Postby VeT » Tue Jun 30, 2009 6:40 pm

yes, of course... you'd need only last code
If you have any trouble with this, i can re-upload latest version

just select all text from file, delete, and copy there
Code: Select all
action Newton_Car()
{
   NewtonBody* car_body = newton_addentity(me, 130, NEWTON_CONVEXHULL, onforceandtorque);

   float tire_offset[16] = {0,1,0,0,   0,0,1,0,   1,0,0,0,    0,0,0,1};
NewtonJoint* car_joint = DGRaycastVehicleCreate(4, tire_offset, car_body);

DGRaycastVehicleAddTire(car_joint,NULL,vector(5,-5,-1),   0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(5,5,-1) ,   0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(-5,5,-1),   0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);
DGRaycastVehicleAddTire(car_joint,NULL,vector(-5,-5,-1),   0.5, 0.1, 1, 0.1, 0.25, 70, 5, 1);
   
   while(me!=NULL)
   {   
      DGRaycastVehicleSetCustomTireTorque(car_joint,1,1500);
      DGRaycastVehicleSetCustomTireTorque(car_joint,0,1500);
     
      camera_func();
     
      wait(1);
   }
}
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Implementation of Dave Gravel's raycast car

Postby Julio Jerez » Tue Jun 30, 2009 6:43 pm

When I paste you new funtion I get an error Crash in Newton_addentity
and if I continue I get more Crash in funtion camera_func.
can you upload a version that is working withe correct script?

Test it before you load it.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Implementation of Dave Gravel's raycast car

Postby VeT » Tue Jun 30, 2009 6:47 pm

ahh, you're right :)
wait a moment
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Implementation of Dave Gravel's raycast car

Postby VeT » Tue Jun 30, 2009 6:55 pm

new version is uploading, this one works from temp directory from my notebook and from temp directory from my computer

http://rapidshare.com/files/250481355/temp.rar.html - here it is
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Implementation of Dave Gravel's raycast car

Postby VeT » Tue Jun 30, 2009 6:58 pm

you can freely delete all commented code, somewhere i leave it just for testing different despair combinations :)
the main structure of the code is the same as in examples: creation of body, car joint, wheels, camera and TireTorque in loop
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Implementation of Dave Gravel's raycast car

Postby Julio Jerez » Tue Jun 30, 2009 7:08 pm

Ok I will try tonight, see what I can find out
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Implementation of Dave Gravel's raycast car

Postby VeT » Tue Jun 30, 2009 7:12 pm

is this started okay?

i believe in you :)
i lost a lot of time, guessing... maybe you'll deal with it
good luck :)
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Implementation of Dave Gravel's raycast car

Postby VeT » Sun Jul 05, 2009 9:51 am

Julio, how are you? Did you succeed with it?
What about multibody car, is it ready for use in latest version?
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Implementation of Dave Gravel's raycast car

Postby Julio Jerez » Mon Jul 06, 2009 3:20 pm

I am putting the time in getting the Tutorial out, that way I can help more people at once since you are not they only one confused with the raycast car.
These tutorial will be very focus and very simple, but because for that it take longer to make then than I estimated.
I am sure you will be about to get the car in as soon as the tutorial is out.

To lift you spirit I will show you a small video I made last night to show Delfi how the car Behave physically.


Do not dispaire my friend, I fill your desperation but I think the wait will payoff.
I am putting a lot of attention to details in these tutorial because tghis time I want people to use the Engine well ionsetad of getting stuff working by trial and error,
so far people are beating the engine setting bodies and joint with very precarious parameters that barely works, and I need to make sure that people use it in better ways.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Implementation of Dave Gravel's raycast car

Postby VeT » Mon Jul 06, 2009 4:40 pm

video is very nice, thank you
i cant wait, when i'll be able to use the power of the Newton in GameStudio... hope your tutorial would help me to deal with it :)
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Implementation of Dave Gravel's raycast car

Postby Leadwerks » Mon Jul 06, 2009 9:42 pm

Here are a few tips I found when using the raycast vehicle:

-Position the chassis at 0,0,0 with no rotation (0,0,0) when you first attach tires.
-Make sure the chassis mass is set before you add any tires.
-Specify the exact number of tires you need in the vehicle create function. Don't specify extras you won't use.
-Use the get tire matrix command to position some wheel meshes so you can see where the tires are and how they are oriented.
-Set the tire angle of all tires to 0 after they are created if you use a vehicle axis other than 1,0,0.

If you don't follow the first three tips, your vehicle may bounce around uncontrollably, or you may have other unexpected results.
Last edited by Leadwerks on Tue Jul 07, 2009 6:24 pm, edited 1 time in total.
User avatar
Leadwerks
 
Posts: 569
Joined: Fri Oct 27, 2006 2:54 pm

Re: Implementation of Dave Gravel's raycast car

Postby Julio Jerez » Mon Jul 06, 2009 11:20 pm

Leadwerks wrote:-Position the chassis at 0,0,0 with no rotation (0,0,0) when you first attach tires.
-Make sure the chassis mass is set before you add any tires.
-Specify the exact number of tires you need in the vehicle create function. Don't specify extras you won't use.
-Use the get tire matrix command to position some wheel meshes so you can see where the tires are and how they are oriented.
If you don't follow the first three tips, your vehicle may bounce around uncontrollably, or you may have other unexpected results.


:cry: :cry: :cry:
This is the precisely the reason why I want to put out these tutorials, I could be wrong and since I have not made a car other than the one in the demos, but none of the above question should be really a prerequisite for setting up a raycast car.

I know this is my entire fault for put out an SDK without documentation even a clear demonstration of how to implement features.
This oversight in my part is what has lead to people making these kinds of rules that for the most part come from trial and error. It is like think of the SDK having a common cold and in reality it has Pneumonia.
I really have to remedy that with these tutorial.
I am asking people to stop development the Ray cast car and wait on the next week when I post the tutorial with the wiki documentation with teh help of Delfi and the toturial Project whic will sue teh C inteface API.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to User Gallery

Who is online

Users browsing this forum: No registered users and 11 guests

cron