Fehler: Collider kopiert, aber Form ist nullptr! Joltphysik

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Fehler: Collider kopiert, aber Form ist nullptr! Joltphysik

by Anonymous » 12 Feb 2025, 02:28

Ich versuche, Jolt Physics in meinem C ++ - Spiel zu verwenden, aber zur Laufzeit ein Problem. [Fehler] Collider kopiert, aber Form ist nullptr! [*] Setup Jolt Physics mit VCPKG
[*] Kompilierte das Paket mit CMake
[*] Verknüpfte die kompilierte Bibliothek (Jolt.Lib) rechts < BR/>
Ich habe festgestellt, dass mShapeptr in JPh :: BoxShapesettings -Einstellungen in Physicicsgine :: Addbody Ist eingestellt, aber nicht mShape , aber ich weiß nicht warum ...
Gibt es etwas, das ich vermisse?
Hier ist ein Code aus meinem Projekt: < /p>
#include

// --- Minimal Collider implementation ---
namespace BlockyBuild {

enum ColliderTypes {
BoxCollider,
TriangleCollider
};

class Collider {
ColliderTypes type;
JPH::Vec3 scale;
JPH::Vec3 center;
JPH::Ref shape;
public:
// Constructor.
Collider(ColliderTypes type, const JPH::Vec3& scale, const JPH::Vec3& center = {0, 0, 0})
: type(type), scale(scale), center(center) {}

// Copy constructor.
Collider(const Collider& other)
: type(other.type), scale(other.scale), center(other.center), shape(other.shape)
{
if (shape) {
std::cerr

Top