SimApi Control getCurrentFrameNumber

From SIMboxWiki
Revision as of 20:23, 20 December 2010 by Seanjarvis (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search



Icon attributes.pngstatic int SimApi::Control::getCurrentFrameNumber()

    Description

    Gets the number of simulation frames passed since simulation started.

    Return

    Type: int   Description: The number of frames passed since simulation started.

    Remarks
    

A frame is a simulation loop that updates the simulation. Every frame performs an update call that initiates various components:

1. All LOCs, COCs, OOCs and Extension update functions are called (assuming the update interval in the component is for every frame).

2. Graphic engine rendering update. In general, we would like to have highest possible number of frames per second (FPS). When implementing an Object Component we would like to avoid, if possible, the use of the update function. Over usage of the update mechanism will reduce the number of frames per second (FPS). Low FPS will usually cause the simulation graphics to be seen as not smooth. The recommended way is to use the attribute change mechanism which is event based and not interval based.

Of course, some components require the update mechanism. These components usually need to sample some values that change constantly such as aircraft or vehicle entity location.


    See Also

    setRate

    getRate