{
 "pack": 1,
 "id": "c4c:beh:sit_down_hop",
 "type": "behaviour",
 "version": "1.0.0",
 "name": "Sit down (short legs)",
 "description": "Settles down onto its folded short legs, its tail out behind and its paws resting: sitting for the upright animal, the same on the ground, a chair or a ledge.",
 "author": {
  "id": "c4c",
  "name": "Crafts4Class"
 },
 "license": "c4c-free",
 "remixable": true,
 "derived_from": [],
 "preview": {
  "moves": [
   "sit_down_hop"
  ],
  "seconds": 3
 },
 "content_hash": "sha256:921fdb716add6520cf61b77bd60c465fe56ff339bfda064f59df0284f6d7a29d",
 "content": {
  "v": 1,
  "kind": "behaviour",
  "name": "sit_down_hop",
  "params": {
   "h": 540,
   "leg": 0.09,
   "on": 0
  },
  "scripts": [
   {
    "hat": {
     "on": "start"
    },
    "body": [
     {
      "op": "view",
      "to": "side"
     },
     {
      "op": "together",
      "branches": [
       [
        {
         "op": "ramp",
         "to": {
          "part:hips": 0,
          "part:leg:-1": 46,
          "part:leg:1": 46,
          "part:shin:-1": 92,
          "part:shin:1": 92,
          "part:foot:-1": 46,
          "part:foot:1": 46,
          "part:tail": -10,
          "part:torso": -4,
          "part:arm:-1": 20,
          "part:arm:1": 20,
          "part:forearm:-1": 30,
          "part:forearm:1": 30
         },
         "over": 0.7,
         "ease": "smooth"
        }
       ],
       [
        {
         "op": "set",
         "to": {
          "dx": 0,
          "dy": 0
         }
        },
        {
         "op": "for",
         "s": 0.7,
         "body": [
          {
           "op": "drive",
           "ch": "dy",
           "value": "=h*leg/2*(2 - cos(((0 + 46*smoothstep(min(local/0.7, 1))))*pi/180) - cos((((0 + 46*smoothstep(min(local/0.7, 1)))) - ((0 + 92*smoothstep(min(local/0.7, 1)))))*pi/180))"
          },
          {
           "op": "drive",
           "ch": "dx",
           "value": "=-h*leg/2*(sin(((0 + 46*smoothstep(min(local/0.7, 1))))*pi/180) + sin((((0 + 46*smoothstep(min(local/0.7, 1)))) - ((0 + 92*smoothstep(min(local/0.7, 1)))))*pi/180))"
          }
         ]
        }
       ]
      ]
     },
     {
      "op": "set",
      "to": {
       "dx": "=-h*leg/2*(sin((46)*pi/180) + sin(((46) - (92))*pi/180))",
       "dy": "=h*leg/2*(2 - cos((46)*pi/180) - cos(((46) - (92))*pi/180))"
      }
     }
    ]
   }
  ]
 }
}
