Author Message

amilmand

00
Posts: 191

Location: ---
Occupation:
Age:
V$:
#144362   2018-07-09 22:47          
Sort of, the key is to make a duplicate of the mesh as to not scale all the instances of the same mesh. If you would just do:
int meshID = getMesh();
temp_meshRes = new ResourceRef(meshID);
temp_meshRes.scaleMesh(2.0,2.0,2.0);
then if you had the same part two times in an inventory (or anywhere in the game) both would become twice as big.
So the correct would be:
int meshID = getMesh();
temp_meshRes = new ResourceRef(meshID);
temp_meshRes.duplicate(temp_meshRes);
setMesh(temp_meshRes.id());
temp_meshRes.scaleMesh(2.0,2.0,2.0);
Another quirk is that this is additive so this:
temp_meshRes.scaleMesh(2.0,2.0,2.0);
temp_meshRes.scaleMesh(2.0,2.0,2.0);
will make the mesh 4 times bigger.