ããªãªã®ã¸ã£ã³ãå®è£ æ³ã¨Verletç©å
(追è¨)JavaScriptで実装してみました
æãä½ãã®éèª*1ã§ããªãªã®ã¸ã£ã³ãã®å®è£
æ³ãè¦ãè¦ãããã£ã¦ããã®æ¾ç©ç·éåã¯ã
ããªãªã®é度ãã¯ãã«ãä¿åãã¦ããã¦åº§æ¨ãè¨ç®ããããããªãã¦ã
ããªãªã®ååã®åº§æ¨ãä¿åãã¦ããã¦åº§æ¨ãè¨ç®ãã¦ãããã ããã§ãã
y_temp = Mario.y; Mario.y += (Mario.y - Mario.y_prev) + F; Mario.y_prev = y_temp;
Fã¯ãã®ç¬éã®åã§ãã¸ã£ã³ãã®ç¬éã¯F=10ã«ãã¦ã空ä¸ã§ã¯F=-1ã«ãã¾ãã
ããã¨ãããªæ¾ç©ç·ã«ãªãã¾ãã
[0,10,19, 27, 34, 40, 45, 49, 52, 54, 55, 55, 54, 52, 49, 45, 40, 34, 27, 19, 10, 0]
å æ¸ç®ãã使ããªãã®ã§ãé常ã«é«éã«ã§ããã¨ã
ãããVerletç©åã«ä¼¼ã¦ãããªã¨æã£ãã®ãä»æ¥ã®æ¬é¡ã
次ã«ããªã¤ã©ã¼æ³ãä½ã£ãã¤ãããå®ã¯ã·ã³ãã¬ã¯ãã£ãã¯ã«ãªã£ã¦ããã§æå㪠Verletã使ã£ã¦ã¿ããè¦ãç®ãªã¤ã©ã¼æ³ãªã®ã§å®è£ ã¯ãã£ãã楽ã§ããã
(ä¸ç¥)
Verletã¯ããã°ã©ã 楽ã ããã¨ãã«ã®ã¼ä¿åããããè¨ç®æéååã ã㧠RK(ã«ã³ã²ï¼ã¯ãã¿)ããã¨ãç¡ãã¨ããæãã§ããã
引用元
Cowboy Programming » Blob Physicsã«ãã話ãªãã§ããã
Verletã ã¨åº§æ¨ã ãã§è©±ãå®çµããã®ã§ãå£ã«ãããããããããªãã¨ãã£ãå¶ç´æ¡ä»¶ã®è¨è¿°ãããã楽ã
æ®éã ã¨ãé度ããæªæ¥ã®åº§æ¨ãè¨ç®ããããã§ãããããã§å£ã«ãããã¾ãªãããã«"é度ã調æ´ãã"ã®ã¯ãé¢åãªãã§ãã
ããªãªãã¸ã£ã³ãããã°å£ã«å½ããã®ã§ããã®ãã¯ããã¯ã使ã£ã¦ãããããªãããªã
*1:bitèª1997å¹´"ã¢ã¼ã±ã¼ãã²ã¼ã ã®ãã¯ããã¸"ã ã£ãããªãæ å ±æ±ã