PRG3D
Member
|
bullet pierce
Hi,
How I can create bullet who can pierce through objects? When I use Physics.ray I detect only the closest object, can I detect all object on a line?
Polish:
Jak mogę zrobić pocisk który będzie mógł przebijać przez obiekty? Kiedy używam Ray'a mogę wykryć jedynie najbliższy obiekt, czy mogę jakoś wykryć wszystkie obiekty kolidujące z daną prostą?
|
|
01-17-2011 05:32 PM |
|
Esenthel
Administrator
|
RE: bullet pierce
isn't there a physics ray with callback?
|
|
01-18-2011 12:04 AM |
|
PRG3D
Member
|
RE: bullet pierce
But, I have very fast bullet (600 m/s) and I would detect all object on a line. For example:
I use:
Code:
//pos = bullet_start_pos;
//dir = bullet_dir;
//dir*600 = 600 m/s
//BulletHitDetection bhd(T); //STRUCT(BulletHitDetection , PhysHitCallback)
Physics.ray(T.pos,T.dir*600/Time.fps(),bhd);
this detect only once object on this line...
|
|
01-20-2011 02:19 PM |
|
Esenthel
Administrator
|
RE: bullet pierce
don't use Time.fps
T.dir*600*Time.d()
inside custom virtual method of the BulletHitDetection you get all objects enumerated
|
|
01-20-2011 05:02 PM |
|
PRG3D
Member
|
RE: bullet pierce
But when the ray go trought a few object in method hit (in BulletHitDetection class) I get only once object. Can you show me example code for it?
|
|
01-20-2011 05:10 PM |
|
Esenthel
Administrator
|
RE: bullet pierce
Memc<Game::Obj*> objects
inside callback:
objects.add(hit.obj);
|
|
01-20-2011 05:12 PM |
|
PRG3D
Member
|
RE: bullet pierce
Ok, thanks
I've another questions . I detect for example on barrels multiple collisions (exacly 5). Can I detect only once collision on once object?
|
|
01-20-2011 09:40 PM |
|