As the title says, I want to load a collection from a repX file and scale it by a certain multiplier.
I can manually loop through the collections shapes, scaling their geometry values manually eg :
case PxGeometryType::eSPHERE:
{
PxSphereGeometry geom;
shape->getSphereGeometry(geom);
geom.radius *= scale.x;
shape->setGeometry(geom);
But there’s a problem when I get to mesh shapes as I can’t find a way to manually modify them. In the old PhysX 2 we use to do it like this, but now we can’t as getVertices is const:
PxConvexMesh* mesh = object.is<PxConvexMesh>();
for (unsigned int i = 0; i < mesh->getNbVertices(); i++)
{
const PxVec3& v = mesh->getVertices()[i];
v.x *= scale.x;
v.y *= scale.z;
v.z *= scale.y;
}