Original Post
Hi,
a short question about chapter 3, listing 3.1 (and the provided code for week 1 as well). What exactly is the difference between CheckPerformance::TransformVectorByReference and CheckPerformance::TransformVectorByReferenceAndOut? I know the code itself is not terribly important, but it's kinda bugging me.
Here are the snippets:
and
So, what am I missing?
Thanks
a short question about chapter 3, listing 3.1 (and the provided code for week 1 as well). What exactly is the difference between CheckPerformance::TransformVectorByReference and CheckPerformance::TransformVectorByReferenceAndOut? I know the code itself is not terribly important, but it's kinda bugging me.
Here are the snippets:
public void TransformVectorByReference()
{
Matrix rotationMatrix = Matrix.CreateRotationY(
MathHelper.ToRadians(45.0f));
// Create a vector pointing the direction the camera is facing.
Vector3 transformedReference;
Vector3.Transform(ref cameraReference, ref rotationMatrix,
out transformedReference);
// Calculate the position the camera is looking at.
Vector3.Add(ref cameraPosition, ref transformedReference,
out cameraTarget);
}
and
public void TransformVectorByReferenceAndOut()
{
Matrix rotationMatrix = Matrix.CreateRotationY(
MathHelper.ToRadians(45.0f));
// Create a vector pointing the direction the camera is facing.
Vector3 transformedReference;
Vector3.Transform(ref cameraReference, ref rotationMatrix,
out transformedReference);
// Calculate the position the camera is looking at.
Vector3.Add(ref cameraPosition, ref transformedReference,
out cameraTarget);
}
So, what am I missing?
Thanks