Forum

VVVV.Utils.VMath.Vector3D type

devvvv

#1

hey! how do i set a single component of a vvvv Vector in a plugin? if i tried the foo3D.x = bar compiler said

"Cannot modify the return value of
'VVVV.PluginInterfaces.V2.ISpread<VVVV.Utils.VMath.Vector3D>.this[int](int)'
because it is not a variable"

#2

Vector3D is a value type, assignment (=) of value types will make a copy, calling functions taking or returning value types will make a copy too.

you need to assign spread(i) to a local variable (copy), change it’s component and assign the local variable back to spread(i) (copy).


#3

thanks Elias :)