|
| PhysicBody (PhysicWorld *world, Type type) |
| 初始化物体 更多...
|
|
| PhysicBody (PhysicWorldPtr world, Type type) |
| 初始化物体 更多...
|
|
bool | Init (PhysicWorld *world) |
| 初始化物体 更多...
|
|
void | AddFixture (FixturePtr fixture) |
| 添加夹具
|
|
Fixture * | AddCircleShape (float radius, float density, float friction=0.2f) |
| 添加圆形夹具 更多...
|
|
Fixture * | AddRectShape (const Vec2 &size, float density, float friction=0.2f) |
| 添加矩形夹具 更多...
|
|
Fixture * | AddPolygonShape (const Vector< Point > &vertexs, float density, float friction=0.2f) |
| 添加多边形夹具 更多...
|
|
Fixture * | AddEdgeShape (const Point &p1, const Point &p2, float density, float friction=0.2f) |
| 添加线段形夹具 更多...
|
|
Fixture * | AddChainShape (const Vector< Point > &vertices, bool loop, float density, float friction=0.2f) |
| 添加链条形夹具 更多...
|
|
void | RemoveFixture (FixturePtr fixture) |
| 移除夹具
|
|
void | RemoveAllFixtures () |
| 移除所有夹具
|
|
FixtureList | GetFixtureList () const |
| 获取夹具列表
|
|
ContactEdgeList | GetContactList () const |
| 获取接触边列表
|
|
uint16_t | GetCategoryBits () const |
| 获取类别码
|
|
void | SetCategoryBits (uint16_t category_bits) |
| 设置类别码
|
|
uint16_t | GetMaskBits () const |
| 获取碰撞掩码
|
|
void | SetMaskBits (uint16_t mask_bits) |
| 设置碰撞掩码
|
|
int16_t | GetGroupIndex () const |
| 获取组索引
|
|
void | SetGroupIndex (int16_t index) |
| 设置组索引
|
|
float | GetRotation () const |
| 获取旋转角度
|
|
void | SetRotation (float angle) |
| 设置旋转角度
|
|
Point | GetPosition () const |
| 获取物体位置
|
|
void | SetPosition (const Point &pos) |
| 设置物体位置
|
|
void | SetTransform (const Point &pos, float angle) |
| 位置和旋转变换
|
|
float | GetMass () const |
| 获取质量 [kg]
|
|
float | GetInertia () const |
| 获取惯性
|
|
void | GetMassData (float *mass, Point *center, float *inertia) const |
| 获取质量数据 更多...
|
|
void | SetMassData (float mass, const Point ¢er, float inertia) |
| 设置质量数据 更多...
|
|
void | ResetMassData () |
| 重置质量数据
|
|
Point | GetLocalPoint (const Point &world) const |
| 获取世界坐标系上的点在物体上的位置
|
|
Vec2 | GetLocalVector (const Vec2 &world) const |
| 将世界坐标系中的向量转换到物体坐标系下
|
|
Point | GetWorldPoint (const Point &local) const |
| 获取物体上的点在世界坐标系的位置
|
|
Vec2 | GetWorldVector (const Vec2 &local) const |
| 将物体坐标系中的向量转换到世界坐标系下
|
|
Point | GetLocalCenter () const |
| 获取物体质心相对于物体的位置
|
|
Point | GetWorldCenter () const |
| 获取物体质心位置
|
|
Type | GetType () const |
| 获取物体类型
|
|
void | SetType (Type type) |
| 设置物体类型
|
|
float | GetGravityScale () const |
| 获取物体受重力的比例
|
|
void | SetGravityScale (float scale) |
| 设置物体受重力的比例
|
|
float | GetLinearDamping () const |
| 获取线性阻尼
|
|
void | SetLinearDamping (float damping) |
| 设置线性阻尼
|
|
float | GetAngularDamping () const |
| 获取旋转阻尼
|
|
void | SetAngularDamping (float damping) |
| 设置旋转阻尼
|
|
void | ApplyForce (const Vec2 &force, const Point &point, bool wake=true) |
| 施力 更多...
|
|
void | ApplyForceToCenter (const Vec2 &force, bool wake=true) |
| 给物体中心施力 更多...
|
|
void | ApplyTorque (float torque, bool wake=false) |
| 施加扭矩 更多...
|
|
bool | IsIgnoreRotation () const |
| 旋转角度是否固定
|
|
void | SetIgnoreRotation (bool flag) |
| 设置是否固定旋转角度
|
|
bool | IsBullet () const |
| 是否是子弹物体
|
|
void | SetBullet (bool flag) |
| 设置物体是否是子弹物体
|
|
bool | IsAwake () const |
| 是否处于唤醒状态
|
|
void | SetAwake (bool flag) |
| 设置唤醒状态
|
|
bool | IsSleepingAllowed () const |
| 是否启用休眠
|
|
void | SetSleepingAllowed (bool flag) |
| 设置是否允许休眠
|
|
bool | IsActive () const |
| 是否启用
|
|
void | SetActive (bool flag) |
| 设置启用状态
|
|
PhysicWorld * | GetWorld () const |
| 获取物体所在物理世界
|
|
void | Destroy () |
| 销毁物体
|
|
b2Body * | GetB2Body () const |
| 获取b2Body
|
|
void | SetB2Body (b2Body *body) |
| 设置b2Body
|
|
bool | IsEnable () const |
| 是否启用组件
|
|
void | SetEnabled (bool enabled) |
| 设置组件启用或禁用
|
|
Actor * | GetBoundActor () const |
| 获取绑定的角色
|
|
void | RemoveFromActor () |
| 从角色中移除
|
|
| ObjectBase () |
| 构造基础对象
|
|
void | SetName (const String &name) |
| 设置对象名
|
|
String | GetName () const |
| 获取对象名
|
|
bool | IsName (const String &name) const |
| 判断对象的名称是否相同 更多...
|
|
void * | GetUserData () const |
| 获取用户数据
|
|
void | SetUserData (void *data) |
| 设置用户数据
|
|
uint64_t | GetObjectID () const |
| 获取对象ID
|
|
void | DoSerialize (Serializer *serializer) const override |
| 序列化
|
|
void | DoDeserialize (Deserializer *deserializer) override |
| 反序列化
|
|
virtual bool | IsValid () const |
| 判断对象是否有效
|
|
ObjectStatus * | GetStatus () const |
| 获取对象状态
|
|
void | SetStatus (const ObjectStatus &status) |
| 设置对象状态
|
|
void | Fail (const String &msg, int code=ObjectStatus::fail) |
| 将对象标记为失败状态
|
|
void | ClearStatus () |
| 清除对象状态
|
|
void | Retain () |
| 增加引用计数
|
|
void | Release () |
| 减少引用计数
|
|
uint32_t | GetRefCount () const |
| 获取引用计数
|
|
Vector< uint8_t > | Serialize () const |
| 序列化为字节串
|
|
void | Deserialize (const Vector< uint8_t > &data) |
| 从字节串反序列化
|
|