// Input Observer Interface void dmz::EntityPluginPortalFollow3D::update_channel_state ( const Handle Channel, const Boolean State) { _active += State ? 1 : -1; if (_active == 1) { if (_history) { delete []_history; _history = 0; } _history = new Matrix[_HistoryCount > 0 ? _HistoryCount : 1]; _which = 0; ObjectModule *module = get_object_module (); if (module && _hilAttrHandle) { Matrix ori; module->lookup_orientation (_hil, _defaultHandle, ori); for (Int32 ix = 0; ix < _HistoryCount; ix++) { _history[ix] = ori; } } start_time_slice (); } else if (_active == 0) { stop_time_slice (); } }
// Input Observer Interface void dmz::EntityPluginFreeFly::update_channel_state ( const Handle Channel, const Boolean State) { _active += State ? 1 : - 1; if (_active == 1) { start_time_slice (); } else if (_active == 0) { stop_time_slice (); } }
//! \cond dmz::EntityPluginDeadTimer::EntityPluginDeadTimer ( const PluginInfo &Info, Config &local) : Plugin (Info), TimeSlice (Info, TimeSliceTypeRuntime, TimeSliceModeSingle, 2.0), ObjectObserverUtil (Info, local), _log (Info), _hil (0), _hilHandle (0), _defaultHandle (0) { stop_time_slice (); _init (local); }
//! \cond dmz::EntityPluginFreeFly::EntityPluginFreeFly ( const PluginInfo &Info, Config &local) : Plugin (Info), TimeSlice (Info), ObjectObserverUtil (Info, local), InputObserverUtil (Info, local), _handle (0), _defaultHandle (0), _hilHandle (0), _isect (0), _active (0), _log (Info.get_name (), Info.get_context ()) { stop_time_slice (); _init (local); }
//! \cond dmz::EntityPluginPortalFollow3D::EntityPluginPortalFollow3D ( const PluginInfo &Info, Config &local) : Plugin (Info), TimeSlice (Info), ObjectObserverUtil (Info, local), InputObserverUtil (Info, local), _HistoryCount (config_to_int32 ("history-count.value", local, 10)), _hil (0), _defaultHandle (0), _hilAttrHandle (0), _history (0), _which (0), _offset (0.0, 2.5, 10.0), _portal (0), _active (0), _log (Info) { stop_time_slice (); _init (local); }
void dmz::ArchivePluginAutoSave::_init (Config &local) { Definitions defs (get_plugin_runtime_context ()); _saveFile = config_to_string ("save.file", local, _appState.get_autosave_file ()); if (_saveFile) { set_time_slice_interval ( config_to_float64 ("save.rate", local, get_time_slice_interval ())); _archiveHandle = defs.create_named_handle ( config_to_string ("archive.name", local, ArchiveDefaultName)); } else { _log.warn << "No auto save file specified. Auto save disabled." << endl; stop_time_slice (); } }