mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-12-19 00:21:01 +00:00
15b2adfe30
Fixed, Texture Browser Form: well, I broke "Tab" key functionality again (in previous commit)... Maintenance: changed curly braces style to match DB2 one (hopefully not breaking anything in the process...). Maintenance: changed private method names casing to match DB2 one.
45 lines
938 B
C#
45 lines
938 B
C#
using System;
|
|
using CodeImp.DoomBuilder.Geometry;
|
|
|
|
namespace CodeImp.DoomBuilder.GZBuilder.Geometry
|
|
{
|
|
public enum Line3DType
|
|
{
|
|
DEFAULT,
|
|
ACTIVATOR,
|
|
}
|
|
|
|
public class Line3D
|
|
{
|
|
// Coordinates
|
|
public Vector3D v1;
|
|
public Vector3D v2;
|
|
public Line3DType LineType { get { return lineType; } }
|
|
private Line3DType lineType;
|
|
|
|
// Constructors
|
|
public Line3D(Vector3D v1, Vector3D v2)
|
|
{
|
|
this.v1 = v1;
|
|
this.v2 = v2;
|
|
this.lineType = Line3DType.DEFAULT;
|
|
}
|
|
|
|
public Line3D(Vector3D v1, Vector3D v2, Line3DType lineType)
|
|
{
|
|
this.v1 = v1;
|
|
this.v2 = v2;
|
|
this.lineType = lineType;
|
|
}
|
|
|
|
public Vector3D GetDelta() { return v2 - v1; }
|
|
|
|
// This calculates the angle
|
|
public float GetAngle()
|
|
{
|
|
// Calculate and return the angle
|
|
Vector2D d = GetDelta();
|
|
return -(float)Math.Atan2(-d.y, d.x) + Angle2D.PIHALF;//mxd // (float)Math.PI * 0.5f;
|
|
}
|
|
}
|
|
}
|