def project_point(pt, v):
""" Return projection of point with given direction vector """
proj = Vector()
# project on X
if v.y == 0:
l = 0
else:
l = - pt.y / v.y
proj.z = pt.x + l * v.x
# project on Y
if v.z == 0:
l = 0
else:
l = - pt.z / v.z
proj.y = pt.x + l * v.x
# project on Z
proj.x = pt.y + l * v.y
return proj
collision.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录