当前位置: 首页>>代码示例>>C++>>正文


C++ CamWndPtr类代码示例

本文整理汇总了C++中CamWndPtr的典型用法代码示例。如果您正苦于以下问题:C++ CamWndPtr类的具体用法?C++ CamWndPtr怎么用?C++ CamWndPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CamWndPtr类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getActiveCamWnd

void GlobalCameraManager::changeFloorDown(const cmd::ArgumentList& args) {
	CamWndPtr camWnd = getActiveCamWnd();
	if (camWnd == NULL) return;

	// Pass the call to the currently active CamWnd 
	camWnd->changeFloor(false);
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例2: update

void GlobalCameraManager::update() {
	// Issue the update call to all cameras
	for (CamWndMap::iterator i = _cameras.begin(); i != _cameras.end(); /* in-loop */ ) {
		CamWndPtr cam = i->second.lock();

		if (cam != NULL) {
			cam->update();
			++i;
		}
		else {
			_cameras.erase(i++);
		}
	}
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例3: rMessage

void MapPosition::store(const cmd::ArgumentList& args) {
    rMessage() << "Storing map position #" << _index << std::endl;
    CamWndPtr camwnd = GlobalCamera().getActiveCamWnd();

    if (camwnd != NULL) {
        _position = camwnd->getCameraOrigin();
        _angle = camwnd->getCameraAngles();

        // Tag the map as modified
        GlobalMap().setModified(true);
    }
    else {
        rError() << "MapPosition: Warning: Couldn't find Camera." << std::endl;
    }
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:15,代码来源:MapPosition.cpp

示例4: GlobalRegistry

/* greebo: Saves the current camera position/angles to worldspawn
 */
void Map::saveCameraPosition() {
    const std::string keyLastCamPos = GlobalRegistry().get(RKEY_LAST_CAM_POSITION);
    const std::string keyLastCamAngle = GlobalRegistry().get(RKEY_LAST_CAM_ANGLE);

    if (m_world_node != NULL) {
        // Retrieve the entity from the worldspawn node
        Entity* worldspawn = Node_getEntity(m_world_node);
        assert(worldspawn != NULL); // This must succeed

        CamWndPtr camWnd = GlobalCamera().getActiveCamWnd();
        if (camWnd == NULL) return;

        worldspawn->setKeyValue(keyLastCamPos,
                                string::to_string(camWnd->getCameraOrigin()));
        worldspawn->setKeyValue(keyLastCamAngle,
                                string::to_string(camWnd->getCameraAngles()));
    }
}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:20,代码来源:Map.cpp

示例5: GlobalEventManager

// Handles the mouseDown event, basically determines which action should be performed (select or manipulate)
void RadiantWindowObserver::onMouseDown(const WindowVector& position, GdkEventButton* ev)
{
	// Retrieve the according ObserverEvent for the GdkEventButton
	ui::ObserverEvent observerEvent = GlobalEventManager().MouseEvents().getObserverEvent(ev);

	// Check if the user wants to copy/paste a texture
	if (observerEvent == ui::obsCopyTexture || observerEvent == ui::obsPasteTextureProjected ||
		observerEvent == ui::obsPasteTextureNatural || observerEvent == ui::obsPasteTextureCoordinates ||
		observerEvent == ui::obsPasteTextureToBrush || observerEvent == ui::obsJumpToObject)
	{
		// Get the mouse position
		DeviceVector devicePosition(device_constrained(window_to_normalised_device(position, _width, _height)));

		// Check the target object
		render::View scissored(*_selectObserver._view);
		ConstructSelectionTest(scissored, Rectangle::ConstructFromPoint(devicePosition, _selectObserver._epsilon));
		SelectionVolume volume(scissored);

		// Do we have a camera view (fill() == true)?
		if (_selectObserver._view->fill())
		{
			if (observerEvent == ui::obsJumpToObject) {
				CamWndPtr cam = GlobalCamera().getActiveCamWnd();
				if (cam != NULL) {
					cam->jumpToObject(volume);
				}
			}
			// If the apply texture modifier is held
			else if (observerEvent == ui::obsPasteTextureProjected) {
				// Paste the shader projected (TRUE), but not to an entire brush (FALSE)
				selection::algorithm::pasteShader(volume, true, false);
			}
			// If the copy texture modifier is held
			else if (observerEvent == ui::obsCopyTexture) {
				// Set the source texturable from the given test
				GlobalShaderClipboard().setSource(volume);
			}
			else if (observerEvent == ui::obsPasteTextureNatural) {
				// Paste the shader naturally (FALSE), but not to an entire brush (FALSE)
				selection::algorithm::pasteShader(volume, false, false);
			}
			else if (observerEvent == ui::obsPasteTextureCoordinates) {
				// Clone the texture coordinates from the patch in the clipboard
				selection::algorithm::pasteTextureCoords(volume);
			}
			else if (observerEvent == ui::obsPasteTextureToBrush) {
				// Paste the shader projected (TRUE), and to the entire brush (TRUE)
				selection::algorithm::pasteShader(volume, true, true);
			}
		}
	}

	// Have any of the "selection" events occurred?
	// greebo: This could be an "else if (observerEvent != obsNothing)" as well,
	// but perhaps there will be more events in the future that aren't selection events.
	if (observerEvent == ui::obsManipulate || observerEvent == ui::obsSelect ||
		observerEvent == ui::obsToggle || observerEvent == ui::obsToggleFace ||
		observerEvent == ui::obsToggleGroupPart ||
		observerEvent == ui::obsReplace || observerEvent == ui::obsReplaceFace)
	{
		_mouseDown = true;

		// Determine the current mouse position
		DeviceVector devicePosition(window_to_normalised_device(position, _width, _height));

		if (observerEvent ==  ui::obsManipulate && _manipulateObserver.mouseDown(devicePosition)) {
			// This is a manipulation operation, register the callbacks
			// Note: the mouseDown call in the if clause returned already true,
			// so a manipulator could be successfully selected
			_mouseMotionCallback = boost::bind(&ManipulateObserver::mouseMoved, &_manipulateObserver, _1);
			_mouseUpCallback = boost::bind(&ManipulateObserver::mouseUp, &_manipulateObserver, _1);

			_listenForCancelEvents = true;
		}
		else {
			// Call the mouseDown method of the selector class, this covers all of the other events
			_selectObserver.mouseDown(devicePosition);

			_mouseMotionCallback = boost::bind(&SelectObserver::mouseMoved, &_selectObserver, _1);
			_mouseUpCallback = boost::bind(&SelectObserver::mouseUp, &_selectObserver, _1);

			// greebo: the according actions (toggle face, replace, etc.) are handled in the mouseUp methods.
		}
	}
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:86,代码来源:RadiantWindowObserver.cpp


注:本文中的CamWndPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。