public void TestShoulderScale() { Shoulder shoulder = new Shoulder(20); shoulder.StitchCount(6); Assert.AreEqual(120, shoulder.Width); }
public override int GetHashCode() { unchecked { var hashCode = Base.GetHashCode(); hashCode = (hashCode * 397) ^ Shoulder.GetHashCode(); hashCode = (hashCode * 397) ^ Elbow.GetHashCode(); return(hashCode); } }
private void instantiateHelperClasses() { this.playerValues = new PlayerValues(); this.instantiateRoadManager(); this.topShoulder = new Shoulder(this.player.Width); this.animationManager = new AnimationManager(); this.collisionDetector = new CollisionDetector(); this.lifeTimer = new LifeTimer(); this.playerMovementManager = new PlayerMovementManager(this.player, this.FrogHomes); this.playerMovementManager.PlayerMoved += this.playerMoved; }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = 17; hash = hash * 23 + Shoulder.GetHashCode(); hash = hash * 23 + Elbow.GetHashCode(); hash = hash * 23 + Wrist.GetHashCode(); return(hash); } }
public static string GetPrefsFromShoulder(Shoulder _shoulder) { foreach (Tuple <string, Shoulder> shoulder in h3_ho_Shoulders) { if (shoulder.Item2 == _shoulder) { return(shoulder.Item1); } } return("air_assault"); }
public bool Equals(ServoPositions other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Base.Equals(other.Base) && Shoulder.Equals(other.Shoulder) && Elbow.Equals(other.Elbow)); }
//Switches the shoulders of the player void SwitchShoulders() { switch (shoulder) { case Shoulder.left: shoulder = Shoulder.right; break; case Shoulder.right: shoulder = Shoulder.left; break; } }
//Switches the cameras shoulder view public void SwitchShoulders() { switch (shoulder) { case Shoulder.Left: shoulder = Shoulder.Right; break; case Shoulder.Right: shoulder = Shoulder.Left; break; } }
public void StartArm() { // Initialize PortHandler Structs // Set the port path // Get methods and members of PortHandlerLinux or PortHandlerWindows port_num = dynamixel.portHandler(DEVICENAME); // Initialize PacketHandler Structs dynamixel.packetHandler(); // Open port if (dynamixel.openPort(port_num)) { Console.WriteLine("Succeeded to open the port!"); } else { Console.WriteLine("Failed to open the port!"); Console.WriteLine("Press any key to terminate..."); Console.ReadKey(); return; } // Set port baudrate if (dynamixel.setBaudRate(port_num, BAUDRATE)) { Console.WriteLine("Succeeded to change the baudrate!"); } else { Console.WriteLine("Failed to change the baudrate!"); Console.WriteLine("Press any key to terminate..."); Console.ReadKey(); return; } // enable the turret, shoulder, elbow and base Base.StartServo(port_num); Shoulder.StartServo(port_num); Elbow.StartServo(port_num); Gripper.StartServo(port_num); }
private IWavyBorder<Point> GetWawyBorder(Shoulder shoulder, Func<double, Shoulder, Point> transformer) { var wavyBorder = shoulder.GetWavyBorder((p, es) => new FoldingWavyBorderBuilder(p, es), WaveCount); return wavyBorder.Transform(x => transformer(x, shoulder)); }
public void TestShoulderPositive() { Shoulder shoulder = new Shoulder(-1); }
public void TestShoulderNotZero() { Shoulder shoulder = new Shoulder(0); }
public void TestShoulderWidthExists() { Shoulder shoulder = new Shoulder(20); Assert.AreEqual(20, shoulder.Width); }
/// <summary> /// The values to write to each servo to move the arm of the UGV to a postion that allows for optimal view of the main payload /// </summary> public void ArmSearchPosition() { Base.Move_To(Base_Search_Position); Shoulder.Move_To(Shoulder_Search_Position); Elbow.Move_To(Elbow_Search_Position); }
public void SetUp() { _target = new Shoulder(); }
public Trunk() { Hip = new Hip(); Shoulder = new Shoulder(); }
public SwagTail(int pointCount) { LeftShoulder = new Shoulder(); RightShoulder = new Shoulder(); PointCount = pointCount; }
private static void UpdateUVs(Config[] configs) { foreach (var config in configs) { var armorMeshFolderPath = "Assets/Character_Editor/Meshes/" + config.folderName + "/Armor/"; var weaponMeshFolderPath = "Assets/Character_Editor/Meshes/" + config.folderName + "/Weapon/"; var meshPaths = new Dictionary <int, string>() { { Arm.GetMerheOrder(MeshType.ArmRight), armorMeshFolderPath + "Armor_Arm/ArmRight" }, { Arm.GetMerheOrder(MeshType.ArmLeft), armorMeshFolderPath + "Armor_Arm/ArmLeft" }, { Belt.GetMerheOrder(), armorMeshFolderPath + "Armor_Belt" }, { BeltAdd.GetMerheOrder(), armorMeshFolderPath + "Armor_BeltAdd" }, { Hair.GetMerheOrder(), armorMeshFolderPath + "Armor_Hair" }, { Helm.GetMerheOrder(), armorMeshFolderPath + "Armor_Helm" }, { Beard.GetMerheOrder(), armorMeshFolderPath + "Armor_Jaw" }, { FaceFeature.GetMerheOrder(), armorMeshFolderPath + "Armor_Feature" }, { Leg.GetMerheOrder(MeshType.LegRight), armorMeshFolderPath + "Armor_Leg/LegRight" }, { Leg.GetMerheOrder(MeshType.LegLeft), armorMeshFolderPath + "Armor_Leg/LegLeft" }, { Shoulder.GetMerheOrder(MeshType.ShoulderRight), armorMeshFolderPath + "Armor_Shoulder/ShoulderRight" }, { Shoulder.GetMerheOrder(MeshType.ShoulderLeft), armorMeshFolderPath + "Armor_Shoulder/ShoulderLeft" }, { Torso.GetMerheOrder(), armorMeshFolderPath + "Armor_Torso" }, { TorsoAdd.GetMerheOrder(), armorMeshFolderPath + "Armor_TorsoAdd" }, { Hand.GetMerheOrder(MeshType.HandRight), weaponMeshFolderPath + "HandRight" }, { Hand.GetMerheOrder(MeshType.HandLeft), weaponMeshFolderPath + "HandLeft" }, }; var myList = meshPaths.ToList(); myList.Sort((pair1, pair2) => pair1.Key.CompareTo(pair2.Key)); int atlasSize = 4; float uvsStep = 1f / atlasSize; for (int itemNum = 0; itemNum < myList.Count; itemNum++) { if (!AssetDatabase.IsValidFolder(myList[itemNum].Value)) { continue; } var meshGUIDs = AssetDatabase.FindAssets("t:GameObject", new string[] { myList[itemNum].Value }); for (int meshNum = 0; meshNum < meshGUIDs.Length; meshNum++) { var tempMesh = AssetDatabase.LoadAssetAtPath <GameObject>(AssetDatabase.GUIDToAssetPath(meshGUIDs[meshNum])); // Mesh tempMesh = UnityEngine.Object.Instantiate(meshObject); //Update LOD parts for each armor item var armorsParts = tempMesh.GetComponentsInChildren <MeshFilter>(); for (var armLOD = 0; armLOD < armorsParts.Length; armLOD++) { if (armorsParts[armLOD] != null) { var mTempMesh = (Mesh)GameObject.Instantiate(armorsParts[armLOD].sharedMesh); //Update UVS for new atlas Vector2[] uvs = mTempMesh.uv; for (int i = 0; i < uvs.Length; i++) { uvs[i] = new Vector2(uvs[i].x / atlasSize + uvsStep * (itemNum % atlasSize), uvs[i].y / atlasSize + uvsStep * (atlasSize - 1 - (itemNum / atlasSize))); } mTempMesh.uv = uvs; //assigne the selected LOD Mesh with new UV's to the new mesh to be exported if (!Directory.Exists(myList[itemNum].Value + "/Meshes/")) { Directory.CreateDirectory(myList[itemNum].Value + "/Meshes/"); } CreateOrReplaceAsset <Mesh>(mTempMesh, myList[itemNum].Value + "/Meshes/" + armorsParts[armLOD].sharedMesh.name + "_New.asset"); AssetDatabase.SaveAssets(); } } } } var prefabsPath = "Assets/Character_Editor/Prefabs/" + config.folderName; var prefabGUIDs = AssetDatabase.FindAssets("t:Prefab", new string[] { prefabsPath }); for (int prefNum = 0; prefNum < prefabGUIDs.Length; prefNum++) { var pPath = AssetDatabase.GUIDToAssetPath(prefabGUIDs[prefNum]); if (pPath.Contains("/Model/")) { var originalPrefab = AssetDatabase.LoadAssetAtPath <GameObject>(pPath); var originalPrefabInstance = GameObject.Instantiate(originalPrefab); originalPrefabInstance.name = originalPrefab.name; foreach (var filter in originalPrefabInstance.GetComponentsInChildren <MeshFilter>()) { var lodMeshPath = AssetDatabase.GetAssetPath(filter.sharedMesh); var index = lodMeshPath.LastIndexOf("/"); if (index != -1) { lodMeshPath = lodMeshPath.Substring(0, index) + "/Meshes/" + filter.sharedMesh.name + "_New.asset"; var changedMesh = AssetDatabase.LoadAssetAtPath <Mesh>(lodMeshPath); filter.mesh = changedMesh; var newDirPath = pPath.Substring(0, pPath.IndexOf("Model/")) + "StaticModel/"; var fullDirPath = Application.dataPath.Substring(0, Application.dataPath.Length - 6) + newDirPath; if (Directory.Exists(fullDirPath)) { Directory.Delete(fullDirPath, true); } Directory.CreateDirectory(fullDirPath); Object prefab = PrefabUtility.CreateEmptyPrefab(newDirPath + originalPrefabInstance.name + ".prefab"); PrefabUtility.ReplacePrefab(originalPrefabInstance, prefab, ReplacePrefabOptions.ConnectToPrefab); AssetDatabase.SaveAssets(); } } GameObject.DestroyImmediate(originalPrefabInstance); } } } }
public Trunk(Shoulder shoulder, Hip hip) { _robotParts = new IRobotPart[] { shoulder, hip }; }