Ejemplo n.º 1
0
bool Sector::Intersects(const Triangle& triangle) const {

    Line il(this->GetPosition(), this->GetStartPoint().GetPosition());
    Line tl(this->GetPosition(), this->GetEndPoint().GetPosition());
    Circle s(this->GetPosition(), this->GetRadius(), this->GetColor(), this->IsFilled());

    bool circle_intersect = triangle.Intersects(s);
    if(circle_intersect == false) return false;

    bool il_intersect = triangle.Intersects(il);
    if(il_intersect) return true;

    bool tl_intersect = triangle.Intersects(tl);
    if(tl_intersect) return true;

    bool c_intersect = triangle.Intersects(Point(this->GetPosition()));
    if(c_intersect) return true;

    return false;
}
Ejemplo n.º 2
0
bool Sphere::Intersects(const Triangle &triangle, vec *closestPointOnTriangle) const
{
	return triangle.Intersects(*this, closestPointOnTriangle);
}
Ejemplo n.º 3
0
bool AABB::Intersects(const Triangle &triangle) const
{
	return triangle.Intersects(*this);
}
Ejemplo n.º 4
0
Archivo: OBB.cpp Proyecto: Ilikia/naali
bool OBB::Intersects(const Triangle &triangle) const
{
    AABB aabb(float3(0,0,0), float3(Size()));
    Triangle t = WorldToLocal() * triangle;
    return t.Intersects(aabb);
}
Ejemplo n.º 5
0
bool OBB::Intersects(const Triangle &triangle) const
{
	AABB aabb(POINT_VEC_SCALAR(0.f), Size());
	Triangle t = WorldToLocal() * triangle;
	return t.Intersects(aabb);
}
Ejemplo n.º 6
0
Archivo: Ray.cpp Proyecto: Ilikia/naali
bool Ray::Intersects(const Triangle &triangle, float *d, float3 *intersectionPoint) const
{
    return triangle.Intersects(*this, d, intersectionPoint);
}
Ejemplo n.º 7
0
bool Line::Intersects(const Triangle &triangle, float *d, vec *intersectionPoint) const
{
    return triangle.Intersects(*this, d, intersectionPoint);
}