Ejemplo n.º 1
0
static void DisplayFunc(void)
{
	PreDisplay();

	if (dvel) DrawVelocity();
	else		DrawDensity();

	PostDisplay();
}
Ejemplo n.º 2
0
static void DisplayFunc()
{
	PreDisplay();

	if (DisplayVel)
	{
		DrawVelocity();
	}
	else
	{
		DrawDensity();
	}

	PostDisplay();
}
Ejemplo n.º 3
0
/*
================
idPhysics_RigidBody::DebugDraw
================
*/
void idPhysics_RigidBody::DebugDraw( void ) {
	if( rb_showBodies.GetBool() || ( rb_showActive.GetBool() && current.atRest < 0 ) ) {
		collisionModelManager->DrawModel( clipModel->Handle(), clipModel->GetOrigin(), clipModel->GetAxis(), vec3_origin, 0.0f );
	}
	if( rb_showMass.GetBool() ) {
		gameRenderWorld->DrawText( va( "\n%1.2f", mass ), current.i.position, 0.08f, colorCyan, gameLocal.GetLocalPlayer()->viewAngles.ToMat3(), 1 );
	}
	if( rb_showInertia.GetBool() ) {
		idMat3 &I = inertiaTensor;
		gameRenderWorld->DrawText( va( "\n\n\n( %.1f %.1f %.1f )\n( %.1f %.1f %.1f )\n( %.1f %.1f %.1f )",
									   I[0].x, I[0].y, I[0].z,
									   I[1].x, I[1].y, I[1].z,
									   I[2].x, I[2].y, I[2].z ),
								   current.i.position, 0.05f, colorCyan, gameLocal.GetLocalPlayer()->viewAngles.ToMat3(), 1 );
	}
	if( rb_showVelocity.GetBool() ) {
		DrawVelocity( clipModel->GetId(), 0.1f, 4.0f );
	}
}
Ejemplo n.º 4
0
//------------------------------------------------------------------------------
void NBodyWnd::Render()
{
    static long ct = 0;
    if (!(m_flags & dspPAUSE))
    {
        ++ct;

        if (m_bDumpImage && ct%5==0)
            SaveToTGA();
    }

    glClear(GL_COLOR_BUFFER_BIT  | GL_DEPTH_BUFFER_BIT);

    Vec3D orient;
    switch (m_camOrient)
    {
    // Default orientation
    case 0:
        orient.x = 0;
        orient.y = 1;
        orient.z = 0;
        break;

    // Rotate with galaxy core
    case 1:
    {
        Vec2D p1 = m_galaxy.GetStarPos(0),
              p2 = m_galaxy.GetStarPos(1);
        orient.x = p2.x - p1.x;
        orient.y = p2.y - p1.y;
        orient.z = 0;
    }
    break;

    // Rotate with edge of disk
    case 2:
    {
        Vec2D p1 = m_galaxy.GetStarPos(0),
              p2 = m_galaxy.GetStarPos(2);
        orient.x = p2.x - p1.x;
        orient.y = p2.y - p1.y;
        orient.z = 0;
    }
    break;
    }

    Vec3D lookAt(0, 0, 0),
          pos(0, 0, 5000);
    SetCamera(pos, lookAt, orient);

    if (!(m_flags & dspPAUSE))
    {
        m_galaxy.SingleTimeStep(100000); // time in years
    }

    if (m_flags & dspAXIS)
        DrawAxis(Vec2D(0, 0));

    if (m_flags & dspDENSITY_WAVES)
        DrawDensityWaves(50, m_galaxy.GetFarFieldRad());

    if (m_flags & dspSTAT)
        DrawStat();

    if (m_flags & dspDUST)
        DrawDust();

    if (m_flags & dspH2)
        DrawH2();

    if (m_flags & dspSTARS)
        DrawStars();

    if (m_flags & dspRADII)
        DrawGalaxyRadii();

    if (m_flags & dspVELOCITY)
        DrawVelocity();

    if (m_flags & dspHELP)
        DrawHelp();

    SDL_GL_SwapBuffers();
}