Commit 713a8e8c authored by Michele Bosi's avatar Michele Bosi

Direct access Transform localMatrix() NOT worldMatrix().

parent f2277b5d
......@@ -147,6 +147,14 @@ namespace vl
return mLocalMatrix;
}
/** The matrix representing the transform's local space.
Use this non-const version to directly modify the local matrix.
Call computeWorldMatrix() after modifying the local matrix. */
mat4& localMatrix()
{
return mLocalMatrix;
}
/** Normally you should not use directly this function, call it only if you are sure you cannot do otherwise.
* Usually you want to call computeWorldMatrix() or computeWorldMatrixRecursive().
* Calling this function will also increment the worldMatrixUpdateTick(). */
......@@ -162,12 +170,6 @@ namespace vl
return mWorldMatrix;
}
/** Returns the world matrix used for rendering. Use this only if you keep the matrices up to date on your own. */
mat4& worldMatrix()
{
return mWorldMatrix;
}
/** Sets both the local and the world matrices.
* This function is useful to quickly set those Transforms that do not have a parent, for which
* is equivalent to: \p setLocalMatrix(matrix); \p computeWorldMatrix(NULL); */
......@@ -202,8 +204,10 @@ namespace vl
{
setWorldMatrix( parent()->worldMatrix() * localMatrix() );
}
else
else
{
setWorldMatrix( localMatrix() );
}
}
/** Computes the world matrix by concatenating the parent's world matrix with its local matrix, recursively descending to the children. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment