Author Topic: Tire Collision  (Read 1068 times)

For an add-on I am making, I need to make it detect when a tire hits it, that it does things. I have it set so that if a vehicle hits it, it does stuff, but for some reason, when a tire runs over it, it does not do anything. I have tried %col.getClassName() $= "WheeledVehicleTire" but that does not work for some reason. I think that the tire is part of the vehicle, but it does not register as a collision or something. I need help doing this, I need to know if it is possible to make something check for a collision with a tire.

Tyres are not physical objects, they're just rendered. They don't have collision callbacks.

So in other words, I cant do this?

Did the onVehicleTouch event ever work? I think it might have something to do with it, but not sure.

I don't think he's doing this with bricks.
Yes, it did work, but it didn't use collision.

I don't think he's doing this with bricks.
Yes, it did work, but it didn't use collision.
Well of course. But, It'd depend on what he's actually doing.

Where can I get those events? I would like to see the code. But if all else fails, I'll just try to make it detect if a vehicle is above it...

Can someone help me? I'm thinking I can get the up vector of the thing, and check to an extent if a vehicle is there, can someone help me with vectors, I have no idea how to use them, plus I need to know how to make it search for a Vehicle MaskType. Could I use Container Ray cast and make the second coordinates the up vector? So I could check if something is in between the Item-thing and the up vector, if there is an easier way to do this please help. I want it to do this:

                ________________________
               /                                           |
             /                                             |
           /                                               |
         /                                                 |
       /                                                   |
       |_________Vehicle________________         
      O            O---------------O            O
       O         O      ^              O         O
         OOOO    [Thing]            OOOO
-----------------------------Ground----------------------------- <<<< Does stuff if that happens
I want it so that if it passes a short distance above the thing, the thing does stuff. Not if the vehicle gets near it. I need to know how to do this. Also, could someone explain what a vector is and what it does? And what are matrices (Matrix) and are they important in doing this?
« Last Edit: May 07, 2009, 10:26:08 PM by AGlass0fMilk »

The tyres aren't actually palpable objects, it's the springs which do the colliding.

Vectors are basically lines, I presume you can gather them by comparing two points using an appropriate function.

If you could get the initial detection right then you could give it a timer before it does stuff, so say a vehicle starts to pass over it and the object sees the front of the vehicle and is triggered, it would only do stuff a small fraction of a second afterwards when the vehicle will be completely above it. Just an idea

What is with spelling tires "tyres"? I got all that working, now on to the next part =D I'll consult you guys if I need any more help.
« Last Edit: May 09, 2009, 12:26:24 PM by AGlass0fMilk »

whats the athentic key code for the game plz tell me  
Really? Do people actually think that will work these days?

-Deletion of a user and his posts has rendered this post unneeded-
« Last Edit: June 18, 2009, 05:14:34 AM by Regulith »

What is with spelling tires "tyres"?

One of the many grammatical errors in the Torque engine haha

In British English, a "tyre" is what you have in American English as "tire". Same thing.

Although the rest of the engine is in American English, so it's probably a mistake.