Box2d学习笔记四:API学习之b2Body

经过上两次的文章,我们已经对box2d进行物理模拟有了大概的认识,下面我们详细的了解box2d提供的各个类和它们的函数。参照帮助文档:

b2Fixture *  CreateFixture (const b2FixtureDef *def) //创建框架
b2Fixture *  CreateFixture (const b2Shape *shape, float32 density) //以形状和密度为参数创建框架
void  DestroyFixture (b2Fixture *fixture) //摧毁框架
void  SetTransform (const b2Vec2 &position, float32 angle) //设置变换,位置和角度的变换
const b2Transform &  GetTransform () const //得到一个变换
const b2Vec2 &  GetPosition () const //得到刚体的位置
float32  GetAngle () const //得到刚体的角度
const b2Vec2 &  GetWorldCenter () const //得到质心在世界坐标系中的位置
  Get the world position of the center of mass. 
const b2Vec2 &  GetLocalCenter () const //得到质心在本地坐标系中的位置
  Get the local position of the center of mass. 
void  SetLinearVelocity (const b2Vec2 &v) //设置线速度
b2Vec2  GetLinearVelocity () const //得到刚体目前的线速度
void  SetAngularVelocity (float32 omega) //设置角速度
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值