예제 #1
0
dmz::Handle
dmz::EventModuleCommonBasic::create_open_launch_event (
      const Handle MunitionsHandle,
      const Handle TargetHandle) {

   Handle result (0);

   if (_launchType && _eventMod && _objMod) {

      result = _eventMod->create_event (_launchType, EventLocal);

      if (result) {

         _eventMod->store_object_handle (
            result,
            _sourceHandle,
            _get_source (MunitionsHandle));

         _eventMod->store_object_handle (result, _munitionsHandle, MunitionsHandle);
         _eventMod->store_object_handle (result, _targetHandle, TargetHandle);

         Vector pos;
         if (_objMod->lookup_position (MunitionsHandle, _defaultObjectHandle, pos)) {

            _eventMod->store_position (result, _defaultEventHandle, pos);
         }

         Vector vel;
         if (_objMod->lookup_velocity (MunitionsHandle, _defaultObjectHandle, vel)) {

            _eventMod->store_velocity (result, _defaultEventHandle, vel);
         }
      }
   }

   return result;
}
예제 #2
0
	erase_program(const example_params& params)
	 : program(build_program(_get_source(params)))
	{
		gl.use(*this);
		gl.query_location(projection, *this, "Projection");
	}