UDMF sector slopes: looks like 4-th parameter is used in GZDoom after all :)

This commit is contained in:
MaxED 2014-05-20 07:45:19 +00:00
parent a61bba2536
commit e6204be571

View file

@ -18,17 +18,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
// This makes sure we are updated with the source linedef information
// This makes sure we are updated
public override void Update()
{
if (ceilingslope) {
float a = data.Sector.Fields.GetValue("ceilingplane_a", 0f);
float b = data.Sector.Fields.GetValue("ceilingplane_b", 0f);
float c = data.Sector.Fields.GetValue("ceilingplane_c", 0f);
float d = 0; //data.Sector.Fields.GetValue("ceilingplane_d", 0f);
float d = data.Sector.Fields.GetValue("ceilingplane_d", 0f);
Vector3D normal = new Vector3D(a, b, c).GetNormal();
if (normal.x != 0 || normal.y != 0 || normal.z != 0) {
if (normal.x != 0 || normal.y != 0 || normal.z != 0)
{
if(normal.z > 0) normal = -normal; //flip the plane if it's facing the wrong direction
data.Ceiling.plane = new Plane(normal, d);
}
@ -38,10 +39,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
float a = data.Sector.Fields.GetValue("floorplane_a", 0f);
float b = data.Sector.Fields.GetValue("floorplane_b", 0f);
float c = data.Sector.Fields.GetValue("floorplane_c", 0f);
float d = 0; //data.Sector.Fields.GetValue("floorplane_d", 0f);
float d = data.Sector.Fields.GetValue("floorplane_d", 0f);
Vector3D normal = new Vector3D(a, b, c).GetNormal();
if (normal.x != 0 || normal.y != 0 || normal.z != 0) {
if (normal.x != 0 || normal.y != 0 || normal.z != 0)
{
if(normal.z < 0) normal = -normal; //flip the plane if it's facing the wrong direction
data.Floor.plane = new Plane(normal, d);
}