diff --git a/Content/Materials/Material 0.flax b/Content/Materials/Material 0.flax deleted file mode 100644 index c358c4c..0000000 Binary files a/Content/Materials/Material 0.flax and /dev/null differ diff --git a/Content/Materials/SimpleMapMaterial.flax b/Content/Materials/SimpleMapMaterial.flax index 95c4f4b..e8a4b18 100644 Binary files a/Content/Materials/SimpleMapMaterial.flax and b/Content/Materials/SimpleMapMaterial.flax differ diff --git a/Content/Materials/WeaponMaterial.flax b/Content/Materials/WeaponMaterial.flax index c0e9b81..7c3f11e 100644 Binary files a/Content/Materials/WeaponMaterial.flax and b/Content/Materials/WeaponMaterial.flax differ diff --git a/Content/Materials/dev/dev_128_gray.flax b/Content/Materials/dev/dev_128_gray.flax index 9e8898d..c00d883 100644 Binary files a/Content/Materials/dev/dev_128_gray.flax and b/Content/Materials/dev/dev_128_gray.flax differ diff --git a/Content/Materials/dev_128.flax b/Content/Materials/dev_128.flax deleted file mode 100644 index 6c855f7..0000000 Binary files a/Content/Materials/dev_128.flax and /dev/null differ diff --git a/Content/Materials/dev_128_lit.flax b/Content/Materials/dev_128_lit.flax deleted file mode 100644 index 07885fb..0000000 Binary files a/Content/Materials/dev_128_lit.flax and /dev/null differ diff --git a/Content/Scenes/AerowalkScene.scene b/Content/Scenes/AerowalkScene.scene index 95aae5a..84dfb73 100644 --- a/Content/Scenes/AerowalkScene.scene +++ b/Content/Scenes/AerowalkScene.scene @@ -70,13 +70,13 @@ "Transform": { "Translation": { "X": 0.0, - "Y": 751.0, + "Y": 716.0, "Z": 0.0 } }, "Control": "FlaxEngine.GUI.Label", "Data": { - "Text": "eFPS: 120 uTime: 5.1785762\nuFPS: 120 uTime: 0.00833330024033785\nrFPS: 120 rTime: 0\npFPS: 30 pTime: 0", + "Text": "eFPS: 15 uTime: 297.4087306\nuFPS: 15 uTime: 0.00833330024033785\nrFPS: 15 rTime: 0\npFPS: 30 pTime: 0", "TextColor": { "R": 1.0, "G": 1.0, @@ -123,7 +123,7 @@ }, "Offsets": { "Left": 0.0, - "Right": 231.0, + "Right": 224.0, "Top": -97.0, "Bottom": 64.0 }, diff --git a/Content/Textures/dev/dev_128_mat_norm.flax b/Content/Textures/dev/dev_128_mat_norm.flax index 1e20b6a..5780fa4 100644 Binary files a/Content/Textures/dev/dev_128_mat_norm.flax and b/Content/Textures/dev/dev_128_mat_norm.flax differ diff --git a/Content/Textures/dev/dev_128_mat_orm.flax b/Content/Textures/dev/dev_128_mat_orm.flax index 949adda..ac07224 100644 Binary files a/Content/Textures/dev/dev_128_mat_orm.flax and b/Content/Textures/dev/dev_128_mat_orm.flax differ diff --git a/Source/Game/Q3MapImporter.cs b/Source/Game/Q3MapImporter.cs index e1afdda..c1bffdb 100644 --- a/Source/Game/Q3MapImporter.cs +++ b/Source/Game/Q3MapImporter.cs @@ -502,9 +502,8 @@ namespace Game brushIndex = 0; foreach (var geom in brushGeometries) { - StaticModel childModel = Actor.AddChild(); + StaticModel childModel = worldSpawnActor.AddChild(); childModel.Name = "Brush_" + brushIndex; - childModel.Parent = worldSpawnActor; childModel.Model = geom.model; childModel.Position = geom.offset; @@ -682,6 +681,71 @@ namespace Game sw.Stop(); Console.Print("Pass 2: model and collision: " + sw.Elapsed.TotalMilliseconds + "ms"); } + + // Handle entities + { + sw.Restart(); + int lightIndex = 0; + foreach (var lightEntity in root.entities.Where(x => + x.properties.ContainsKey("classname") && x.properties["classname"] == "light")) + { + + Vector3 ParseOrigin(string origin) + { + string[] points = origin.Split(new char[] { ' ' }); + return new Vector3(float.Parse(points[0]), float.Parse(points[2]), float.Parse(points[1])); + } + + Color ParseColor(string origin) + { + string[] points = origin.Split(new char[] { ' ' }); + return new Color(float.Parse(points[0]), float.Parse(points[1]), float.Parse(points[2])); + } + + //Console.Print("light"); + PointLight light = worldSpawnActor.AddChild(); + light.Name = "Light_" + lightIndex; + light.LocalPosition = ParseOrigin(lightEntity.properties["origin"]); + + //"_color" "0.752941 0.752941 0" + //"light" "200" + + if (lightEntity.properties.TryGetValue("_color", out string colorStr)) + { + //light.Color = ParseColor(colorStr); + } + + float lightamm = 200f; + if (lightEntity.properties.TryGetValue("light", out string lightStr)) + { + lightamm = float.Parse(lightStr); + } + + + + light.Brightness = lightamm / 128f; + light.Layer = 1; + light.Radius = 1000f * 0.5f; + light.UseInverseSquaredFalloff = false; + light.FallOffExponent = 8; + light.ShadowsDistance = 2000f * 1f; + + + + if (true) + { + // match FTEQW dynamic only light values + } + + //Console.Print("light pos: " + light.Position); + + lightIndex++; + } + + Console.Print("test: " + (new Vector2(1f,0f) == Vector2.Zero)); + + Console.Print("light parsing time: " + sw.Elapsed.TotalMilliseconds + "ms"); + } } public override void OnDestroy()