Physics3D: Rename Physics3DBody to PhysBody3D
This commit is contained in:
parent
9e3ca2472b
commit
8c41ac30c9
|
|
@ -32,10 +32,10 @@
|
||||||
#include <Nazara/Physics3D/Collider3D.hpp>
|
#include <Nazara/Physics3D/Collider3D.hpp>
|
||||||
#include <Nazara/Physics3D/Config.hpp>
|
#include <Nazara/Physics3D/Config.hpp>
|
||||||
#include <Nazara/Physics3D/Enums.hpp>
|
#include <Nazara/Physics3D/Enums.hpp>
|
||||||
|
#include <Nazara/Physics3D/PhysBody3D.hpp>
|
||||||
#include <Nazara/Physics3D/PhysCharacter3D.hpp>
|
#include <Nazara/Physics3D/PhysCharacter3D.hpp>
|
||||||
#include <Nazara/Physics3D/PhysConstraint3D.hpp>
|
#include <Nazara/Physics3D/PhysConstraint3D.hpp>
|
||||||
#include <Nazara/Physics3D/Physics3D.hpp>
|
#include <Nazara/Physics3D/Physics3D.hpp>
|
||||||
#include <Nazara/Physics3D/Physics3DBody.hpp>
|
|
||||||
#include <Nazara/Physics3D/Physiscs3DStepListener.hpp>
|
#include <Nazara/Physics3D/Physiscs3DStepListener.hpp>
|
||||||
#include <Nazara/Physics3D/PhysWorld3D.hpp>
|
#include <Nazara/Physics3D/PhysWorld3D.hpp>
|
||||||
#include <Nazara/Physics3D/RigidBody3D.hpp>
|
#include <Nazara/Physics3D/RigidBody3D.hpp>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
|
||||||
|
// This file is part of the "Nazara Engine - Physics3D module"
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NAZARA_PHYSICS3D_PHYSBODY3D_HPP
|
||||||
|
#define NAZARA_PHYSICS3D_PHYSBODY3D_HPP
|
||||||
|
|
||||||
|
#include <NazaraUtils/Prerequisites.hpp>
|
||||||
|
#include <Nazara/Physics3D/Config.hpp>
|
||||||
|
|
||||||
|
namespace Nz
|
||||||
|
{
|
||||||
|
class NAZARA_PHYSICS3D_API PhysBody3D
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PhysBody3D() = default;
|
||||||
|
PhysBody3D(const PhysBody3D&) = delete;
|
||||||
|
PhysBody3D(PhysBody3D&&) = delete;
|
||||||
|
virtual ~PhysBody3D();
|
||||||
|
|
||||||
|
virtual UInt32 GetBodyIndex() const = 0;
|
||||||
|
|
||||||
|
PhysBody3D& operator=(const PhysBody3D&) = delete;
|
||||||
|
PhysBody3D& operator=(PhysBody3D&&) = delete;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Nazara/Physics3D/PhysBody3D.inl>
|
||||||
|
|
||||||
|
#endif // NAZARA_PHYSICS3D_PHYSBODY3D_HPP
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#include <Nazara/Math/Quaternion.hpp>
|
#include <Nazara/Math/Quaternion.hpp>
|
||||||
#include <Nazara/Math/Vector3.hpp>
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
#include <Nazara/Physics3D/Config.hpp>
|
#include <Nazara/Physics3D/Config.hpp>
|
||||||
#include <Nazara/Physics3D/Physics3DBody.hpp>
|
#include <Nazara/Physics3D/PhysBody3D.hpp>
|
||||||
#include <Nazara/Physics3D/Physiscs3DStepListener.hpp>
|
#include <Nazara/Physics3D/Physiscs3DStepListener.hpp>
|
||||||
#include <NazaraUtils/MovablePtr.hpp>
|
#include <NazaraUtils/MovablePtr.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
@ -28,7 +28,7 @@ namespace Nz
|
||||||
class Collider3D;
|
class Collider3D;
|
||||||
class PhysWorld3D;
|
class PhysWorld3D;
|
||||||
|
|
||||||
class NAZARA_PHYSICS3D_API PhysCharacter3D : public Physics3DBody, public Physiscs3DStepListener
|
class NAZARA_PHYSICS3D_API PhysCharacter3D : public PhysBody3D, public Physiscs3DStepListener
|
||||||
{
|
{
|
||||||
friend PhysWorld3D;
|
friend PhysWorld3D;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace JPH
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
class Physics3DBody;
|
class PhysBody3D;
|
||||||
class PhysCharacter3D;
|
class PhysCharacter3D;
|
||||||
class PhysCharacter3DImpl;
|
class PhysCharacter3DImpl;
|
||||||
class Collider3D;
|
class Collider3D;
|
||||||
|
|
@ -82,20 +82,20 @@ namespace Nz
|
||||||
|
|
||||||
struct PointCollisionInfo
|
struct PointCollisionInfo
|
||||||
{
|
{
|
||||||
Physics3DBody* hitBody = nullptr;
|
PhysBody3D* hitBody = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaycastHit
|
struct RaycastHit
|
||||||
{
|
{
|
||||||
float fraction;
|
float fraction;
|
||||||
Physics3DBody* hitBody = nullptr;
|
PhysBody3D* hitBody = nullptr;
|
||||||
Vector3f hitNormal;
|
Vector3f hitNormal;
|
||||||
Vector3f hitPosition;
|
Vector3f hitPosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ShapeCollisionInfo
|
struct ShapeCollisionInfo
|
||||||
{
|
{
|
||||||
Physics3DBody* hitBody = nullptr;
|
PhysBody3D* hitBody = nullptr;
|
||||||
Vector3f collisionPosition1;
|
Vector3f collisionPosition1;
|
||||||
Vector3f collisionPosition2;
|
Vector3f collisionPosition2;
|
||||||
Vector3f penetrationAxis;
|
Vector3f penetrationAxis;
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
|
|
||||||
// This file is part of the "Nazara Engine - Physics3D module"
|
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#ifndef NAZARA_PHYSICS3D_PHYSICS3DBODY_HPP
|
|
||||||
#define NAZARA_PHYSICS3D_PHYSICS3DBODY_HPP
|
|
||||||
|
|
||||||
#include <NazaraUtils/Prerequisites.hpp>
|
|
||||||
#include <Nazara/Physics3D/Config.hpp>
|
|
||||||
|
|
||||||
namespace Nz
|
|
||||||
{
|
|
||||||
class NAZARA_PHYSICS3D_API Physics3DBody
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Physics3DBody() = default;
|
|
||||||
Physics3DBody(const Physics3DBody&) = delete;
|
|
||||||
Physics3DBody(Physics3DBody&&) = delete;
|
|
||||||
virtual ~Physics3DBody();
|
|
||||||
|
|
||||||
virtual UInt32 GetBodyIndex() const = 0;
|
|
||||||
|
|
||||||
Physics3DBody& operator=(const Physics3DBody&) = delete;
|
|
||||||
Physics3DBody& operator=(Physics3DBody&&) = delete;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <Nazara/Physics3D/Physics3DBody.inl>
|
|
||||||
|
|
||||||
#endif // NAZARA_PHYSICS3D_PHYSICS3DBODY_HPP
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
#include <Nazara/Math/Vector3.hpp>
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
#include <Nazara/Physics3D/Collider3D.hpp>
|
#include <Nazara/Physics3D/Collider3D.hpp>
|
||||||
#include <Nazara/Physics3D/Config.hpp>
|
#include <Nazara/Physics3D/Config.hpp>
|
||||||
#include <Nazara/Physics3D/Physics3DBody.hpp>
|
#include <Nazara/Physics3D/PhysBody3D.hpp>
|
||||||
#include <NazaraUtils/MovablePtr.hpp>
|
#include <NazaraUtils/MovablePtr.hpp>
|
||||||
|
|
||||||
namespace JPH
|
namespace JPH
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
class PhysWorld3D;
|
class PhysWorld3D;
|
||||||
|
|
||||||
class NAZARA_PHYSICS3D_API RigidBody3D : public Physics3DBody
|
class NAZARA_PHYSICS3D_API RigidBody3D : public PhysBody3D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct DynamicSettings;
|
struct DynamicSettings;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
// This file is part of the "Nazara Engine - Physics3D module"
|
// This file is part of the "Nazara Engine - Physics3D module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
#include <Nazara/Physics3D/Physics3DBody.hpp>
|
#include <Nazara/Physics3D/PhysBody3D.hpp>
|
||||||
#include <Nazara/Physics3D/Debug.hpp>
|
#include <Nazara/Physics3D/Debug.hpp>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
Physics3DBody::~Physics3DBody() = default;
|
PhysBody3D::~PhysBody3D() = default;
|
||||||
}
|
}
|
||||||
|
|
@ -185,7 +185,7 @@ namespace Nz
|
||||||
|
|
||||||
JPH::Body& body = lock.GetBody();
|
JPH::Body& body = lock.GetBody();
|
||||||
|
|
||||||
hitInfo.hitBody = BitCast<Physics3DBody*>(static_cast<std::uintptr_t>(body.GetUserData()));
|
hitInfo.hitBody = BitCast<PhysBody3D*>(static_cast<std::uintptr_t>(body.GetUserData()));
|
||||||
|
|
||||||
if (auto fractionOpt = m_callback(hitInfo))
|
if (auto fractionOpt = m_callback(hitInfo))
|
||||||
{
|
{
|
||||||
|
|
@ -235,7 +235,7 @@ namespace Nz
|
||||||
|
|
||||||
JPH::Body& body = lock.GetBody();
|
JPH::Body& body = lock.GetBody();
|
||||||
|
|
||||||
hitInfo.hitBody = BitCast<Physics3DBody*>(static_cast<std::uintptr_t>(body.GetUserData()));
|
hitInfo.hitBody = BitCast<PhysBody3D*>(static_cast<std::uintptr_t>(body.GetUserData()));
|
||||||
|
|
||||||
if (auto fractionOpt = m_callback(hitInfo))
|
if (auto fractionOpt = m_callback(hitInfo))
|
||||||
{
|
{
|
||||||
|
|
@ -285,7 +285,7 @@ namespace Nz
|
||||||
|
|
||||||
JPH::Body& body = lock.GetBody();
|
JPH::Body& body = lock.GetBody();
|
||||||
|
|
||||||
hitInfo.hitBody = BitCast<Physics3DBody*>(static_cast<std::uintptr_t>(body.GetUserData()));
|
hitInfo.hitBody = BitCast<PhysBody3D*>(static_cast<std::uintptr_t>(body.GetUserData()));
|
||||||
hitInfo.hitNormal = FromJolt(body.GetWorldSpaceSurfaceNormal(result.mSubShapeID2, ToJolt(hitInfo.hitPosition)));
|
hitInfo.hitNormal = FromJolt(body.GetWorldSpaceSurfaceNormal(result.mSubShapeID2, ToJolt(hitInfo.hitPosition)));
|
||||||
|
|
||||||
if (auto fractionOpt = m_callback(hitInfo))
|
if (auto fractionOpt = m_callback(hitInfo))
|
||||||
|
|
@ -515,7 +515,7 @@ namespace Nz
|
||||||
RaycastHit hitInfo;
|
RaycastHit hitInfo;
|
||||||
hitInfo.fraction = collector.mHit.GetEarlyOutFraction();
|
hitInfo.fraction = collector.mHit.GetEarlyOutFraction();
|
||||||
hitInfo.hitPosition = Lerp(from, to, hitInfo.fraction);
|
hitInfo.hitPosition = Lerp(from, to, hitInfo.fraction);
|
||||||
hitInfo.hitBody = BitCast<Physics3DBody*>(static_cast<std::uintptr_t>(body.GetUserData()));
|
hitInfo.hitBody = BitCast<PhysBody3D*>(static_cast<std::uintptr_t>(body.GetUserData()));
|
||||||
hitInfo.hitNormal = FromJolt(body.GetWorldSpaceSurfaceNormal(collector.mHit.mSubShapeID2, rayCast.GetPointOnRay(collector.mHit.GetEarlyOutFraction())));
|
hitInfo.hitNormal = FromJolt(body.GetWorldSpaceSurfaceNormal(collector.mHit.mSubShapeID2, rayCast.GetPointOnRay(collector.mHit.GetEarlyOutFraction())));
|
||||||
|
|
||||||
callback(hitInfo);
|
callback(hitInfo);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <Nazara/Physics3D/Systems/Physics3DSystem.hpp>
|
#include <Nazara/Physics3D/Systems/Physics3DSystem.hpp>
|
||||||
#include <Nazara/Core/Components/DisabledComponent.hpp>
|
#include <Nazara/Core/Components/DisabledComponent.hpp>
|
||||||
#include <Nazara/Physics3D/Physics3DBody.hpp>
|
#include <Nazara/Physics3D/PhysBody3D.hpp>
|
||||||
#include <Nazara/Utility/Components/NodeComponent.hpp>
|
#include <Nazara/Utility/Components/NodeComponent.hpp>
|
||||||
#include <Nazara/Physics3D/Debug.hpp>
|
#include <Nazara/Physics3D/Debug.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue