Semi circle collition help.

Started by
4 comments, last by LittleFreak 19 years, 10 months ago
I can do ray collition and I can do radius collition. But how do I do a semi circle collition.(EX. Swing of a sword.. Detect every mesh that the sword hits.) Any tips?
Advertisement
Why don''t you just check if the mesh is on the right side of the circle, (you can use a dot product for this I''m pretty sure) and then check for distance (radius). That should get you what you need. It''s just a 2-step process.
She walked into my office like a centipede with 98 missing legs.
I tried that it didnt work real well it works fine if the character is facing down a axis but when i try this when its on an angle like let say 45 degrees it will only take the top half and is on the extreme left of the swing.... Is it possiable to track a movement of 1 mesh (the sword) and return a linklist or something like that of all the meshs that the mesh goes through.. my question with that is tho is how do you determine the hit if a object hits a odd shaped objects.
Here''s what you need to do as an exact formula:

Let v = the vector that represents the direction that you''re facing, or the middle of your swing.

Let u = the vector from the point of swing to the point you want to test.

if u dot v is > 0, then it is on the side of the circle representing your swing that you want.

THEN

if the distance between your centre of swing, and the point you are testing is less than the radius of your swing, then that point is getting hit.

There you go, that''s what you need to know. You might want to look up a good book about linear algebra and matrices. I''d suggest "Linear Algebra and its Applications, Third Edition" by Davic C. Lay.

Any questions, just write back.
She walked into my office like a centipede with 98 missing legs.
I almost forgot to say this. If the bounding boxes don''t intersect, then they aren''t going to hit at all. Also, if the bounding boxes interesct, then you''d probably want to test all of the vertices to make it very accurate. You could probably get by checking only every second vertex assuming that your model is fairly detailed, and not spiky.
She walked into my office like a centipede with 98 missing legs.
Thanks that helps alot. I know where to go from here thanks.

This topic is closed to new replies.

Advertisement