Skip to content

Latest commit

 

History

History
66 lines (32 loc) · 1.93 KB

api_simulator.rst

File metadata and controls

66 lines (32 loc) · 1.93 KB

Simulator

version(str)

The current Mechanica version, as a string.

The Simulator is the entry point to simulation, this is the very first object that needs to be initialized before any other method can be called. All the methods of the Simulator are static, but the constructor needs to be called first to initialize everything.

The Simulator manages all of the operating system interface, it manages window creation, end user input events, GPU access, threading, inter-process messaging and so forth. All 'physical' modeling concepts to in the Universe object.

Simulator.__init__(self, conf=None, **kwargs)

The Simulator(...) construtor call is really just a synonum for the main init function. We keep this call here as earlier versions used this as the init.

run()

alias to top level mechanica.run function.

irun()

alias to top level mechanica.irun function.

close()

alias to top level mechanica.close function.

show()

alias to top level mechanica.show function.

An object that has all the arguments to the simulator,

Event / Message Processing

void glfwPollEvents ( void ) This function processes only those events that are already in the event queue and then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.

On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback to redraw the contents of your window when necessary during such operations.