About Store Forum Documentation Contact



Post Reply 
bullet pierce
Author Message
PRG3D Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: bullet pierce
isn't there a physics ray with callback?
01-18-2011 12:04 AM
Find all posts by this user Quote this message in a reply
PRG3D Offline
Member

Post: #3
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
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
Find all posts by this user Quote this message in a reply
PRG3D Offline
Member

Post: #5
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: bullet pierce
Memc<Game::Obj*> objects

inside callback:

objects.add(hit.obj);
01-20-2011 05:12 PM
Find all posts by this user Quote this message in a reply
PRG3D Offline
Member

Post: #7
RE: bullet pierce
Ok, thanks smile

I've another questions smile. 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
Find all posts by this user Quote this message in a reply
Post Reply