Real unitScale = 5;
sceneNode->setScale(Vector3::UNIT_SCALE * unitScale);
It would be nice if there was an overridden method to make this simpler, even if only to save typing

setScale(Real unitScale);
Sorry, I'm not sure what you mean by explicit constructor? Do you mean changing the Vector3 class so that numbers are automatically converted to Vector3? In other words, this:so0os wrote:I'd say it should be forced to vectors automatically (explicit constructor?)
Code: Select all
Vector3 v = 5;
Code: Select all
Vector3 v(5,5,5);
Code: Select all
Vector3 scale = 5; // makes sense
Vector3 position = 5; // doesn't make sense
Vector3 normal = 5; // doesn't make sense
Vector3 direction = 5; // doesn't make sense
Apparently, this works.zarfius wrote:Code: Select all
Vector3 v = 5;
Fair enough, I stand corrected. I mostly use C# with Mogre these days so I didn't have time to test it.so0os wrote:Apparently, this works.zarfius wrote:Code: Select all
Vector3 v = 5;
Code: Select all
public static void SetScale(this SceneNode sceneNode, float unitScale)
{
sceneNode.SetScale(Vector3.UNIT_SCALE * unitScale);
}
Code: Select all
sceneNode.SetScale(5.0f);