<div><div dir="auto">I think there’s more going on.   Primitives are passed by value, not by reference.</div></div><div dir="auto"><br></div><div dir="auto">The question becomes, does the axis reference get stored internally, such that rot.axis.y is the value you are talking about, or does it get copied to rot.y?</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 3, 2020 at 9:08 AM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In the ecmascript SAI, SFRotation has a constructor which has the<br>
rotation axis as a SFVec3f argument:<br>
<br>
new SFRotation ( SFVec3f axis, numeric  angle )<br>
<br>
<a href="https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#SFRotation" rel="noreferrer" target="_blank">https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#SFRotation</a><br>
(Table 7.18, -url in the first sentence is off-)<br>
<br>
The question is when I make a new SFRotation and later change the<br>
SFVec3f which was used for the axis, does the previously constructed<br>
SFRotation also change ?<br>
<br>
axis = new SFVec3f ( 0, 0, 1 );<br>
rot = new SFRotation( axis, 3.14 );<br>
axis.y = 1.0<br>
axis.z = 0.0<br>
// rot.y is ?<br>
// constructed by value: rot.y = 0.0<br>
// constructed by reference: rot.y = 1.0<br>
<br>
I did not check the abstract SAI spec. for guidance so it is very<br>
possible I missed something.<br>
<br>
This is just an example. There are of course other constructors which<br>
use objects as parameters. It is also probably rare that a script<br>
would want to do this.<br>
<br>
It may depend on the scripting language. In ecmascript objects are<br>
passed by reference, you have to explicitly make a copy if you need<br>
it. This is for performance. So I would guess for ecmascript it should<br>
be rot.y = 1.0 .<br>
<br>
-Andreas<br>
<br>
<br>
-- <br>
Andreas Plesch<br>
Waltham, MA 02453<br>
<br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>