How can I avoid collisions?

Posted By: XNASorcerer

How can I avoid collisions? - 12/06/05 16:24

Quote:

If physics entities intersect other models or blocks, the physics system will try to push these entities apart.



How can I prevent this? I need to make one physic entity to pass inside another entity that can be a physics entity or not.
Thanks.
Posted By: vlau

Re: How can I avoid collisions? - 12/06/05 16:55

If your target model is not a physics entity
set it passable = on
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/06/05 16:58

First I am using a non physics entity for my target model and I already did that. But the only difference is that, with the passable flag = off, they collide, and with the passable flag = on, the physic entity pushs the non physics entity alway.
Posted By: vlau

Re: How can I avoid collisions? - 12/06/05 17:09

I don't have this problem, my physics entity hit my non physics
target didn't push it away. What is your setting of the physics
entity? or try to adjust the value of entity.push
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/06/05 17:36

As you can see on this pic:



That didn't help. I tried several values with the push and nothing. And the second car has his passable flag on.
Posted By: vlau

Re: How can I avoid collisions? - 12/06/05 18:05

Don't know why? I've tried with my physics entity several times
with different size of models, it passes them smoothly. May be I
post my physics entity setting below, see if it can help.

var GRAVITY[3] = 0,0,-386;

phent_settype(my, PH_RIGID, PH_BOX);
phent_setmass(my, 5, PH_BOX);
phent_setdamping(my, 50,50);
phent_setfriction(my,0);
phent_setelasticity(my, 0,100);
ph_setgravity(GRAVITY);
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/06/05 18:32

It didn't help, but thanks anyway.
Posted By: _Tommo_

Re: How can I avoid collisions? - 12/06/05 20:47

You could set the entities that must collide in the same group id with phent_setgroup, this way they should be capable to intersect.
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/06/05 22:01

_Tommo_,
This would only work if both entities were physics entities.
Posted By: Helghast

Re: How can I avoid collisions? - 12/07/05 06:49

it looks as if those wheels arent set to passable either, dunno if they are seperated models, but it was a good guess

regards,
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/07/05 08:54

The physics entity has separeted models for the tyres, but the other enity doesn't have. The non physics entity is just one model.
Posted By: vlau

Re: How can I avoid collisions? - 12/07/05 10:02

Do your target model (non physics entity) has any
action attached which contains collision detection
event?
Posted By: ello

Re: How can I avoid collisions? - 12/07/05 10:17

ehem, isnt that a case for what the phent_setgroup command is there??
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/07/05 11:04

Quote:

ehem, isnt that a case for what the phent_setgroup command is there??




Isn't phent_setgroup only for physics entities? I am using a physics entity and a non physics entity.
Posted By: ello

Re: How can I avoid collisions? - 12/07/05 11:08

hm, ok, should have read the thread better. strange that passable doesnt work for you. i cant imagine why
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/07/05 13:04

Thanks anyway.
Does anyone have an idea about that?
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/07/05 14:29

Thanks vlau.

Quote:

Do your target model (non physics entity) has any
action attached which contains collision detection
event?




The problem is fixed! I was forgoting this : IGNORE_MODELS.
Posted By: vlau

Re: How can I avoid collisions? - 12/07/05 14:57

Very nice. I see your car (non physics entity) is
transparency. If you don't want it try to set it
flare = off.

I also read your tutorial : "Nice road paths for terrains",
it's cool, thanks for that.
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/07/05 15:13

Thanks.

I know about the tranparency. I am just trying to make that car more tranparent as it as it arrives close to the player's car. So, I am still testing it.
Posted By: fastlane69

Re: How can I avoid collisions? - 12/07/05 18:58

Simple piece of advice, applicable whenever you get these seemingly strange errors.

Make a brand new application that only tests the wrong behaiviour. Make sure that this is from scratch and uses none of your pre-built code.

If this Unit Test fails, then you know that the problem is with either your software or hardware.

If this Unit Test passes (ie behaives like it should), you know that there is something inside your code that is causing this.

This is all the more relevant since several other users cannot reproduce your error...this leads to the natural conclusion that something in your code, software, or hardware is mucking things up. I'm pretty sure that it's not going to be hardware related and a simple reinstall would take care of the software so in my eyes all signs point to something in your coding that isn't working right.
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/07/05 19:00

Hã? fastlane69, what are you talking about here?
Posted By: fastlane69

Re: How can I avoid collisions? - 12/07/05 19:06

Well, you have this nice bit of code/game for which one part doesn't work. What I'm suggesting is that you reduce it to it's bare components and test the componenet that is failing apart from the other componenets.

In other words, from scratch, program the collision of a physics entity with a non-physics entity and nothing else. See if this simple test reproduces the errors that you are experiencing or not. This will let you know if the problem is truly within the physics engine or if it's with your script...and since no one can reproduce this error, my guess is that it's with your script.
Posted By: XNASorcerer

Re: How can I avoid collisions? - 12/07/05 19:18

fastlane69, I really thank you for trying to help, but as you can see here ( a few posts behind ), that problem is already fixed. That is why I wasn't undertand you.
But thanks anyway. This is why a love this community.
Posted By: fastlane69

Re: How can I avoid collisions? - 12/07/05 19:24

Oh, I didn't realize that was the solution.

Cheers then!
© 2024 lite-C Forums