Wouldn't it be nice to make Irrlicht's scene manager event/task driven ?
Currently, the engine renders, transforms, animates scene nodes every frame. But we can raise events when something changes, generate and process new tasks only when it's needed ( much like in OSes ).
For example:
Code: Select all
void mxSceneNode::SetPosition( const Vec3D& newPosition )
{
m_vPosition = newPosition;
PostEvent( ESceneEvent::EVENT_Traslation_Changed, this );
}
Thus we would be able to save a lot of processor cycles. We don't have to make a full-blown task class, a simple 'switch' will do the job:
Code: Select all
/* ... */
case ESceneEvent::EVENT_Camera_Moved :
{
mxCameraNode * pCameraNode = static_cast< mxCameraNode* >( pNode );
pCameraNode->RecalculateViewMatrix();
pNode->SetPosition( pCameraNode->GetView().Position );
}
break;
/* ... */
Code: Select all
if ( m_taskList.Num() > 0 ) {
m_pSceneProcessor = & m_pRenderFrameProcessor;
} else {
m_pSceneProcessor = & m_pOnIdleProcessor;
}
If the scene doesn't change we will have minimal system load.
Is it a good idea to implement in Irrlicht or not ?
( i'm fairly new to the fascinating field of computer graphics and i know little of the subject. And i like Irrlicht because it's very easy to use (and so it attracts many users) and has a friendly community. And sorry for my english. )