Ejemplo n.º 1
0
                /// <summary>
                /// 插值生成曲线上某点坐标
                /// </summary>
                /// <param name="fromIndex">控制点索引</param>
                /// <param name="t">参变量t</param>
                /// <returns>点坐标</returns>
                public EarthView.World.Spatial.Math.Quaternion Interpolate(uint fromIndex, double t)
                {
                    IntPtr __ptr = EarthView_World_Graphic_CRotationalSpline_interpolate_CQuaternion_ev_uint32_Real(this.NativeObject, fromIndex, t);

                    if (__ptr == IntPtr.Zero)
                    {
                        return(null);
                    }
                    EarthView.World.Spatial.Math.Quaternion csObj = new EarthView.World.Spatial.Math.Quaternion(CreatedWhenConstruct.CWC_NotToCreate);
                    csObj.BindNativeObject(__ptr, "CQuaternion");
                    IClassFactory csObjClassFactory = GlobalClassFactoryMap.Get(csObj.GetCppInstanceTypeName());

                    if (csObjClassFactory != null)
                    {
                        csObj.Delegate = true;
                        csObj          = csObjClassFactory.Create() as EarthView.World.Spatial.Math.Quaternion;
                        csObj.BindNativeObject(__ptr, "CQuaternion");
                    }
                    return(csObj);
                }
                    /// <summary>
                    /// x,y,z三个轴旋转角度转四元数
                    /// </summary>
                    /// <param name="x">x</param>
                    /// <param name="y">y</param>
                    /// <param name="z">z</param>
                    /// <param name="w">w</param>
                    /// <returns></returns>
                    public static EarthView.World.Spatial.Math.Quaternion AngleToQuater(EarthView.World.Spatial.Math.Vector3 v3)
                    {
                        IntPtr __ptr = EarthView_World_Spatial3D_Dataset_CModelDatasetUtility_AngleToQuater_CQuaternion_CVector3(object.Equals(v3, null) ? IntPtr.Zero : v3.NativeObject);

                        if (__ptr == IntPtr.Zero)
                        {
                            return(null);
                        }
                        EarthView.World.Spatial.Math.Quaternion csObj = new EarthView.World.Spatial.Math.Quaternion(CreatedWhenConstruct.CWC_NotToCreate);
                        csObj.BindNativeObject(__ptr, "CQuaternion");
                        IClassFactory csObjClassFactory = GlobalClassFactoryMap.Get(csObj.GetCppInstanceTypeName());

                        if (csObjClassFactory != null)
                        {
                            csObj.Delegate = true;
                            csObj          = csObjClassFactory.Create() as EarthView.World.Spatial.Math.Quaternion;
                            csObj.BindNativeObject(__ptr, "CQuaternion");
                        }
                        return(csObj);
                    }
Ejemplo n.º 3
0
                /// <summary>
                /// 获得曲线中某控制点的详细信息
                /// </summary>
                /// <param name="index">控制点索引</param>
                /// <returns>四元数</returns>
                public EarthView.World.Spatial.Math.Quaternion GetPoint(ushort index)
                {
                    IntPtr __ptr = EarthView_World_Graphic_CRotationalSpline_getPoint_CQuaternion_ev_uint16(this.NativeObject, index);

                    if (__ptr == IntPtr.Zero)
                    {
                        return(null);
                    }
                    EarthView.World.Spatial.Math.Quaternion csObj = new EarthView.World.Spatial.Math.Quaternion(CreatedWhenConstruct.CWC_NotToCreate);
                    csObj.BindNativeObject(__ptr, "CQuaternion");
                    csObj.Delegate = true;
                    IClassFactory csObjClassFactory = GlobalClassFactoryMap.Get(csObj.GetCppInstanceTypeName());

                    if (csObjClassFactory != null)
                    {
                        csObj.Delegate = true;
                        csObj          = csObjClassFactory.Create() as EarthView.World.Spatial.Math.Quaternion;
                        csObj.BindNativeObject(__ptr, "CQuaternion");
                        csObj.Delegate = true;
                    }
                    return(csObj);
                }