How to store the PxFixedJoint class in a vector

0

I'm trying to store the PxFixedJoint class in a std::vector with the push_back method. But the vector is always empty, it just does not add anything.

Down 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;
    
asked by anonymous 02.08.2014 / 19:57

1 answer

0

Resolved

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

    
03.09.2014 / 04:18