ofNode efficient set position, scale and orientation

#1

What is the most efficient way to set all three? If I call setPosition(), setScale() and then setOrientation(), it works as expected, but the createMatrix function is called for each of those functions. Any advice on how to reduce calls to the createMatrix function? Something like
set( vec3 pos, vec3 scale, quat orientation) would be helpful.

Thanks!
Nick

#2

Hi,
I think you’lll need to modify the ofNode class in order to do such as it will not work just by extending it.
Maybe just create a function as the one you’re saying, and the update the matrices.

void ofNode::setOrientation(const glm::vec3& position, const glm::vec3& scale, const glm::quat& orientation) {
	this->position = position;
	this->orientation = orientation;
	this->scale = scale;
	createMatrix();
	onScaleChanged();
	onPositionChanged();
	onOrientationChanged();
}
#3

Ok thanks.
Was hoping not to modify the core, but doesn’t look like there is another way at the moment.