Example #1
0
void ETHScene::Update(
	const unsigned long lastFrameElapsedTime,
	const ETHBackBufferTargetManagerPtr& backBuffer,
	asIScriptFunction* onUpdateCallbackFunction)
{
	m_destructorManager->RunDestructors();
	m_physicsSimulator.Update(lastFrameElapsedTime);

	// update entities that are always active (dynamic entities with callback or physics and temporary entities)
	m_activeEntityHandler.UpdateAlwaysActiveEntities(GetZAxisDirection(), m_buckets, lastFrameElapsedTime);

	// Run onSceneUpdate functon
	if (onUpdateCallbackFunction)
		ETHGlobal::ExecuteContext(m_pContext, onUpdateCallbackFunction);

	// start mapping process
	float minHeight, maxHeight;

	assert(m_renderingManager.IsEmpty());

	// fill a map containing all entities we should render
	MapEntitiesToBeRendered(
		minHeight,
		maxHeight,
		backBuffer);

	// update static mapped entities that weren't called in UpdateAlwaysActiveEntities
	m_activeEntityHandler.UpdateCurrentFrameEntities(GetZAxisDirection(), m_buckets, lastFrameElapsedTime);

	m_minSceneHeight = minHeight;
	m_maxSceneHeight = maxHeight;

	Randomizer::Seed(m_provider->GetVideo()->GetElapsedTime());
}
Example #2
0
void ETHScene::Update(
	const unsigned long lastFrameElapsedTime,
	const ETHBackBufferTargetManagerPtr& backBuffer)
{
	m_destructorManager->RunDestructors();
	m_physicsSimulator.Update(lastFrameElapsedTime);

	float minHeight, maxHeight;

	assert(m_renderingManager.IsEmpty());

	// fill a map containing all entities we should render
	MapEntitiesToBeRendered(
		minHeight,
		maxHeight,
		backBuffer);

	m_activeEntityHandler.UpdateActiveEntities(GetZAxisDirection(), m_buckets, lastFrameElapsedTime);

	m_minSceneHeight = minHeight;
	m_maxSceneHeight = maxHeight;

	Randomizer::Seed(m_provider->GetVideo()->GetElapsedTime());
}