Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,574 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to find physics object's collision point ? #56934
10/05/05 02:18
10/05/05 02:18
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Hi all,

I want to make mesh deforming to my car (damage). My car will get damage from other physics objects /cars/, map entities, models. I don't know how to find collision points /nearest vertex numbers from collision point/.

Please help me ?

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: How to find physics object's collision point ? [Re: Olzii] #56935
10/13/05 19:17
10/13/05 19:17
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Use EVENT_FRICTION to receive contact information. Hitpoint is in TARGET and the normal vector is in NORMAL. You could then use trace to query the closest vertex.

Re: How to find physics object's collision point ? [Re: Marco_Grubert] #56936
10/14/05 03:10
10/14/05 03:10
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Hi Marco,

Thanks for replying. I have following questions :

1. I am using EVENT_FRICTION to receive contac infos. I have searched nearest vertex number from TARGET.X in object which receives damage. After i have found nearest vertex, did mesh deforming at this vertex. But it is working wrong. I want to damage my model at collision point.

2. EVENT_FRICTION is working OK with physics entity and non-physics entity. But it is not working when two physics entities collide.

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: How to find physics object's collision point ? [Re: Olzii] #56937
10/14/05 21:54
10/14/05 21:54
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
What do you mean by it is not working ?

Re: How to find physics object's collision point ? [Re: Marco_Grubert] #56938
10/15/05 05:25
10/15/05 05:25
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
It is not working. This means that i am finding nearest vertex from TARGET and damaging it, but it doesnot damage at right position. For example my car has received impact at front and damage is somewhere else /back side, left or right side/.


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: How to find physics object's collision point ? [Re: Olzii] #56939
10/15/05 05:28
10/15/05 05:28
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia

Here is my code :

function car_event
{ var i=0; var k=0; var tttt[3];
var min_val=500; var min_i;
if(event_type == event_friction)
{
while (i < ent_vertices (my))
{ vec_for_vertex(tttt,my,i);
k=vec_dist(tttt,you.x);
//k=vec_dist(tttt,target.x);
if(k<min_val) {min_val=k; min_i=i;}
i+=1;
}
vec_for_mesh(temp,my,min_i);
vec_scale(temp,0.9);
vec_to_mesh(temp,my,min_i);
ent_fixnormals(my,0);
}
}


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: How to find physics object's collision point ? [Re: Olzii] #56940
10/24/05 22:15
10/24/05 22:15
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
The you.x part does not make sense, but I've got the code working like this:
Code:

var i=0; var k=0; var tttt[3];

var min_val=500; var min_i;

while (i < ent_vertices (my))
{
vec_for_vertex(tttt,my,i);
//k=vec_dist(tttt,you.x);
k=vec_dist(tttt,target.x);
if(k<min_val)
{min_val=k; min_i=i;}
i+=1;
}

vec_for_mesh(temp,my,min_i);
vec_scale(temp,0.2);
vec_to_mesh(temp,my,min_i);
ent_fixnormals(my,0);



Re: How to find physics object's collision point ? [Re: Marco_Grubert] #56941
10/25/05 07:11
10/25/05 07:11
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
@Marco

I have already tested this line
k=vec_dist(tttt,target.x);
and it has bad effect, that is why i changed it to
k=vec_dist(tttt,you.x);

Because of target.x not working correct, i am asking it from you.


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: How to find physics object's collision point ? [Re: Olzii] #56942
10/25/05 22:53
10/25/05 22:53
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
At this point I can only guess that this was a problem which has been fixed in the meantime. I will send you a link to the current Beta version of 3D GameStudio.

Re: How to find physics object's collision point ? [Re: Marco_Grubert] #56943
10/26/05 05:56
10/26/05 05:56
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Thanks Marco,

Now it is working. But this version affects my sky. I have used day night transition script with beautiful sky. After i have updated my version, this script doesnot work.

Please tell me, why it does not work ? New version have changes in sky entity ?


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1