clean up, import lights from map
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -70,13 +70,13 @@
|
|||||||
"Transform": {
|
"Transform": {
|
||||||
"Translation": {
|
"Translation": {
|
||||||
"X": 0.0,
|
"X": 0.0,
|
||||||
"Y": 751.0,
|
"Y": 716.0,
|
||||||
"Z": 0.0
|
"Z": 0.0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Control": "FlaxEngine.GUI.Label",
|
"Control": "FlaxEngine.GUI.Label",
|
||||||
"Data": {
|
"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": {
|
"TextColor": {
|
||||||
"R": 1.0,
|
"R": 1.0,
|
||||||
"G": 1.0,
|
"G": 1.0,
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
},
|
},
|
||||||
"Offsets": {
|
"Offsets": {
|
||||||
"Left": 0.0,
|
"Left": 0.0,
|
||||||
"Right": 231.0,
|
"Right": 224.0,
|
||||||
"Top": -97.0,
|
"Top": -97.0,
|
||||||
"Bottom": 64.0
|
"Bottom": 64.0
|
||||||
},
|
},
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -502,9 +502,8 @@ namespace Game
|
|||||||
brushIndex = 0;
|
brushIndex = 0;
|
||||||
foreach (var geom in brushGeometries)
|
foreach (var geom in brushGeometries)
|
||||||
{
|
{
|
||||||
StaticModel childModel = Actor.AddChild<StaticModel>();
|
StaticModel childModel = worldSpawnActor.AddChild<StaticModel>();
|
||||||
childModel.Name = "Brush_" + brushIndex;
|
childModel.Name = "Brush_" + brushIndex;
|
||||||
childModel.Parent = worldSpawnActor;
|
|
||||||
childModel.Model = geom.model;
|
childModel.Model = geom.model;
|
||||||
childModel.Position = geom.offset;
|
childModel.Position = geom.offset;
|
||||||
|
|
||||||
@@ -682,6 +681,71 @@ namespace Game
|
|||||||
sw.Stop();
|
sw.Stop();
|
||||||
Console.Print("Pass 2: model and collision: " + sw.Elapsed.TotalMilliseconds + "ms");
|
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<PointLight>();
|
||||||
|
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()
|
public override void OnDestroy()
|
||||||
|
|||||||
Reference in New Issue
Block a user