Exemple #1
0
 public PoseListEnumerator(PoseList collection)
 {
     collectionRef = collection;
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
Exemple #2
0
 public PoseList(PoseList other) : this(OgrePINVOKE.new_PoseList__SWIG_1(PoseList.getCPtr(other)), true)
 {
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #3
0
/*AUTO SCRIPT*/
/*AUTO SCRIPT*/ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
/*AUTO SCRIPT*/ {
/*AUTO SCRIPT*/ if (list == null)
/*AUTO SCRIPT*/ {
/*AUTO SCRIPT*/ list  = EditorUtility.GetPropertyObject <PoseList>(property);
/*AUTO SCRIPT*/ rList = new ReorderableList(list, typeof(Pose), true, false, true, true);
/*AUTO SCRIPT*/                         // rList.onAddCallback += data => { list.Add(defaultVal); };
/*AUTO SCRIPT*/                         // rList.onChangedCallback += data=> {
/*AUTO SCRIPT*/                         // };
/*AUTO SCRIPT*/ }
/*AUTO SCRIPT*/
/*AUTO SCRIPT*/ numLines = 3 + list.Count;
/*AUTO SCRIPT*/ var title  = new GUIContent($" {label.text}");
/*AUTO SCRIPT*/ var height = base.GetPropertyHeight(property, label);
/*AUTO SCRIPT*/ var rect   = new Rect(position.x, position.y, position.width, height);

/*AUTO SCRIPT*/ EditorGUI.BeginChangeCheck();
/*AUTO SCRIPT*/ rList.DoList(rect);
/*AUTO SCRIPT*/ EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), title);
/*AUTO SCRIPT*/
/*AUTO SCRIPT*/ if (EditorGUI.EndChangeCheck())
            {
/*AUTO SCRIPT*/ property.serializedObject.ApplyModifiedProperties();
            }
/*AUTO SCRIPT*/
/*AUTO SCRIPT*/ }
Exemple #4
0
 public void SetRange(int index, PoseList values)
 {
     OgrePINVOKE.PoseList_SetRange(swigCPtr, index, PoseList.getCPtr(values));
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #5
0
 public void AddRange(PoseList values)
 {
     OgrePINVOKE.PoseList_AddRange(swigCPtr, PoseList.getCPtr(values));
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
        public bool FromText(string text)
        {
            bool result = false;

            try
            {
                if (!IsVpdText(text))
                {
                    return(result);
                }
                Match  match = new Regex(InfoGetReg, RegexOptions.IgnoreCase).Match(text);
                string text2 = "";
                if (match.Success)
                {
                    text2 = match.Groups["name"].Value;
                    if (text2.ToLower().Contains(NameExt))
                    {
                        text2 = text2.Replace(NameExt, "");
                    }
                    ModelName = text2;
                }
                PoseList.Clear();
                match = new Regex(BoneGetReg, RegexOptions.IgnoreCase).Match(text);
                while (match.Success)
                {
                    string     text3    = "";
                    Vector3    t        = new Vector3(0f, 0f, 0f);
                    Quaternion identity = Quaternion.Identity;
                    text3 = match.Groups["name"].Value;
                    float.TryParse(match.Groups["trans_x"].Value, out t.x);
                    float.TryParse(match.Groups["trans_y"].Value, out t.y);
                    float.TryParse(match.Groups["trans_z"].Value, out t.z);
                    float.TryParse(match.Groups["rot_x"].Value, out identity.x);
                    float.TryParse(match.Groups["rot_y"].Value, out identity.y);
                    float.TryParse(match.Groups["rot_z"].Value, out identity.z);
                    float.TryParse(match.Groups["rot_w"].Value, out identity.w);
                    PoseList.Add(new PoseData(text3, identity, t));
                    match = match.NextMatch();
                }
                MorphList.Clear();
                match = new Regex(MorphGetReg, RegexOptions.IgnoreCase).Match(text);
                while (match.Success)
                {
                    string text4   = "";
                    float  result2 = 0f;
                    text4 = match.Groups["name"].Value;
                    float.TryParse(match.Groups["val"].Value, out result2);
                    MorphList.Add(new MorphData(text4, result2));
                    match = match.NextMatch();
                }
                result = true;
                return(result);
            }
            catch (Exception)
            {
                return(result);
            }
        }
Exemple #7
0
        public PoseList getPoseList()
        {
            PoseList ret = new PoseList(OgrePINVOKE.Mesh_getPoseList(swigCPtr), false);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #8
0
        public static PoseList Repeat(Pose value, int count)
        {
            global::System.IntPtr cPtr = OgrePINVOKE.PoseList_Repeat(Pose.getCPtr(value), count);
            PoseList ret = (cPtr == global::System.IntPtr.Zero) ? null : new PoseList(cPtr, true);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #9
0
        public PoseList GetRange(int index, int count)
        {
            global::System.IntPtr cPtr = OgrePINVOKE.PoseList_GetRange(swigCPtr, index, count);
            PoseList ret = (cPtr == global::System.IntPtr.Zero) ? null : new PoseList(cPtr, true);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public async Task <ActionResult> OnPost()
        {
            if (ModelState.IsValid)
            {
                string[] newPoses  = new string[7];
                string[] jsonPoses = new string[7];

                string   poseStr1 = HttpContext.Request.Form["NewPose_1"];
                string[] poseInfo = poseStr1.Split("/");
                newPoses[0] = poseInfo[2];

                string poseStr2 = HttpContext.Request.Form["NewPose_2"];
                poseInfo    = poseStr2.Split("/");
                newPoses[1] = poseInfo[2];

                string poseStr3 = HttpContext.Request.Form["NewPose_3"];
                poseInfo    = poseStr3.Split("/");
                newPoses[2] = poseInfo[2];

                string poseStr4 = HttpContext.Request.Form["NewPose_4"];
                poseInfo    = poseStr4.Split("/");
                newPoses[3] = poseInfo[2];

                string poseStr5 = HttpContext.Request.Form["NewPose_5"];
                poseInfo    = poseStr5.Split("/");
                newPoses[4] = poseInfo[2];

                string poseStr6 = HttpContext.Request.Form["NewPose_6"];
                poseInfo    = poseStr6.Split("/");
                newPoses[5] = poseInfo[2];

                string poseStr7 = HttpContext.Request.Form["NewPose_7"];
                poseInfo    = poseStr7.Split("/");
                newPoses[6] = poseInfo[2];

                this.PoseList = new List <Poses>();
                ChakraList    = await cosmosDbService.GetChakrasAsync();

                for (int i = 0; i < 7; i++)
                {
                    PoseList.Add(ChakraList[i].Poses.Where(x => x.name == newPoses[i]).FirstOrDefault());
                    jsonPoses[i] = new JavaScriptSerializer().Serialize(PoseList[i]);
                }


                Poses[] TempArray = PoseList.ToArray();
                //TempData.Set("Poses", TempArray);
                //TempData["jsonPoses"] = jsonPoses;
                TempData.Set("PoseList", PoseList.ToArray());
                return(RedirectToPage("ClassPreference"));
            }
            return(Page());
        }
Exemple #11
0
 public Pose(PoseList data)
 {
     this.data = data;
     if (data.count > 1)
     {
         phaseLength = 1 / (data.count - 1);
     }
     else
     {
         phaseLength = 1;
     }
 }
Exemple #12
0
	public Pose(PoseList data)
	{
		this.data = data;
		if (data.count > 1)
		{
			phaseLength = 1 / (data.count - 1);
		}
		else
		{
			phaseLength = 1;
		}
	}
        public async Task OnGetAsync()
        {
            ChakraList = await cosmosDbService.GetChakrasAsync();

            this.PoseList = new List <Poses>();
            int    selectedPose;
            Random rnd = new Random();

            //Cycle thru each of the Chakras and randomly select a pose the current Chakra
            foreach (Chakra ch in ChakraList)
            {
                //Generate a random number between 1 and the number of poses
                selectedPose = rnd.Next(1, ch.Poses.Length);
                //Add the pose to the list
                PoseList.Add(ch.Poses[selectedPose]);
            }
        }
Exemple #14
0
        public async Task OnGetAsync()
        {
            ChakraList = await cosmosDbService.GetChakrasAsync();

            //Test Serializing data to Json
            //String jsonChakra = JsonSerializer.Serialize<List<Chakra>>(ChakraList);

            this.PoseList = new List <Poses>();
            int    selectedPose;
            Random rnd = new Random();

            //Cycle thru each of the Chakras and randomly select a pose the current Chakra
            foreach (Chakra ch in ChakraList)
            {
                //Generate a random number between 1 and the number of poses
                selectedPose = rnd.Next(0, ch.Poses.Length - 1);
                //Add the pose to the list
                PoseList.Add(ch.Poses[selectedPose]);
            }
        }
Exemple #15
0
        public async Task <IActionResult> OnPostAsync()
        {
            //If coming from the Class Settings Page
            if (FromStage == 2)
            {
                //Load the Poses already selected.
                this.PoseList = TempData.Get <Poses[]>("PoseList").ToList();

                //Load the Charkra list. This is for the Select Lists of poses
                ChakraList = await cosmosDbService.GetChakrasAsync();
            }
            else
            {
                if (ModelState.IsValid)
                {
                    //Save the list of poses for later use.
                    TempData.Set("PoseList", PoseList.ToArray());

                    return(RedirectToPage("ClassPreference2"));
                }
            }
            return(Page());
        }
Exemple #16
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PoseList obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
 public virtual void applyToVertexData(VertexData data, TimeIndex timeIndex, float weight, PoseList poseList)
 {
     OgrePINVOKE.VertexAnimationTrack_applyToVertexData__SWIG_0(swigCPtr, VertexData.getCPtr(data), TimeIndex.getCPtr(timeIndex), weight, PoseList.getCPtr(poseList));
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #18
0
    private static void LoadPoses(TextAsset posesAsset)
    {
        XmlDocument xmlDoc = new XmlDocument();                     // xmlDoc is the new xml document.

        xmlDoc.LoadXml(posesAsset.text);                            // load the file.
        XmlNodeList poseList = xmlDoc.GetElementsByTagName("pose"); // array of the level nodes.

        poses = new PoseList[poseList.Count];
        int idx = 0;

        foreach (XmlNode poseInfo in poseList)
        {
            PoseList list = new PoseList();
            list.count     = int.Parse(poseInfo.Attributes ["phases"].Value);
            list.uiTexture = Resources.Load <Sprite>(poseInfo.Attributes ["texture"].Value);
            list.poses     = new PoseData[list.count];

            foreach (XmlNode item in poseInfo)               // levels itens nodes.
            {
                if (item.Name == "leftWing")
                {
                    for (int ii = 0; ii < list.count; ii++)
                    {
                        XmlNode dat = item.ChildNodes [ii];
                        list.poses[ii].leftWing = float.Parse(dat.Attributes["value"].Value);
                    }
                }
                if (item.Name == "rightWing")
                {
                    for (int ii = 0; ii < list.count; ii++)
                    {
                        XmlNode dat = item.ChildNodes [ii];
                        list.poses[ii].rightWing = float.Parse(dat.Attributes["value"].Value);
                    }
                }
                if (item.Name == "head")
                {
                    for (int ii = 0; ii < list.count; ii++)
                    {
                        XmlNode dat = item.ChildNodes [ii];
                        Vector2 vec = new Vector2();
                        vec.x = float.Parse(dat.Attributes["x"].Value);
                        vec.y = float.Parse(dat.Attributes["y"].Value);
                        list.poses[ii].head = vec;
                    }
                }
                if (item.Name == "tail")
                {
                    for (int ii = 0; ii < list.count; ii++)
                    {
                        XmlNode dat = item.ChildNodes [ii];
                        Vector2 vec = new Vector2();
                        vec.x = float.Parse(dat.Attributes["x"].Value);
                        vec.y = float.Parse(dat.Attributes["y"].Value);
                        list.poses[ii].tail = vec;
                    }
                }
            }
            poses [idx++] = list;
        }
    }
Exemple #19
0
	private static void LoadPoses(TextAsset posesAsset)
	{
		XmlDocument xmlDoc = new XmlDocument(); // xmlDoc is the new xml document.

		xmlDoc.LoadXml(posesAsset.text); // load the file.
		XmlNodeList poseList = xmlDoc.GetElementsByTagName("pose"); // array of the level nodes.

		poses = new PoseList[poseList.Count];
		int idx = 0;

		foreach (XmlNode poseInfo in poseList)
		{
			PoseList list = new PoseList();
			list.count = int.Parse (poseInfo.Attributes ["phases"].Value);
			list.uiTexture = Resources.Load<Sprite>(poseInfo.Attributes ["texture"].Value);
			list.poses = new PoseData[list.count];

			foreach (XmlNode item in poseInfo)   // levels itens nodes.
			{
				if (item.Name == "leftWing")
				{
					for (int ii = 0; ii < list.count; ii++)
					{
						XmlNode dat = item.ChildNodes [ii];
						list.poses[ii].leftWing = float.Parse(dat.Attributes["value"].Value);
					}
				}
				if (item.Name == "rightWing")
				{
					for (int ii = 0; ii < list.count; ii++)
					{
						XmlNode dat = item.ChildNodes [ii];
						list.poses[ii].rightWing = float.Parse(dat.Attributes["value"].Value);
					}
				}
				if (item.Name == "head")
				{
					for (int ii = 0; ii < list.count; ii++)
					{
						XmlNode dat = item.ChildNodes [ii];
						Vector2 vec = new Vector2 ();
						vec.x = float.Parse(dat.Attributes["x"].Value);
						vec.y = float.Parse(dat.Attributes["y"].Value);
						list.poses[ii].head = vec;
					}
				}
				if (item.Name == "tail")
				{
					for (int ii = 0; ii < list.count; ii++)
					{
						XmlNode dat = item.ChildNodes [ii];
						Vector2 vec = new Vector2 ();
						vec.x = float.Parse(dat.Attributes["x"].Value);
						vec.y = float.Parse(dat.Attributes["y"].Value);
						list.poses[ii].tail = vec;
					}
				}
			}
			poses [idx++] = list;
		}
	}