Example #1
0
bool MovingPlatform::intersects(Reference<Primitive> &other, std::vector<Reference<Primitive> > &objsHit, bool sameTest) const {
    objsHit.push_back(const_cast<MovingPlatform*>(this));
    if(other->canIntersect()) {
        return unmovingBound().intersects(other->worldBound());
    } else {
        std::vector<FormFactor::Reference<FormFactor::Primitive> > refined;
        other->fullyRefine(refined);
        for(unsigned int i = 0; i < refined.size(); i++)
            if(unmovingBound().intersects(refined[i]->worldBound())) return true;
        return false;
    }
}