示例#1
0
void DebugDrawManager::add_quad(const hkVector4& center, float width, float height, uint32_t color, bool bDepth)
{
    float x = center.getSimdAt(0);
    float y = center.getSimdAt(1);
    float z = center.getSimdAt(2);
    hkVector4 v0, v1, v2, v3;
    v0.set(x-width/2, y, z-height/2);
    v1.set(x+width/2, y, z-height/2);
    v2.set(x+width/2, y, z+height/2);
    v3.set(x-width/2, y, z+height/2);
    add_line(v0, v1, color, bDepth);
    add_line(v1, v2, color, bDepth);
    add_line(v2, v3, color, bDepth);
    add_line(v3, v0, color, bDepth);
}
示例#2
0
void DebugDrawManager::add_aabb( const hkVector4& min, const hkVector4& max, uint32_t color, bool bDepth)
{
    hkVector4 start, end;
    //1.
    start.set(min.getSimdAt(0), min.getSimdAt(1), min.getSimdAt(2));
    end.set(max.getSimdAt(0), min.getSimdAt(1), min.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //2.
    start.set(max.getSimdAt(0), min.getSimdAt(1), min.getSimdAt(2));
    end.set(max.getSimdAt(0), max.getSimdAt(1), min.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //3.
    start.set(max.getSimdAt(0), max.getSimdAt(1), min.getSimdAt(2));
    end.set(min.getSimdAt(0), max.getSimdAt(1), min.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //4.
    start.set(min.getSimdAt(0), max.getSimdAt(1), min.getSimdAt(2));
    end.set(min.getSimdAt(0), min.getSimdAt(1), min.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //5.
    start.set(min.getSimdAt(0), min.getSimdAt(1), min.getSimdAt(2));
    end.set(min.getSimdAt(0), min.getSimdAt(1), max.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //6.
    start.set(max.getSimdAt(0), min.getSimdAt(1), min.getSimdAt(2));
    end.set(max.getSimdAt(0), min.getSimdAt(1), max.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //7.
    start.set(max.getSimdAt(0), max.getSimdAt(1), min.getSimdAt(2));
    end.set(max.getSimdAt(0), max.getSimdAt(1), max.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //8.
    start.set(min.getSimdAt(0), max.getSimdAt(1), min.getSimdAt(2));
    end.set(min.getSimdAt(0), max.getSimdAt(1), max.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //9.
    start.set(min.getSimdAt(0), min.getSimdAt(1), max.getSimdAt(2));
    end.set(max.getSimdAt(0), min.getSimdAt(1), max.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //10.
    start.set(max.getSimdAt(0), min.getSimdAt(1), max.getSimdAt(2));
    end.set(max.getSimdAt(0), max.getSimdAt(1), max.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //11.
    start.set(max.getSimdAt(0), max.getSimdAt(1), max.getSimdAt(2));
    end.set(min.getSimdAt(0), max.getSimdAt(1), max.getSimdAt(2));
    add_line(start, end, color, bDepth);
    //12.
    start.set(min.getSimdAt(0), max.getSimdAt(1), max.getSimdAt(2));
    end.set(min.getSimdAt(0), min.getSimdAt(1), max.getSimdAt(2));
    add_line(start, end, color, bDepth);
}
示例#3
0
static void SetTransformPosition(hkQsTransform& transform, hkVector4& p)
{
    if (p.getSimdAt(0) != FloatNegINF) transform.setTranslation(p);
}