Collision detect ion

Posted By: Julientdc

Collision detect ion - 06/03/07 16:49

Hello,

I want to detect the colision of my entity with all others objects in my world.

I have see this:

scan_entity()

Code:
  
limite_pos.z=0.1;
limite_pos.pan=180;
limite_pos.tilt=180;
objet_cam.enable_scan = on;
peuxbouger = scan_entity(objet_cam, limite_pos);
str_for_num(valeur_affiche,peuxbouger);
texte_fonte.string=valeur_affiche;



but this return the value 0 all the time! How I can detect colision with a value?

Thank you,
Julien
Posted By: tompo

Re: Collision detect ion - 06/03/07 17:25

f.e c_scan, trigger/event_trigger, trace, enable_entity/event_entity... etc
search help for those functions
Posted By: Julientdc

Re: Collision detect ion - 06/03/07 20:16

Thank you for your respond

I have try c_scan
That work for entity but not for block..

peuxbouger = c_scan(objet_cam.x,objet_cam.pan,vector(120,0,40),IGNORE_ME);
and
peuxbouger = c_scan(objet_cam.x,objet_cam.pan,vector(120,0,40),SCAN_ENTS | IGNORE_ME);

IGNORE_ME Ignores the my entity; can be combined with SCAN_ENTS.
IGNORE_YOU Ignores the you entity; can be combined with SCAN_ENTS.
SCAN_ENTS Scans for entities within the cone, and triggers their EVENT_SCAN event.
SCAN_POS Scans for camera positions placed in the level.
SCAN_PATHS Scans for path start positions.
SCAN_NODES Scans for path node positions.


Can you help me yet?

Thank you,
Julien
Posted By: tompo

Re: Collision detect ion - 06/03/07 20:41

True...
because C-scan can "see" thrue the walls (blocks)

use c_trace or
my.enable_block = on; with
if(event_type == event_block)

or don't use blocks but ents
Personally I don't like blocks and don't use them at all
Posted By: nipx

Re: Collision detect ion - 06/03/07 23:25

not sure, but arent you looking for a collision system for moving, rotating....?

then you should use c_move and c_rotate....


nipx
Posted By: Julientdc

Re: Collision detect ion - 06/04/07 00:30

Hmm Thank you but all this functions is not what I need...

I want just a function of this style:

result = Collision(object_vector,object_angle,max_vector,max_angle);

if oject vector - max_vector = -number then
result: 443435435
else
result: 0

This:
Code:
  
here 0 | object in map here : 435435 can't continue
me > . here 0 | object in map here : 432423 can't continue
here 0 | object in map here : 135652 can't continue





c_move: this detect collision but the entity is not in my control with my movement system
C_scan: Nice but only entity
c_trace: That not work good... with my movement system

Thank you,
Julien
Posted By: Xarthor

Re: Collision detect ion - 06/04/07 06:40

What kind of movement system do you have?
Posted By: tompo

Re: Collision detect ion - 06/04/07 07:37

exactly... what movement system do you have, becouse this is strange
what exactly you want to do... show us some part of the script or tell us what are you planning
and result of c_scan is 0 if nothing or distance to closest you entity if any, so can't you replace blocks with entitys and problem will be solved?

BTW... it's a pity that c_scan always scans through walls, not only with some mode like ignore_blocks
Posted By: Julientdc

Re: Collision detect ion - 06/04/07 12:26

It's just my own movement system and c_move use the physic engine then that interfer with my system...

Ok, I think I will try to use only entity bescause c_scan is perfect.


Just a question, c_scan look only the position of the entity or all the entity?

Thank you,
Julien
Posted By: Xarthor

Re: Collision detect ion - 06/04/07 12:37

c_move does not use the physik engine.
It moves the entity and uses the A6 collision detection system.
Which is better than any collision detection system you could write with c-script.

[ironic]
But why go for the simple if the complicated is available too.
[/ironic]
Posted By: tompo

Re: Collision detect ion - 06/04/07 13:17

Quote:

c_scan look only the position of the entity or all the entity?




read help (F1) for info about c_scan
it depends of mode u will use
but u will have the YOU pointer so you make what u want to f.e. using defines
Posted By: Julientdc

Re: Collision detect ion - 06/04/07 23:52

Xarthor : Yes It's true but... I want the better control I can have with my game... Camera and movement is a big part of this...

tompo : I see the help since yesterday but I don't no...

I have read this: "SCAN_ENTS scans for the object's >>>>origin<<<< only. If you have a large object, you will probably need to increase the scan range or add additional triggers around the object's circumference."


But if I have an entity SIZE: 10000 height 100 width 5 Z-width

Hmmm that not work right?

I have try with:

IGNORE_ME <- Work but Origin of the entity

SCAN_ENTS | IGNORE_ME <- Work but Origin of the entity same of ignore_me alone because SCAN_ENTS is activate by default

SCAN_LIMIT | SCAN_ENTS | IGNORE_ME (enable_scan my other entity) <- not work : 0 all time


other mode in ref:
SCAN_POS Scans for camera positions placed in the level. (I think is not that)
SCAN_PATHS Scans for path start positions. (I think is not that)
SCAN_NODES Scans for path node positions. (I think is not that)

I like your help if you have any idea

Thank you,
Julien
Posted By: Julientdc

Re: Collision detect ion - 06/05/07 01:34

ho and it's nice I will only use the c_move and put my movement system in the garbage :'(
Posted By: JibbSmart

Re: Collision detect ion - 06/05/07 04:21

c_move doesn't do any physics. use c_move, and then if you want any special reaction type thing, do that yourself.

if you want to actually check if an entity is intersecting another one (collision detection requires motion for there to be a collision, but it seems you want to detect an intersection) you should request in the "Future" forum.

i'll do that myself, actually

julz
Posted By: tompo

Re: Collision detect ion - 06/05/07 07:51

or try:
1. my.polygon = on; //polygon colision if You have a large model
2. convert model to terrain
Posted By: Xarthor

Re: Collision detect ion - 06/05/07 11:21

Please note:
The polygon flag should be used on STATIC models ONLY!
No model which is moved in any way (c_move e.g.) should have the my.polygon flag set to on!
© 2024 lite-C Forums