How can i group car elements (tires,body)

Posted By: kadir

How can i group car elements (tires,body) - 11/16/12 11:15

Hi everyone,
I don't have any information about that. I want to group car elements. I have car body and 4 tires in word. I designed car position and put the tires in the car body. The front tires was going when i was press the w key but the car don't going beacause tires don't merged the car body.
How can i do this please help me?
Posted By: rayp

Re: How can i group car elements (tires,body) - 11/16/12 11:32

try

This example connects a tire model / more tire models to your car body. Play around in _add_tire. Its up to you. With this source you should be able to connect tire(s) to car with fixed pos, vertex or bone pos.

Code:
void _add_tire()
{
 while(you)
 {
   VECTOR _p, _a;
 // simple connection without bones or vertex (fixed pos)
   vec_set(my.x,   you.x);
   vec_set(my.pan, you.pan);
 // or add bones at your car body, where the tire(s) should
 // be placed and use this
    vec_for_bone(_p, you, "TirePos1");
    ang_for_bone(_a, you, "TirePos1");
   // or place a vertex at the pos where the tire(s) should be placed
   vec_for_vertex(_p, you, 123); // Vertex 123

   vec_set(my.x, _p);
 //vec_set(my.pan, _a);
  wait(1);
 }
 // car body lost ?
 ptr_remove(me);
}
action MyCar()
{
 ent_create("tire.mdl", vector(my.x, my.y, my.z), _add_tire);
// ent_create("tire.mdl", vector(my.x, my.y, my.z), _add_tire2);
// ent....
// ent...

 while(1)
 {
   // your car code
  wait(1);
 } 
}

When using one model 4 one tire, i would use different functions like _add_tire_front_left etc.
greets

Edit a day later grin
Just seen this thread is under physics...then i guess my post wont help u much grin
© 2024 lite-C Forums