About Store Forum Documentation Contact



Post Reply 
Something like physhit.plane.normal for mesh sweep.
Author Message
menajev Offline
Member

Post: #1
Something like physhit.plane.normal for mesh sweep.
I'm using sweep(point,move,mesh) for testing bullets collisions with mech.
I want to draw decals on hitted mech, but i need dir. Is any way to get it? I'm using phys.ray to test collisions with terrain and it works ok, but I screwed at start and now it would be time-consuming to change all to works good with actors and all build in engine stuff.
02-17-2010 07:26 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Something like physhit.plane.normal for mesh sweep.
you mean "Bool Sweep(Vec &point,Vec &move,.. " ?
you've got there Int *hit_face=NULL
which can return index of the face
if you have calculated face normals mesh.setFaceNormals,
you can access it
base.tri.nrm
or
base.quad.nrm
check comments on 'hit_face' above in the header

but I don't recommend using 'Sweep' for real-time use
Physics.sweep is recommended
02-17-2010 07:37 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #3
RE: Something like physhit.plane.normal for mesh sweep.
But sweep functions takes only basic shapes as an argument.
I saw hit_face, but I still don't see any function that returns quads / tris or any array that store it.
02-17-2010 08:23 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Something like physhit.plane.normal for mesh sweep.
which function are you talking about?
02-17-2010 08:39 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #5
RE: Something like physhit.plane.normal for mesh sweep.
(I'm not sure if you are talking about first or 2nd line ;] )
Physics.sweep takes only basic shapes.
After "Bool Sweep(Vec &point,Vec &move,.. " - i don't know, how to use hit_face to get single tri / quad.
02-17-2010 08:41 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Something like physhit.plane.normal for mesh sweep.
I still don't understand what function do you want to use

Physics.sweep or Sweep
you have also Physics.ray

for Sweep you set a pointer to custom Int
Int face;
if(Sweep(....., &face
{
if(face&SIGN_BIT)..
else
..
}
02-17-2010 09:08 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #7
RE: Something like physhit.plane.normal for mesh sweep.
Ok, I've done it (i just didn't spot MeshBase and didn't know what to do with hit_face).
02-19-2010 07:44 PM
Find all posts by this user Quote this message in a reply
Post Reply