示例#1
0
文件: plane.php 项目: eXcomm/alive
 public function Distance(ALiVE_Vector $point)
 {
     // calculate the distance of $point from plane
     return abs($this->mNormal->X() * $point->X() + $this->mNormal->Y() * $point->Y() + $this->mNormal->Z() * $point->Z() + $this->D());
     // normally we would also need to divide this number by $this->mNormal->Length(),
     // but since we assert normal is a unit vector, this is unnecessary
 }
示例#2
0
文件: vector.php 项目: eXcomm/alive
function ALiVE_Vectors_Equal(ALiVE_Vector $a, ALiVE_Vector $b)
{
    return $a->X() == $b->X() && $a->Y() == $b->Y() && $a->Z() == $b->Z();
}