-
Notifications
You must be signed in to change notification settings - Fork 26
Actor
Alessandro Febretti edited this page Jan 18, 2015
·
5 revisions
Actors can be used to modularize interaction and animation in an omegalib script. Each actor has its own update, event and command handler callbacks and can be derived from a python class to define custom behaviors.
Method(s) | Description |
---|---|
kill() |
Kills this actor. The dispose() callback will be invoked as part of the kill process. |
setSceneNode(SceneNode node) SceneNode getSceneNode()
|
Gets or sets the scene node this actor will control. Actors do not need to be attached to a scene node, this method is optional and just here for convenience. |
setUpdateEnabled(bool enabled) , bool isUpdateEnabled()
|
Gets or sets the update enabled flag. When set to true, this Actor update callback will be called for each frame. |
setEventsEnabled(bool enabled) , bool areEventsEnabled()
|
Gets or sets the events enabled flag. When set to true, this Actor event callback will be called for each received event. |
setCommandsEnabled(bool enabled) , bool areCommandsEnabled()
|
Gets or sets the commands enabled flag. When set to true, this Actor event callback will be called for each received quick command. See the QuickCommands page for more information. |
Callbacks | |
onUpdate(int frame, float time, float dt) |
The frame update callback |
onEvent(Event e) |
The event handling callback |
onCommand(string command) |
The command handling callback |
dispose() |
Called after this actor is killed. |
- Basic example https://gist.github.com/febret/58cb73b8b98a3f238a62
- Actor picking https://gist.github.com/febret/6314793