title: Constant object cannot be passed as var parameter
body: <p>This is the trouble code..</p>
  
  <pre><code>multresult := mult(mult(temp, quatview), conjugate(temp));
  </code></pre>
  
  <p>Full procedure</p>
  
  <pre><code>procedure TForm2.RotateCamera(var angle: Single; x: Single; y: Single; z: Single);
  var
      temp, QuatView, multResult : TQuaternion;
  begin
      temp.x := x * sin(Angle/2);
      temp.y := y * sin(Angle/2);
      temp.z := z * sin(Angle/2);
      temp.w := cos(Angle/2);
  
      quatview.x := camera1.Position.x;
      quatview.y := camera1.Position.y;
      quatview.z := camera1.Position.z;
      quatview.w := 0;
  
      multresult := mult(mult(temp, quatview), conjugate(temp));
  
      camera1.Position.x := multresult.x;
      camera1.Position.y := multresult.y;
      camera1.Position.z := multresult.z;
  end;
  </code></pre>
  
  <p>mult function</p>
  
  <pre><code>function TForm2.mult(var A: TQuaternion; B: TQuaternion) :TQuaternion;
   var
     c : TQuaternion;
  begin
    C.x := A.w*B.x + A.x*B.w + A.y*B.z - A.z*B.y;
    C.y := A.w*B.y - A.x*B.z + A.y*B.w + A.z*B.x;
    C.z := A.w*B.z + A.x*B.y - A.y*B.x + A.z*B.w;
    C.w := A.w*B.w - A.x*B.x - A.y*B.y - A.z*B.z;
  result := C;
  End;
  </code></pre>
  
  <p>and conjugate</p>
  
  <pre><code> function TForm2.conjugate( var quat:TQuaternion) :TQuaternion;
    begin
       quat.x := -quat.x;
       quat.y := -quat.y;
       quat.z := -quat.z;
       result := quat;
    end;
  </code></pre>
  
  <p>and if needed TQuaternion</p>
  
  <pre><code>type
    TQuaternion = class
      x: single;
      y: single;
      z: single;
      w: single;
    end;
  </code></pre>
  
  <p>any idea why i get this error and how to fix it?</p>