v6 rotational walking :D
This commit is contained in:
+11
-1
@@ -24,7 +24,7 @@ public class Leg : MonoBehaviour {
|
||||
public double translateZ = 0;
|
||||
|
||||
public GameObject pointShouldBe;
|
||||
public Vector3 pos = new Vector3(0, 0, 0);
|
||||
//public Vector3 pos = new Vector3(0, 0, 0);
|
||||
|
||||
public int startServo = -1;
|
||||
|
||||
@@ -99,6 +99,16 @@ public class Leg : MonoBehaviour {
|
||||
pointShouldBe.transform.localPosition = foot.pos;
|
||||
}
|
||||
|
||||
public Vector3 getWorldPos()
|
||||
{
|
||||
return point + new Vector3((float)translateX, (float)translateY, (float)translateZ);
|
||||
}
|
||||
|
||||
public void setWorldPos(Vector3 pos)
|
||||
{
|
||||
this.point = pos - new Vector3((float)translateX, (float)translateY, (float)translateZ);
|
||||
}
|
||||
|
||||
public static float Remap(float value, float from1, float to1, float from2, float to2)
|
||||
{
|
||||
return (value - from1) / (to1 - from1) * (to2 - from2) + from2;
|
||||
|
||||
Reference in New Issue
Block a user