刚体组件. 更多...
#include <RigidBody.h>
Public 成员函数 | |
| ~RigidBody () | |
| 清空关联的碰撞器附着的这个物理属性 | |
| virtual void | BeginPlay () |
| 设置纯虚函数,把不能写在构造却需要优先实现的写在这. | |
| virtual void | Update (float deltaTime) override |
| void | SetGravity (float gravity) |
| 设置重力加速度 | |
| void | SetVelocity (Vector2D velocity) |
| 设置速度 | |
| Vector2D | GetVelocity () |
| 获取速度 | |
| void | SetAngularVelocity (float angularVelocity) |
| 设置角阻尼 | |
| void | AddForce (Vector2D force) |
| 添加持续力 | |
| void | AddPulse (Vector2D pulse) |
| 添加冲量 | |
| void | SetMoveable (bool Moveable) |
| 是否可移动 | |
| void | SetGravityEnable (bool GravityEnable) |
| 是否启用重力 | |
| void | SetRotatable (bool Rotatable) |
| 是否可旋转 | |
| void | SetMass (float mass) |
| void | SetMaxSpeed (float maxSpeed) |
| void | SetLinearDrag (float linearDrag) |
| void | SetAngularDrag (float angularDrag) |
Public 成员函数 继承自 Component | |
| virtual void | EndPlay () |
| 把一些不能写在析构函数的一些操作写在这里 | |
| void | SetOwner (class Object *owner) |
| 设置绑定对象. | |
| virtual void | Destruct () |
| 解除物体绑定组件,并销毁组件 | |
| virtual void | Activate () |
| 激活组件 | |
| virtual void | Deactivate () |
| 停用组件 | |
| Object * | GetOwner () const |
| 获取绑定对象指针 | |
Public 成员函数 继承自 base | |
| base () | |
| virtual | ~base () |
| std::string | GetName () const |
| void | SetName (const std::string &name) |
Private 成员函数 | |
| void | RestrictVelocity (Vector2D impactnolunit, RigidBody *another=nullptr) |
| 物理模拟计算. | |
| void | RestrictVelocity (Vector2D impactnolunit, const PhysicsMaterial &material, RigidBody *another=nullptr) |
| 物理模拟计算. | |
Private 属性 | |
| Vector2D | velocity = Vector2D(0, 0) |
| 速度 | |
| float | maxSpeed = 1000.f |
| 最大速度 | |
| float | gravity = 9.8f |
| 重力加速度 | |
| float | angularVelocity = 0.f |
| 角速度 实现自旋的角度 | |
| bool | bGravityEnable = true |
| 是否实现重力计算 | |
| bool | bMoveable = true |
| 是否实现移动 | |
| bool | bRotatable = true |
| 是否实现旋转 | |
| float | mass = 1.0f |
| 质量 | |
| float | linearDrag = 0.f |
| 线性阻尼 | |
| float | angularDrag = 0.f |
| 角阻尼 | |
| float | deltaTime = 0.f |
| 每帧的时间 | |
| std::unordered_set< class Collider * > | colliders |
| 存储附着的碰撞体 | |
友元 | |
| class | Collider |
额外继承的成员函数 | |
Protected 属性 继承自 Component | |
| class Object * | pOwner = nullptr |
| 处理控制逻辑 有对象物体的指针才能进行控制 | |
| bool | bIsEnabled = true |
| 是否激活 | |
刚体组件.
利用物理 实现对物体坐标控制
| RigidBody::~RigidBody | ( | ) |
清空关联的碰撞器附着的这个物理属性
|
inline |
添加持续力
|
inline |
添加冲量
瞬间添加一个力 瞬时力
|
inlinevirtual |
设置纯虚函数,把不能写在构造却需要优先实现的写在这.
重载 Component .
|
inline |
获取速度
|
private |
物理模拟计算.
| [in] | impactnolunit | 施加力的方向单位向量 |
| [in] | material | 材质类 |
| [in] | another | 碰撞到的物体刚体组件指针 |
物理模拟计算.
| [in] | impactnolunit | 施加力的方向单位向量 |
| [in] | another | 碰撞到的物体刚体组件指针 |
|
inline |
|
inline |
设置角阻尼
|
inline |
设置重力加速度
|
inline |
是否启用重力
|
inline |
|
inline |
|
inline |
|
inline |
是否可移动
|
inline |
是否可旋转
|
inline |
设置速度
|
overridevirtual |
重载 Component .
|
friend |
|
private |
角阻尼
|
private |
角速度 实现自旋的角度
|
private |
是否实现重力计算
|
private |
是否实现移动
|
private |
是否实现旋转
|
private |
存储附着的碰撞体
|
private |
每帧的时间
|
private |
重力加速度
|
private |
线性阻尼
|
private |
质量
|
private |
最大速度