Back to class index
| Plane::ClipSyntaxbool Plane::Clip(LineSegment &line) const; [4 lines of code]bool Plane::Clip(float4 &a, float4 &b) const; [20 lines of code] Clips a line segment against this plane. This function removes the part of the line segment which lies in the negative halfspace of this plane. The clipping operation is performed in-place. If the whole line segment is clipped, the input variables are not modified. Return ValueIf this function returns true, the line segment after clipping did not become degenerate. If false is returned, the whole line segment lies in the negative halfspace, and no output line segment was generated. Syntaxint Plane::Clip(const Line &line, Ray &outRay) const; [20 lines of code]Clips a line against this plane. This function removes the part of the line which lies in the negative halfspace of this plane. Parametersconst Line &lineThe line to clip. If this function returns 2, then the input line should be preserved. Ray &outRay [out]If this function returns 1, then this parameter will receive the ray object that was formed. Return ValueIf the clipping removed the whole line, the value 0 is returned. If the clipping resulted in a ray, the value 1 is returned. If the clipping resulted in a line, the value 2 is returned. Syntaxint Plane::Clip(const Triangle &triangle, Triangle &t1, Triangle &t2) const; [70 lines of code]Clips a triangle against this plane. This function removes the part of the triangle which lies in the negative halfspace of this plane. Return ValueThis function reports how many output triangles were generated. If the whole input triangle was clipped, the value 0 is returned. If this function returns 1, the value t1 will receive the generated output triangle. If this function returns 2, t1 and t2 will receive the generated output triangles. |