Wednesday, August 8, 2007

Wind in my sails

While things have been pretty quiet recently, I've been getting things done, albeit to an empty theater. There are now several field types that work. While building them, I've added several features to the field system. There are now four functions that can be either defined or not:
  • int _apply()
    • This function performs the field activation for universal fields (fields not confined to one area).
  • int _exert(other)
    • This function is called when a field must be applied to a body it effects. Its return value indicates whether exertion was final (i.e. does not need _commit() to be called).
  • void _give(mode)
    • At the beginning of each field cycle, this function is called. As for mode, 1 means we're in a physics cycle, 0 means we're in a universal cycle.
  • void _commit()
    • At the end of each physics cycle, this function is called if _exert ever returned 0 (for non-completeness). In the non-collide physics cycle (for universal fields), the Field._apply() function performs a vital part here - careful while overriding it.
This summarizes the API of sorts that I've built for making fields.

No comments: