Click or drag to resize
XDL

XAircraft Class

비행체 모델을 나타낸다.
Inheritance Hierarchy

Namespace:  Pixoneer.NXDL.NEQUIP
Assembly:  NXDLncw (in NXDLncw.dll) Version: 1.2.817.72
Syntax
C#
public class XAircraft : XEquipObj

The XAircraft type exposes the following members.

Constructors
  NameDescription
Public methodXAircraft
XAircraft 객체를 생성하고 데이터 멤버를 초기화한다. 기본 생성자.
Public methodXAircraft(eEquipTarget)
XAircraft 객체를 생성하고 데이터 멤버를 초기화한다. 기본 생성자.
Top
Properties
  NameDescription
Public propertyBlendColor
모형의 혼합 색상을 확인하거나 설정한다. 현재는 블렌드 모드인 경우 모델의 텍스쳐, 물질 정보를 무시하고 이 색으로 그린다.
Public propertyBlendMode
혼합 색상 모드를 확인하거나 설정한다.
Public propertyFixSizeOn2D
모델을 확대축소와 상관없이 Planet2D 모드에서 일정한 크기로 도시하는지 여부를 확인하거나 설정한다.
Public propertyFixSizeOn3D
모델을 확대축소와 상관없이 Planet3D 모드에서 일정한 크기로 도시하는지 여부를 확인하거나 설정한다.
Public propertyMaxXYZ
영역의 최대 크기 속성.
Public propertyMinXYZ
영역의 최소 크기 속성.
Public propertyScalable
비율(scale)에 따라 모델의 크기를 조절하는지 여부를 확인하거나 설정한다.
Top
Methods
  NameDescription
Public methodLoadModel(String)
파일경로에서 비행체 모델을 로딩한다.
Public methodLoadModel(String, Boolean)
파일경로에서 비행체 모델을 로딩한다.
Public methodLoadModelForReloading
파일경로에서 비행체 모델을 로딩한다. BlendMode 설정에 따라 모델을 도시할 수 있도록 한다. 현재는 3DS 파일만을 지원한다.
Public methodSetAOA
받음각(Angle of attack. 비행 방향인 공기 흐름의 속도 방향과 날개 시위선이 만드는 사이 각)을 설정한다.
Public methodSetDive
강하(Dive) 각도를 설정한다.
Public methodSetRot
Rate one turn을 설정한다.
Public methodSetSpeedMach
마하(mach) 속도를 설정한다.
Public methodSetSpeedMPS
Speed on meter per second = mach * 340.3 (sonic speed).
Top
Remarks

.

Examples
class MyAircraft : XAircraft
{
    public ArrayList m_Positions;
    private Object thisLock = new Object();
    public MyAircraft()
    {
        m_Positions = new ArrayList();
    }

    public override bool SetPosition(XGeoPoint pos)
    {
        if (pos == null) return false;

        lock (thisLock)
        {
            m_Positions.Add(pos);
            if (m_Positions.Count > 300)
                m_Positions.RemoveAt(0);
        }
        return base.SetPosition(pos);
    }

    public override bool SetState(XGeoPoint pos, XAttitude att)
    {
        if (pos == null) return false;

        lock (thisLock)
        {
            m_Positions.Add(pos);
            if (m_Positions.Count > 300)
                m_Positions.RemoveAt(0);
        }
        return base.SetState(pos,att);
    }

    public override bool DrawBefore(NXPlanetDrawArgs DrawArgs)
    {
        return true;
    }

    public override bool DrawOver(NXPlanetDrawArgs DrawArgs)
    {
        XGraphics g = DrawArgs.Graphics;

        g.glEnable(XGraphics.GL_BLEND);
        g.glBlendFunc(XGraphics.GL_SRC_ALPHA, XGraphics.GL_ONE_MINUS_SRC_ALPHA);
        g.glLineWidth(5.0);
        g.glColor4d(1.0, 1.0, 0.0, 0.8);
        g.glBegin(XGraphics.GL_LINE_STRIP);

        lock (thisLock)
        {
            for (int i = 0; i < m_Positions.Count; i++)
            {
                XGeoPoint gp = (XGeoPoint)m_Positions[i];
                if (gp == null) continue;
                g.glVertex3d(gp.ecr);
            }
        }

        g.glEnd();
        g.glColor(Color.White);
        g.glLineWidth(1.0);
        g.glDisable(XGraphics.GL_BLEND);
        g.glDisable(XGraphics.GL_LINE_SMOOTH);

        return true;
    }
}
See Also