コード例 #1
0
ファイル: Viewport.cpp プロジェクト: kevindqc/Helium
void Viewport::LoadSettings(SceneGraph::ViewportSettings* prefs)
{
	// apply settings for all modes that we have... 
	for(size_t i = 0; i < prefs->m_CameraPrefs.size(); ++i)
	{
		CameraSettingsPtr cameraPrefs = prefs->m_CameraPrefs[i]; 
		CameraMode mode = cameraPrefs->m_CameraMode; 
		SceneGraph::Camera* camera = GetCameraForMode(mode); 
		camera->LoadSettings(cameraPrefs); 
	}

	SetCameraMode( prefs->m_CameraMode ); 
	SetGeometryMode( prefs->m_GeometryMode ); 
	SetHighlighting( prefs->m_Highlighting ); 
	SetAxesVisible( prefs->m_AxesVisible ); 
	SetGridVisible( prefs->m_GridVisible ); 
	SetBoundsVisible( prefs->m_BoundsVisible ); 
	SetStatisticsVisible( prefs->m_StatisticsVisible ); 
}
コード例 #2
0
ファイル: Viewport.cpp プロジェクト: kevindqc/Helium
void Viewport::SaveSettings(SceneGraph::ViewportSettings* prefs)
{
	// just blow away the previous preferences
	prefs->m_CameraPrefs.clear(); 

	for(int i = 0; i < CameraMode::Count; ++i)
	{
		CameraMode mode = static_cast< CameraMode::Enum >( i ); 
		CameraSettingsPtr cameraPrefs = new CameraSettings(); 
		cameraPrefs->m_CameraMode = mode;
		SceneGraph::Camera* camera = GetCameraForMode( mode ); 
		camera->SaveSettings(cameraPrefs); 
		prefs->m_CameraPrefs.push_back( cameraPrefs ); 
	}

	prefs->m_CameraMode = GetCameraMode(); 
	prefs->m_GeometryMode = GetGeometryMode(); 
	prefs->m_Highlighting = IsHighlighting(); 
	prefs->m_AxesVisible = IsAxesVisible(); 
	prefs->m_GridVisible = IsGridVisible(); 
	prefs->m_BoundsVisible = IsBoundsVisible(); 
	prefs->m_StatisticsVisible = IsStatisticsVisible(); 
}
コード例 #3
0
ファイル: ForceRenderer.cpp プロジェクト: jkhoogland/magnum
template<UnsignedInt dimensions> void ForceRenderer<dimensions>::draw(const MatrixTypeFor<dimensions, Float>& transformationMatrix, SceneGraph::Camera<dimensions, Float>& camera) {
    _shader->setTransformationProjectionMatrix(camera.projectionMatrix()*Implementation::forceRendererTransformation<dimensions>(transformationMatrix.transformPoint(_forcePosition), _force)*MatrixTypeFor<dimensions, Float>::scaling(VectorTypeFor<dimensions, Float>{_options->scale()}))
        .setColor(_options->color());
    _mesh->draw(*_shader);
}
コード例 #4
0
ファイル: ShapeRenderer.cpp プロジェクト: Ali-Wassouf/magnum
template<UnsignedInt dimensions> void ShapeRenderer<dimensions>::draw(const MatrixTypeFor<dimensions, Float>&, SceneGraph::Camera<dimensions, Float>& camera) {
    const MatrixTypeFor<dimensions, Float> projectionMatrix = camera.projectionMatrix()*camera.cameraMatrix();
    for(auto i: _renderers) i->draw(_options, projectionMatrix);
}
コード例 #5
0
ファイル: ObjectRenderer.cpp プロジェクト: Ali-Wassouf/magnum
template<UnsignedInt dimensions> void ObjectRenderer<dimensions>::draw(const MatrixTypeFor<dimensions, Float>& transformationMatrix, SceneGraph::Camera<dimensions, Float>& camera) {
    _shader->setTransformationProjectionMatrix(camera.projectionMatrix()*transformationMatrix*MatrixTypeFor<dimensions, Float>::scaling(VectorTypeFor<dimensions, Float>{_options->size()}));
    _mesh->draw(*_shader);
}