2 registered members (AndrewAMD, TipmyPip),
16,005
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Detect collision without c_move ?
#223782
08/26/08 17:28
08/26/08 17:28
|
Joined: May 2007
Posts: 46
ribsribs
OP
Newbie
|
OP
Newbie
Joined: May 2007
Posts: 46
|
Hello all!
I would like to know how to detect if there was a collision between two entities (no need to glide or such, just detect) but without using c_move or simillar.
Here's the problem:
I have a LandPad, static, and a ship in which is attached the action to its movement. The ship is surrounded by a circle, another model, that reads the ship position to position itself.
The collision must be detected between the LandPad and that circle.
C_move exists in the action that is attached to the ship, not the circle. I've thinked in moving the LandPad sooooo slooooow that we cannot understand but with c_move to detect collision with the circle around the ship, but i want to believe that there is another solution.
I hope i've made myself clear about the problem.
Thanks in advance!!
Last edited by ribsribs; 08/26/08 17:30.
|
|
|
Re: Detect collision without c_move ?
[Re: ribsribs]
#223799
08/26/08 18:51
08/26/08 18:51
|
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B
Expert
|
Expert
Joined: Feb 2006
Posts: 2,185
|
if you use c_move you could do something like this:
var z_; z_ = my.z; c_move(me, vector(0,0,100), nullvector, 0); my.z = z;
otherwise you could use c_trace and trace upwards from the pad.
- aka Manslayer101
|
|
|
Re: Detect collision without c_move ?
[Re: ribsribs]
#223819
08/26/08 20:12
08/26/08 20:12
|
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B
Expert
|
Expert
Joined: Feb 2006
Posts: 2,185
|
check the manual. You can detect using polygon collision and get the vertex of the model, by using vec_for_vertex you should be able to get exact positions of the vertex that was hit. You can also use normal to detect which way the normals were facing. It does have some complex poly collision if you choose to use it, but be wary, any collision detection in 3DGS takes alot of framerate if there are multiple objects using it, c_trace takes the most out of all the commands.
- aka Manslayer101
|
|
|
Re: Detect collision without c_move ?
[Re: mpdeveloper_B]
#223857
08/26/08 23:42
08/26/08 23:42
|
Joined: May 2007
Posts: 46
ribsribs
OP
Newbie
|
OP
Newbie
Joined: May 2007
Posts: 46
|
I'm desperate. Always the same thing in collisions  I've tried pretty much everything i could reach but i can't get the result i want. Here are the actions attached to each entity: function event_col() { if((event_type == event_entity)&&(you == Orbulon)){Vals.alpha=5;} //alpha change only to see if collision was detected } action LandPad() { Pad=me; my.event = event_col; my.polygon=on; while(1) { move_mode=ACTIVATE_TRIGGER+IGNORE_PASSABLE; ent_move(vector(0.001,0,0),nullvector); wait(1); } } action Orb() { Orbulon=me; my.polygon=on; while(1) { vec_set(my.x,Ship.x); my.pan+=random(OrbulonRate)*time; wait(1); } } Thanks a lot for every reply and for the time spent! By the way, A7 C here And the screenshot to better get the situation: 
Last edited by ribsribs; 08/26/08 23:45.
|
|
|
Re: Detect collision without c_move ?
[Re: ribsribs]
#223861
08/27/08 00:07
08/27/08 00:07
|
Joined: Oct 2004
Posts: 1,655
testDummy
Serious User
|
Serious User
Joined: Oct 2004
Posts: 1,655
|
Quoting ribsribs. If that is supposed to mean 'using A7 & Lite-C', than the "C-Script and WDL: The predecessors to lite-C" forum category, may be the wrong category for 'you' and / or this 'question'!?
|
|
|
Re: Detect collision without c_move ?
[Re: ribsribs]
#223869
08/27/08 00:32
08/27/08 00:32
|
Joined: Oct 2004
Posts: 1,655
testDummy
Serious User
|
Serious User
Joined: Oct 2004
Posts: 1,655
|
OK. If more precise collision is desired, than it may be appropriate to replace: *calls to older function ent_move with calls to newer function c_move *direct modifications to .pan, .tilt. roll, with calls to function c_rotate Quoting mpdeveloper_B. It does have some complex poly collision if you choose to use it, but be wary, any collision detection in 3DGS takes alot of framerate if there are multiple objects using it, c_trace takes the most out of all the commands. There is probably a fair amount of accuracy found in those statements. The statements are probably pulled from a base of experience.
|
|
|
|