Scaling ModelInstance in the 3D engine and Bullet in libgdx format

Every time I try to add a modified ModelInstance of a model (made in 3ds max) to the Bullet world, I keep getting the same model without changing the scale. This is my current code:

Objeto objmat = mapaactu.nameAndPutObjetos(obj.getMaterias().get(0).nombreasoci,(int)obj.getMaterias().get(0).cantidad);
world.addConstructor(objmat.nombreinterno, objmat.constructor);

Vector3 objmatpos = new Vector3(obj.entidadbody.getWorldTransform().getTranslation(Vector3.Zero));
Vector3 scala = new Vector3(obj.getMaterias().get(0).cantidad / 100f, obj.getMaterias().get(0).cantidad / 100f, obj.getMaterias().get(0).cantidad / 100f);
Quaternion rotacion = new Quaternion();
objmat.instancia.transform.getRotation(rotacion);

objmat.instancia.transform.set(objmatpos, rotacion, scala);

objmat.setEntidad(world.add(objmat.nombreinterno, objmat.instancia.transform));

However, the transform position component that I get is always correct (it appears where "obj" is)! I debugged it and "scala" = (0.5f, 0.5f, 0.5f) What should I do to properly scale the model before adding it to the Bullet world?

0
source share

Source: https://habr.com/ru/post/1547380/


All Articles