Primitive Collision Detecting
来源: 编辑:duliying 更新日期:2008-5-20 11:45:50 浏览:693 次
Line Segment & Plane
Line Seg: P = P0 + t * V t ∈ [0, 1]
Plane : N • P - N • Q = 0 (N is the normal of the plane,Q is some point on plane)
N • (P0 + t * V) - N • Q = 0;
N • (P0 – Q) + t * (N • V) = 0;
t * (N • V) = N • (Q – P0);
dp = N • V;
if ( dp == 0 ) return Line Parallel to Plane;
t = N • (Q – P0) / dp;
if ( t >= 0 && t <= 1 ) return Intersectant;
return No Intersection;
Point On Plane
Point: P
Plane: &nbs
第1页/总9页
第一页 上一页
下一页 最后一页
【发表评论】