This is relatively easy, and while you've defined the question correctly, trying to get the computer to work with quadrilaterals is making things complicated.
Step 1: Check to see if V2 is in the right direction.
There are four new vectors created on your map, with V1 as their origin:
V2-V1
P1-V1
P2-V1
P3-V1
If it helps draw arrow heads pointing at each of V2, P1, P2 and P3 coming from V1.
Each of these vectors has an angular direction that can be determined using the arctan function. You get an angle in radians for each one. If the V2-V1 angle is BETWEEN two of the other angles, you know that a collision is possible. If not, there's no collision.
In the case of your diagram V2-V1 looks to be about 6*PI/4 radians, while P1-V1 is about 7*PI/4 radians, and P2-V1 is about 5*PI/4 radians. Remember that in the computer world, Y is down the axis, so zero radians is still to the right, but the angle goes CLOCKWISE instead of anticlockwise, going down and then to the left.
Step 2: Check to see if V2 passes P1<->P2.
OK, so you know that V2 is in the right direction, but you don't know if it's passed the line made by P1 and P2. What you do now is use P1 (one of the two points in the intersecting face of the triangle) as the origin of a new set of four vectors. Start by determining the angle of P2-P1. Add PI to that angle and you get a range. (Looks like PI/4 to 5*PI/4 on your diagram). You're almost there. Take angles for V1-P1 and V2-P1. If they're on opposite sides of the range (that is, opposite sides of the P1/P2 line), you have a collision. If they're on the same side, then V2 hasn't yet hit the triangle. Again you'll have to use arctan to convert a delta vector (like P2-P1) into an angle.
Basically I've just reworded your quadrilateral imagery and just went with an angular wedge, and a line. Step 1 was "Is the angle of V2 between P1pro and P2Pro?" and Step 2 was "Is V2 on the same side of the P1<>P2 line as V1?"
Just a nasty bit of grade school trigonometry. I took a third year comp sci course in university on 3D graphics, and it was amazing how much the students there struggled with trigonometry.
here... I did these up visually so they'd make more sense (though not as pretty as your diagrams)
Step 1: Is Theta (V2-V1) between Theta (P1-V1) and Theta(P2-V1)? (If so, proceed to step 2, else no collison)
Step 2: Is Phi(P3-P1) between Phi(P2-P1) and Phi(P2-P1)+PI? Is Phi(V1-P1) between Phi(P2-P1) and Phi(P2-P1)+PI? (if one is true, and the other false, the vectors are on opposite sides of the P2-P1 line and you have a collision)
(ignore my weird cruft at the bottom left, I had it at the top left and it was getting in the way)
Edit: just a note here... One messy bit about trig is that you need to define "less than" in a meaningful context for radians. So 2*PI-0.001 is less than 0. Here's a bit of code I wrote up for that very purpose in my latest program...
CODE
// is angle1 between angle2 and angle3 (angle2 left of angle3)
bool Coords::angleBetween(float angle1, float angle2, float angle3) {
while (angle1<0)
angle1+=2.0*PI;
while (angle2<0)
angle2+=2.0*PI;
while (angle3<0)
angle3+=2.0*PI;
while (angle1>2.0*PI)
angle1-=2.0*PI;
while (angle3<angle2)
angle3+=2.0*PI;
while (angle1<angle2)
angle1+=2.0*PI;
if ((angle1>=angle2)&&(angle1<=angle3))
return true;
return false;
}
The code assumes sane angles in the -2*PI to +4*PI range, the kind you'd get by running arctan and then adding or subtracting some offset to it.
EDIT2: CP Collision point by the way is simple algebra. Determine the linear equation for the two lines of V1-V2 and P2-P1 (i.e. determine a,b for y=ax+b ), and put the two together like so:
y=a1*x+b1
y=a2*x+b2
a1*x+b1 = a2*x+b2
(a1-a2)*x = b2-b1
x = (b2-b1)/(a1-a2)
gives you x.. put that back into either of the first two equations to get y.
y=a1*[(b2-b1)/(a1-a2)]+b1
The slope a is just (v2-v1).y/(v2-v1).x... no need to use arctan again. b can be worked out by y=ax+b, using the a we just worked out, and x and y from V1 or V2.
This is all pseudocode, poor text description and badly modified diagrams, but I hope this helps you get in the right direction... Good luck!