21 float cos_angle_normals = inNormal1.
Dot(inNormal2);
22 if (cos_angle_normals < -0.99984769515639123915701155881391f)
26 if (inNormal1.
Cross(inNormal2).
Dot(inEdgeDirection) < 0.0f)
30 return cos_angle_normals < 0.99619469809174553229501040247389f;
50 float normal_length = inNormal.
Length();
51 float triangle_normal_length = inTriangleNormal.
Length();
52 if (inMovementDirection.
Dot(inNormal) * triangle_normal_length < inMovementDirection.
Dot(inTriangleNormal) * normal_length)
56 if (inActiveEdges == 0)
57 return inTriangleNormal;
61 if (inTriangleNormal.
Dot(inNormal) > 0.99619469809174553229501040247389f * normal_length * triangle_normal_length)
64 const float cEpsilon = 1.0e-4f;
65 const float cOneMinusEpsilon = 1.0f - cEpsilon;
72 if (u > cOneMinusEpsilon)
75 colliding_edge = 0b101;
77 else if (v > cOneMinusEpsilon)
80 colliding_edge = 0b011;
82 else if (w > cOneMinusEpsilon)
85 colliding_edge = 0b110;
87 else if (u < cEpsilon)
90 colliding_edge = 0b010;
92 else if (v < cEpsilon)
95 colliding_edge = 0b100;
97 else if (w < cEpsilon)
100 colliding_edge = 0b001;
105 return inTriangleNormal;
109 return (inActiveEdges & colliding_edge) != 0? inNormal : inTriangleNormal;