How to store the Pxfixedjoint class in a vector

Asked

Viewed 47 times

0

I’m trying to store the class PxFixedJoint in a std::vector with the method push_back. But the vector is always empty, simply adds nothing.

Down with the code.

// C++
// Declaração do vector para armazenar os joints
std::vector<physx::PxFixedJoint*> m_lpJoints;

// Criando um joint
physx::PxFixedJoint* joint = physx::PxFixedJointCreate(*physics, m_pPhysicsBody, physx::PxTransform(-offset), _target, physx::PxTransform(offset));

// Armazenando
m_lpJoints.push_back(joint);

// Verificando o tamanho do vetor
std::cout << "size: " << m_lpJoints.size() << std::endl;
  • Did you solve the problem? Because apparently there’s nothing wrong with the code.

1 answer

0


Solved

I simply stored the class PxJoint instead of PxFixedJoint. Like PxJoint is an abstract class, I can convert to PxFixedJoint when I want.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.