void OcclusionDebugRenderer::addPoint(const Umbra::Vector3& pt, const Umbra::Vector4& color)
{
    OgreWorldPtr ogreWorld = renderer_->GetActiveOgreWorld();
    if(!ogreWorld.get())
        return;

    // Nothing to do here
    float3 point = Vector3ToFloat3(pt);
    ogreWorld->DebugDrawSphere(point, 0.1f, 6, Color::Red);
}
void OcclusionDebugRenderer::addLine(const Umbra::Vector3& start, const Umbra::Vector3& end, const Umbra::Vector4& color)
{
    OgreWorldPtr ogreWorld = renderer_->GetActiveOgreWorld();
    if(!ogreWorld.get())
        return;

    float3 start_ = Vector3ToFloat3(start);
    float3 end_ = Vector3ToFloat3(end);

    ogreWorld->DebugDrawLine(start_, end_, Color::Yellow);
}
void OcclusionDebugRenderer::addAABB(const Umbra::Vector3& mn, const Umbra::Vector3& mx, const Umbra::Vector4& color)
{
    OgreWorldPtr ogreWorld = renderer_->GetActiveOgreWorld();
    if(!ogreWorld.get())
        return;

    float3 mn_ = Vector3ToFloat3(mn);
    float3 mx_ = Vector3ToFloat3(mx);
    Color color_ = Vector4ToColor(color);

    AABB aabb(mn_, mx_);
    ogreWorld->DebugDrawAABB(aabb, color_);
}
void OcclusionDebugRenderer::addQuad(const Umbra::Vector3& x0y0, const Umbra::Vector3& x0y1, const Umbra::Vector3& x1y1, const Umbra::Vector3& x1y0, const Umbra::Vector4& color)
{
    OgreWorldPtr ogreWorld = renderer_->GetActiveOgreWorld();
    if(!ogreWorld.get())
        return;

    // Nothing to do here
    float3 x0y0_, x0y1_, x1y0_, x1y1_;
    x0y0_ = Vector3ToFloat3(x0y0);
    x0y1_ = Vector3ToFloat3(x0y1);
    x1y0_ = Vector3ToFloat3(x1y0);
    x1y1_ = Vector3ToFloat3(x1y1);

    ogreWorld->DebugDrawLine(x0y0_, x1y0_, Color::Yellow);
    ogreWorld->DebugDrawLine(x1y0_, x1y1_, Color::Yellow);
    ogreWorld->DebugDrawLine(x1y1_, x0y1_, Color::Yellow);
    ogreWorld->DebugDrawLine(x0y1_, x0y0_, Color::Yellow);
}
Exemple #5
0
void PhysicsWorld::DrawDebugGeometry()
{
    if (!IsDebugGeometryEnabled())
        return;

    PROFILE(PhysicsModule_DrawDebugGeometry);
    
    // Draw debug only for the active (visible) scene
    OgreWorldPtr ogreWorld = scene_.lock()->GetWorld<OgreWorld>();
    cachedOgreWorld_ = ogreWorld.get();
    if (!ogreWorld)
        return;
    if (!ogreWorld->IsActive())
        return;
    
    // Get all lines of the physics world
    world_->debugDrawWorld();
}