box2dweb资料

项目地址:http://code.google.com/p/box2dweb/
API查询:http://www.box2dflash.org/docs/2.1a/reference/

cocos2d-html5中的物理引擎用的就是这个项目。

几篇入门文章:
http://blog.csdn.net/mibb005/article/details/7616823
http://www.cnblogs.com/Just-go/archive/2012/03/12/2392134.html
http://xiaoba.sinaapp.com/50.html
http://www.emanueleferonato.com/category/box2d/
http://box2dweb.com/blog/2012/03/03/box2dweb-study-note-series-box2dweb-%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%e7%b3%bb%e5%88%97/
http://www.byywee.com/page/M0/S688/688888.html

http://www.ohcoder.com/post/2012-09-01/40037279554

http://www.ladeng6666.com/blog/

========================================

作用力


function push() {

         car.ApplyForce(new b2Vec2(-99,0), car.GetWorldCenter());

}



冲量

function hit() {

         car.ApplyImpulse(new b2Vec2(-99,0), car.GetWorldCenter())
}


速度

function speed() {

         car.SetAwake(true);

         car.SetLinearVelocity(new b2Vec2(-99,0))
}


瞬移

function teleport() {
         car.SetPositionAndAngle(new b2Vec2(5,0),0);
}


ApplyForce和ApplyImpulse都是在原来速度的基础上,添加新的速度,组合成最终的速度。而SetLinearVelocity是将原来的速度清空掉,直接换成新的速度,另外SetLinearVelocity不会自动唤醒睡眠中的物体,如果物体在睡眠状态,需要手动SetAwake它。

原文地址:https://www.cnblogs.com/cly84920/p/4426501.html