hey there!
I'd like to know whether the following is possible with C# properties.
I have a class "Transform" that holds a 4x4 matrix in a private member field. Now I want to create a property like this:
Matrix m;
public Vector3 Position
{
get { return new Vector3(m[12], m[13], m[14]); }
set { m[12] = value.X; m[13] = value.Y; m[14] = value.Z; }
}
but i'd like to provide the following functionality:
Transform myTransform = new Transform();
myTransform.Position.X += 3.0f;
such that the Property directly can be changed as if it was a variable. is this somehow possible with C#? (Vector3 and Matrix both are structs.)
thanks!