示例#1
0
        private void CreateGLBTestObject()
        {
            Immovable mattest = new Immovable();

            mattest.SetModel("MatTest");
            mattest.SetPosition(-3, 1, 5);
            mattest.IsShadowCaster = true;
            mattest.SetScale(1f);
            //mattest.SetSpecularReflectionEnabled(true);
            AddGameObject(mattest);

            Immovable mattest255 = new Immovable();

            mattest255.SetModel("MatTest255");
            mattest255.SetPosition(-7, 1, 5);
            mattest255.IsShadowCaster = true;
            mattest255.SetScale(1f);
            //mattest255.SetSpecularReflectionEnabled(true);
            AddGameObject(mattest255);

            Immovable kwcube6test = new Immovable();

            kwcube6test.SetModel("KWCube6");
            kwcube6test.SetPosition(-5, -0.5f, 5);
            kwcube6test.SetScale(10, 1, 10);
            kwcube6test.SetTexture(@".\textures\pavement01.jpg", TextureType.Albedo, CubeSide.Top);
            kwcube6test.SetTexture(@".\textures\pavement01_normal.jpg", TextureType.Normal, CubeSide.Front);
            kwcube6test.SetTextureRepeat(5, 1, CubeSide.Front);
            AddGameObject(kwcube6test);
        }
示例#2
0
        public override void Prepare()
        {
            KWEngine.LoadModelFromFile("AK47", @".\models\ak47.obj");

            DebugShowPerformanceInTitle = PerformanceUnit.FramesPerSecond;
            FOV = 90;
            SetAmbientLight(1, 1, 1, 0.5f);

            Player p = new Player();

            p.SetModel("KWCube");
            p.SetScale(1, 2, 1);
            p.SetPosition(0, 1, 0);
            p.IsCollisionObject = true;
            p.FPSEyeOffset      = 0;
            AddGameObject(p);
            SetFirstPersonObject(p);

            Immovable floor = new Immovable();

            floor.SetModel("KWCube");
            floor.SetScale(50, 2, 50);
            floor.SetPosition(0, -1, 0);
            floor.IsCollisionObject = true;
            floor.IsShadowCaster    = true;
            floor.SetTexture(@".\textures\sand_diffuse.dds");
            floor.SetTextureRepeat(10, 10);
            AddGameObject(floor);

            Immovable shadowCaster = new Immovable();

            shadowCaster.SetModel("KWCube");
            shadowCaster.IsShadowCaster = true;
            shadowCaster.SetPosition(0, 3, 2);
            shadowCaster.SetScale(2);
            shadowCaster.SetTexture(@".\textures\mpanel_diffuse.dds");
            AddGameObject(shadowCaster);

            SetFirstPersonObjectItemModel("AK47", true, true);
            SetFirstPersonObjectItemModelViewOffset(0.5f, -1, 0f);
            SetFirstPersonObjectItemModelRotation(0, 0, 0);
            SetFirstPersonObjectItemModelScale(1.25f);

            SetTextureSkybox(@".\textures\skybox3.dds");

            LightObject l1 = new LightObject(LightType.Sun, true);

            l1.SetPosition(50, 100, 50);
            l1.SetColor(1, 0, 0, 5);
            //l1.SetDistanceMultiplier(10);
            AddLightObject(l1);

            //DebugShadowLight = l1;
        }
示例#3
0
        public override void Prepare()
        {
            FOV = 90;



            KWEngine.LoadModelFromFile("ArenaOuter", @".\Models\ArenaOuter\ArenaOuter.fbx");
            KWEngine.LoadModelFromFile("ArenaPlatform", @".\Models\ArenaOuter\ArenaPlatform.obj");
            KWEngine.LoadModelFromFile("ArenaPlatforms", @".\Models\ArenaOuter\ArenaPlatforms.fbx");
            KWEngine.LoadModelFromFile("AK47", @".\models\ak47.obj");

            KWEngine.BuildTerrainModel("Arena", @".\textures\heightmapArena.png", @".\textures\sand_diffuse.dds", 150, 10, 150, 7.5f, 7.5f);
            Immovable terra = new Immovable();

            terra.SetModel("Arena");
            terra.SetPosition(0, -0.5f, 0);
            terra.IsShadowCaster = true;
            terra.SetTexture(@".\textures\sand_normal.dds", TextureType.Normal);
            AddGameObject(terra);


            Immovable floor = new Immovable();

            floor.SetModel("KWCube");
            floor.SetScale(80, 5, 80);
            floor.SetPosition(0, -2.5f, 0);
            floor.SetTextureRepeat(5, 5);
            floor.IsCollisionObject = true;
            floor.IsShadowCaster    = true;
            floor.SetTexture(@".\textures\sand_diffuse.dds");
            floor.SetTexture(@".\textures\sand_normal.dds", TextureType.Normal);
            AddGameObject(floor);

            Immovable arenaOuter = new Immovable();

            arenaOuter.SetModel("ArenaOuter");
            arenaOuter.IsCollisionObject = true;
            arenaOuter.IsShadowCaster    = true;
            AddGameObject(arenaOuter);


            Immovable arenaPlatforms = new Immovable();

            arenaPlatforms.SetModel("ArenaPlatforms");
            arenaPlatforms.IsCollisionObject = true;
            arenaPlatforms.IsShadowCaster    = true;
            AddGameObject(arenaPlatforms);

            PlatformUpDown testPlatform = new PlatformUpDown();

            testPlatform.SetModel("ArenaPlatform");
            testPlatform.SetScale(1.5f);
            testPlatform.SetMetalness(1);
            testPlatform.SetRoughness(0.5f);
            testPlatform.SetPosition(15, 1.5f, 0);
            testPlatform.IsCollisionObject = true;
            testPlatform.IsShadowCaster    = true;
            AddGameObject(testPlatform);


            _player = new Player();
            _player.SetModel("KWCube");
            _player.SetScale(1, 2, 1);
            _player.IsShadowCaster    = false;
            _player.IsCollisionObject = true;
            _player.SetPosition(25, 1f, 25);
            _player.FPSEyeOffset = 0.75f;
            _player.UpdateLast   = true;
            AddGameObject(_player);
            SetFirstPersonObject(_player, 230);

            SetFirstPersonObjectItemModel("AK47", true, true);
            SetFirstPersonObjectItemModelViewOffset(0.5f, -1, 0);

            SetTextureSkybox(@".\textures\skybox1.dds");
            DebugShowPerformanceInTitle = PerformanceUnit.FramesPerSecond;

            _sunLightWithShadow = new LightObject(LightType.Sun, true);
            _sunLightWithShadow.SetPosition(200, 200, 50);
            _sunLightWithShadow.SetTarget(25, 25, 0);
            _sunLightWithShadow.SetColor(1, 0.75f, 0.5f, 2.5f);
            _sunLightWithShadow.SetNearAndFarBounds(100, 400);
            _sunLightWithShadow.SetFOV(125);
            _sunLightWithShadow.SetFOVBiasCoefficient(_alpha, _hardness);
            AddLightObject(_sunLightWithShadow);
            //DebugShadowLight = _sunLightWithShadow;

            SetAmbientLight(1, 0.75f, 0.5f, 0.3f);
            SetTextureBackgroundBrightnessMultiplier(4);
        }