Beispiel #1
0
        private void PreRender()
        {
            if (_needsRender == true)
            {
                _world.InitFromMap(null);

                idDict spawnArgs = new idDict();
                spawnArgs.Set("classname", "light");
                spawnArgs.Set("name", "light_1");
                spawnArgs.Set("origin", _lightOrigin);
                spawnArgs.Set("_color", _lightColor);

                idConsole.Warning("TODO: lighting");

                /*gameEdit->ParseSpawnArgsToRenderLight(&spawnArgs, &rLight);
                 * lightDef = world->AddLightDef(&rLight);
                 * if(!modelName[0])
                 * {
                 *      common->Warning("Window '%s' in gui '%s': no model set", GetName(), GetGui()->GetSourceFile());
                 * }*/

                spawnArgs.Clear();
                spawnArgs.Set("classname", "func_static");
                spawnArgs.Set("model", _modelName);
                spawnArgs.Set("origin", _modelOrigin);

                _worldEntity = idE.GameEdit.ParseSpawnArgsToRenderEntity(spawnArgs);

                if (_worldEntity.Model != null)
                {
                    Vector3 v = _modelRotate.ToVector3();

                    _worldEntity.Axis = v.ToMatrix();
                    _worldEntity.MaterialParameters[0] = 1;
                    _worldEntity.MaterialParameters[0] = 1;
                    _worldEntity.MaterialParameters[0] = 1;
                    _worldEntity.MaterialParameters[0] = 1;

                    _renderEntity = _world.AddEntityDefinition(_worldEntity);
                }

                _needsRender.Set(false);
            }
        }
Beispiel #2
0
        protected override void ClearData()
        {
            base.ClearData();

            _dict.Clear();
        }
		private void PreRender()
		{
			if(_needsRender == true)
			{
				_world.InitFromMap(null);

				idDict spawnArgs = new idDict();
				spawnArgs.Set("classname", "light");
				spawnArgs.Set("name", "light_1");
				spawnArgs.Set("origin", _lightOrigin);
				spawnArgs.Set("_color", _lightColor);

				idConsole.Warning("TODO: lighting");
			
				/*gameEdit->ParseSpawnArgsToRenderLight(&spawnArgs, &rLight);
				lightDef = world->AddLightDef(&rLight);
				if(!modelName[0])
				{
					common->Warning("Window '%s' in gui '%s': no model set", GetName(), GetGui()->GetSourceFile());
				}*/

				spawnArgs.Clear();
				spawnArgs.Set("classname", "func_static");
				spawnArgs.Set("model", _modelName);
				spawnArgs.Set("origin", _modelOrigin);

				_worldEntity = idE.GameEdit.ParseSpawnArgsToRenderEntity(spawnArgs);

				if(_worldEntity.Model != null)
				{
					Vector3 v = _modelRotate.ToVector3();

					_worldEntity.Axis = v.ToMatrix();
					_worldEntity.MaterialParameters[0] = 1;
					_worldEntity.MaterialParameters[0] = 1;
					_worldEntity.MaterialParameters[0] = 1;
					_worldEntity.MaterialParameters[0] = 1;

					_renderEntity = _world.AddEntityDefinition(_worldEntity);
				}

				_needsRender.Set(false);
			}
		}