コード例 #1
0
 //添加自定义虚拟轴
 public static void AddAxis(string axisName, string positiveButtonName, string negativeButtonName)
 {
     if ((keyCodeDic.ContainsKey(positiveButtonName) && keyCodeDic.ContainsKey(negativeButtonName)) && !axisDic.ContainsKey(axisName))
     {
         axisDic[axisName] = new AxisObject(positiveButtonName, negativeButtonName);
     }
 }
コード例 #2
0
    public void DrawAxisWithoutX(string id, Quaternion roration, Vector3 pos, Vector3 size, Material mat, int layer)
    {
        GeometryObject obj = null;

        DrawGeometryObject(
            id
            , GEOMETRYTYPE.GEOMETRY_TYPE_AXIS
            , roration
            , pos
            , size
            , mat
            , layer
            , out obj
            );

        AxisObject axisObj = obj as AxisObject;

        if (axisObj != null)
        {
            axisObj.SetXAxisVisiable(false);
        }
    }
コード例 #3
0
    private void CreateGeometryObj(string id, GEOMETRYTYPE type, Quaternion roration, Vector3 pos, Vector3 size, Material mat, int layer, out GeometryObject obj, List <object> param = null)
    {
        obj = null;

        if (string.IsNullOrEmpty(id))
        {
            return;
        }

        if (!IsObjExist(id, out obj))
        {
            switch (type)
            {
            case GEOMETRYTYPE.GEOMETRY_TYPE_CUBE:
                obj = new CubeObject(id, roration, pos, size, mat, layer);
                break;

            case GEOMETRYTYPE.GEOMETRY_TYPE_TAPER:
                obj = new TaperObject(id, roration, pos, size, mat, layer);
                break;

            case GEOMETRYTYPE.GEOMETRY_TYPE_AXIS:
                obj = new AxisObject(id, roration, pos, size, mat, layer);
                break;

            case GEOMETRYTYPE.GEOMETRY_TYPE_TEXT:
                obj = new TextObject(id, roration, pos, size, mat, layer);
                break;

            case GEOMETRYTYPE.GEOMETRY_TYPE_RING:
                obj = new RingObject(id, roration, pos, size, mat, layer);
                break;

            case GEOMETRYTYPE.GEOMETRY_TYPE_SECTOR:
                obj = new SectorObject(id, roration, pos, size, mat, layer, param);
                break;

            case GEOMETRYTYPE.GEOMETRY_TYPE_SPHERE:
                obj = new SphereObject(id, roration, pos, size, mat, layer);
                break;

            default:
                break;
            }


            if (obj != null)
            {
                obj.DrawCounter++;
                m_ObjectTbl.Add(obj);
            }
        }
        else
        {
            if (obj != null)
            {
                obj.Rotation   = roration;
                obj.Position   = pos;
                obj.Scale      = size;
                obj.DefaultMat = mat;
                obj.Layer      = layer;

                obj.DrawCounter++;
            }
        }
    }