![]() |
Kiwano Engine v1.3.x
|
物体 更多...
#include <Body.h>
Public 成员函数 | |
| Body (b2Body *body, b2World *world=nullptr) | |
| 初始化物体 更多... | |
| b2Body * | GetB2Body () const |
| 获取b2Body | |
| Point | GetLocalPoint (const Point &world) const |
| 获取世界坐标系上的点在物体上的位置 | |
| Vec2 | GetLocalVector (const Vec2 &world) const |
| 将世界坐标系中的向量转换到物体坐标系下 | |
| Point | GetWorldPoint (const Point &local) const |
| 获取物体上的点在世界坐标系的位置 | |
| Vec2 | GetWorldVector (const Vec2 &local) const |
| 将物体坐标系中的向量转换到世界坐标系下 | |
Public 成员函数 继承自 kiwano::Component | |
| bool | IsEnable () const |
| 是否启用组件 | |
| void | SetEnabled (bool enabled) |
| 设置组件启用或禁用 | |
| Actor * | GetBoundActor () const |
| 获取绑定的角色 | |
| void | RemoveFromActor () |
| 从角色中移除 | |
Public 成员函数 继承自 kiwano::ObjectBase | |
| ObjectBase () | |
| 构造基础对象 | |
| void | SetName (StringView name) |
| 设置对象名 | |
| StringView | GetName () const |
| 获取对象名 | |
| bool | IsName (StringView name) const |
| 判断对象的名称是否相同 更多... | |
| void * | GetUserData () const |
| 获取用户数据 | |
| void | SetUserData (void *data) |
| 设置用户数据 更多... | |
| void | Hold (RefPtr< ObjectBase > other) |
| 持有一个对象并管理其生命周期 更多... | |
| void | Unhold (RefPtr< ObjectBase > other) |
| 放弃持有的对象 更多... | |
| 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 (StringView msg, int code=ObjectStatus::fail) |
| 将对象标记为失败状态 | |
| void | ClearStatus () |
| 清除对象状态 | |
Public 成员函数 继承自 kiwano::RefObject | |
| void | Retain () |
| 增加引用计数 | |
| void | Release () |
| 减少引用计数 | |
| uint32_t | GetRefCount () const |
| 获取引用计数 | |
Public 成员函数 继承自 kiwano::Serializable | |
| Vector< uint8_t > | Serialize () const |
| 序列化为字节串 | |
| void | Deserialize (const Vector< uint8_t > &data) |
| 从字节串反序列化 | |
| virtual void | DoSerialize (Serializer *serializer) const =0 |
| 执行序列化 更多... | |
| virtual void | DoDeserialize (Deserializer *deserializer)=0 |
| 执行反序列化 更多... | |
Protected 成员函数 | |
| void | InitComponent (Actor *actor) override |
| 初始化组件 更多... | |
| void | DestroyComponent () override |
| 销毁组件 更多... | |
| void | UpdateFromActor (Actor *actor) |
| 更新物体状态 | |
| void | UpdateFromActor (Actor *actor, const Matrix3x2 &actor_to_world, float parent_rotation) |
| 更新物体状态 | |
| void | BeforeSimulation (Actor *actor, const Matrix3x2 &parent_to_world, const Matrix3x2 &actor_to_world, float parent_rotation) |
| 更新物理身体前 | |
| void | AfterSimulation (Actor *actorconst, const Matrix3x2 &parent_to_world, float parent_rotation) |
| 更新物理身体后 | |
Protected 成员函数 继承自 kiwano::Component | |
| virtual void | InitComponent (Actor *actor) |
| 初始化组件 更多... | |
| virtual void | DestroyComponent () |
| 销毁组件 更多... | |
| virtual void | OnUpdate (Duration dt) |
| 更新组件 更多... | |
| virtual void | OnRender (RenderContext &ctx) |
| 渲染组件 更多... | |
友元 | |
| class | World |
额外继承的成员函数 | |
静态 Public 成员函数 继承自 kiwano::ObjectBase | |
| static void | SetObjectPolicy (const ObjectPolicyFunc &policy) |
| 设置对象处理策略 | |
| static bool | IsTracingLeaks () |
| 是否启用了内存泄漏追踪 | |
| static void | StartTracingLeaks () |
| 开始追踪内存泄漏 | |
| static void | StopTracingLeaks () |
| 停止追踪内存泄漏 | |
| static void | DumpTracingObjects () |
| 打印所有追踪中的对象信息 | |
| static Vector< ObjectBase * > & | GetTracingObjects () |
| 获取所有追踪中的对象 | |
静态 Public 成员函数 继承自 kiwano::RefObject | |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
| static void * | operator new (size_t size, std::nothrow_t const &) noexcept |
| static void | operator delete (void *ptr, std::nothrow_t const &) noexcept |
| static void * | operator new (size_t size, void *ptr) noexcept |
| static void | operator delete (void *ptr, void *place) noexcept |
物体
| kiwano::physics::Body::Body | ( | b2Body * | body, |
| b2World * | world = nullptr |
||
| ) |
初始化物体
| world | 物理世界 |
| type | 物体类型 |
|
overrideprotectedvirtual |
销毁组件
重载 kiwano::Component .
|
overrideprotectedvirtual |
初始化组件
重载 kiwano::Component .