Exemplo n.º 1
0
    /// Update all the objects and render
    /// @param dt the time to increment by
    void SimContext::ProcessTick(float32_t dt)
    {
        // This will cause Irrlicht to render the objects
        UpdateRenderSystem(dt);
        
        // clear our lineset
        LineSet::instance().ClearSegments();

        // This will look at any input from the user that happened since the 
        // previous call and run the corresponding (Python) actions. This can
        // potentially change a lot of things such as which mod we want to run.
        UpdateInputSystem(dt);

        // Call the ProcessTick method of the global AI manager
        AIManager::instance().ProcessTick(dt);

        // This will loop through all the objects in the simulation, calling
        // their ProcessTick method. We need to know the actual position of
        // each object before this, and we will know the desired position after this.
        UpdateSimulation(dt);

        // This will trigger scheduled events in the Python script,
        // as well as ModTick(dt) if it is defined
        UpdateScriptingSystem(dt);
    }
Exemplo n.º 2
0
    /// Update all the objects and render
    /// @param dt the time to increment by
    void SimContext::ProcessAnimationTick(float32_t dt, float32_t frac)
    {
        // This will cause Irrlicht to render the objects
        UpdateRenderSystem(dt);

        // This will look at any input from the user that happened since the 
        // previous call and run the corresponding (Python) actions. This can
        // potentially change a lot of things such as which mod we want to run.
        UpdateInputSystem(dt);
        
        // update the simulation
        if( mpSimulation )
        {
            mpSimulation->ProcessAnimationTick(frac);
        }
    }
void CForceFeedBackSystem::Update( float frameTime )
{
	SFFOutput forceFeedback;
	SFFTriggerOutputData triggerForceFeedback;

	// If the game is paused then we must not apply force feedback, otherwise
	// it might be left on whilst the game is paused
	if(gEnv->pSystem->IsPaused() == false && frameTime > 0.001f)
	{
		TActiveEffectsArray::iterator activeEffectIt = m_activeEffects.begin();

		while (activeEffectIt != m_activeEffects.end())
		{
			SActiveEffect& currentEffect = *activeEffectIt;

			forceFeedback += currentEffect.Update(frameTime);

			if (!currentEffect.HasFinished())
			{
				++activeEffectIt;
			}
			else
			{
				TActiveEffectsArray::iterator next = m_activeEffects.erase(activeEffectIt);
				activeEffectIt = next;
			}
		}

		forceFeedback += m_frameCustomForceFeedback;
		// DARIO_NOTE: so far designers do not want patters loaded from XML so all the data come direclty from 
		// FlowGraph nodes
		triggerForceFeedback += m_triggerCustomForceFeedBack; 
		m_frameCustomForceFeedback.ZeroIt();
		m_triggerCustomForceFeedBack.Init(SFFTriggerOutputData::Initial::ZeroIt);
	}

	UpdateInputSystem(forceFeedback.GetClampedFFA(), forceFeedback.GetClampedFFB(), triggerForceFeedback);

	CForceFeedBackSystemDebug::DebugFFOutput((m_cvars.ffs_debug != 0), forceFeedback.GetClampedFFA(), forceFeedback.GetClampedFFB(), triggerForceFeedback);
}
void CForceFeedBackSystem::StopAllEffects()
{
	m_activeEffects.clear();

	UpdateInputSystem(0.0f, 0.0f, SFFTriggerOutputData(SFFTriggerOutputData::Initial::ZeroIt));
}