little fixes (#183)
* Update * Add: [Get/Set]AngularDaming for standardization * Fix: Name error * Add: [Get/Set][AngularDamping/MomentOfInertia] in PhysicsComponent2D * Forgot in last commit * Add: param coordSys in [PhysicsComponent2D/RigidBody2D]::SetMassCenter * Add: Some forgotten inline * Fix little error * Fix: Indentation before case * Move and Change GetCenterOfGravity * Rename m_world into m_physWorld * Rename GetWorld int GetPhysWorld * Update: PhysicsSystem2D became an interface of PhysWorld2D * Update Collison/PhysicsComponent because GetWorld was renamed * Update tests * Update: Make the interface usable with Entity instead of PhysicsComponent * Update: Make GetPhysWorld private * Update PhysicsSystem2D.hpp * Update: indent * Remove: useless blank line * update order(?) * Update PhysicsSystem2D.hpp * Add calls to GetPhysWorld to attempt a nullptr value * update include * little fix * add some missing inline
This commit is contained in:
@@ -23,49 +23,49 @@ namespace Ndk
|
||||
PhysicsComponent3D(const PhysicsComponent3D& physics);
|
||||
~PhysicsComponent3D() = default;
|
||||
|
||||
void AddForce(const Nz::Vector3f& force, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
void AddForce(const Nz::Vector3f& force, const Nz::Vector3f& point, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
void AddTorque(const Nz::Vector3f& torque, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
inline void AddForce(const Nz::Vector3f& force, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
inline void AddForce(const Nz::Vector3f& force, const Nz::Vector3f& point, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
inline void AddTorque(const Nz::Vector3f& torque, Nz::CoordSys coordSys = Nz::CoordSys_Global);
|
||||
|
||||
void EnableAutoSleep(bool autoSleep);
|
||||
void EnableNodeSynchronization(bool nodeSynchronization);
|
||||
inline void EnableAutoSleep(bool autoSleep);
|
||||
inline void EnableNodeSynchronization(bool nodeSynchronization);
|
||||
|
||||
Nz::Boxf GetAABB() const;
|
||||
Nz::Vector3f GetAngularDamping() const;
|
||||
Nz::Vector3f GetAngularVelocity() const;
|
||||
float GetGravityFactor() const;
|
||||
float GetLinearDamping() const;
|
||||
Nz::Vector3f GetLinearVelocity() const;
|
||||
float GetMass() const;
|
||||
Nz::Vector3f GetMassCenter(Nz::CoordSys coordSys = Nz::CoordSys_Local) const;
|
||||
const Nz::Matrix4f& GetMatrix() const;
|
||||
Nz::Vector3f GetPosition() const;
|
||||
Nz::Quaternionf GetRotation() const;
|
||||
inline Nz::Boxf GetAABB() const;
|
||||
inline Nz::Vector3f GetAngularDamping() const;
|
||||
inline Nz::Vector3f GetAngularVelocity() const;
|
||||
inline float GetGravityFactor() const;
|
||||
inline float GetLinearDamping() const;
|
||||
inline Nz::Vector3f GetLinearVelocity() const;
|
||||
inline float GetMass() const;
|
||||
inline Nz::Vector3f GetMassCenter(Nz::CoordSys coordSys = Nz::CoordSys_Local) const;
|
||||
inline const Nz::Matrix4f& GetMatrix() const;
|
||||
inline Nz::Vector3f GetPosition() const;
|
||||
inline Nz::Quaternionf GetRotation() const;
|
||||
|
||||
bool IsAutoSleepEnabled() const;
|
||||
bool IsMoveable() const;
|
||||
bool IsNodeSynchronizationEnabled() const;
|
||||
bool IsSleeping() const;
|
||||
inline bool IsAutoSleepEnabled() const;
|
||||
inline bool IsMoveable() const;
|
||||
inline bool IsNodeSynchronizationEnabled() const;
|
||||
inline bool IsSleeping() const;
|
||||
|
||||
void SetAngularDamping(const Nz::Vector3f& angularDamping);
|
||||
void SetAngularVelocity(const Nz::Vector3f& angularVelocity);
|
||||
void SetGravityFactor(float gravityFactor);
|
||||
void SetLinearDamping(float damping);
|
||||
void SetLinearVelocity(const Nz::Vector3f& velocity);
|
||||
void SetMass(float mass);
|
||||
void SetMassCenter(const Nz::Vector3f& center);
|
||||
void SetMaterial(const Nz::String& materialName);
|
||||
void SetMaterial(int materialIndex);
|
||||
void SetPosition(const Nz::Vector3f& position);
|
||||
void SetRotation(const Nz::Quaternionf& rotation);
|
||||
inline void SetAngularDamping(const Nz::Vector3f& angularDamping);
|
||||
inline void SetAngularVelocity(const Nz::Vector3f& angularVelocity);
|
||||
inline void SetGravityFactor(float gravityFactor);
|
||||
inline void SetLinearDamping(float damping);
|
||||
inline void SetLinearVelocity(const Nz::Vector3f& velocity);
|
||||
inline void SetMass(float mass);
|
||||
inline void SetMassCenter(const Nz::Vector3f& center);
|
||||
inline void SetMaterial(const Nz::String& materialName);
|
||||
inline void SetMaterial(int materialIndex);
|
||||
inline void SetPosition(const Nz::Vector3f& position);
|
||||
inline void SetRotation(const Nz::Quaternionf& rotation);
|
||||
|
||||
static ComponentIndex componentIndex;
|
||||
|
||||
private:
|
||||
void ApplyPhysicsState(Nz::RigidBody3D& rigidBody) const;
|
||||
void CopyPhysicsState(const Nz::RigidBody3D& rigidBody);
|
||||
Nz::RigidBody3D* GetRigidBody();
|
||||
const Nz::RigidBody3D& GetRigidBody() const;
|
||||
inline void ApplyPhysicsState(Nz::RigidBody3D& rigidBody) const;
|
||||
inline void CopyPhysicsState(const Nz::RigidBody3D& rigidBody);
|
||||
inline Nz::RigidBody3D* GetRigidBody();
|
||||
inline const Nz::RigidBody3D& GetRigidBody() const;
|
||||
|
||||
void OnAttached() override;
|
||||
void OnComponentAttached(BaseComponent& component) override;
|
||||
|
||||
Reference in New Issue
Block a user