<div dir="ltr"><a href="https://holub.com/patterns/book.pdf">https://holub.com/patterns/book.pdf</a> Starting on page 24, see why we did the wrong thing with setters/getters in X3DJSAIL!<div><br></div><div>John <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 3, 2020 at 11:50 AM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto">Holub recommends Import/Export pattern to deal with this.</div></div><div dir="auto"><br></div><div dir="auto"><div><a href="https://www.google.com/search?rlz=1CDGOYI_enUS806US806&hl=en-US&sxsrf=ALeKk03lZvDvnXRfQAz68xpLTmhxWv5CTA%3A1583257662688&ei=PpheXs7CKdH3-gSqv4awBg&q=design+patterns+by+looking+at+code&oq=design+patterns+by+looking+at+code&gs_l=mobile-gws-wiz-serp.12...0.0..6387...0.0..0.0.0.......0.2_4M6EKNmzE" target="_blank">https://www.google.com/search?rlz=1CDGOYI_enUS806US806&hl=en-US&sxsrf=ALeKk03lZvDvnXRfQAz68xpLTmhxWv5CTA%3A1583257662688&ei=PpheXs7CKdH3-gSqv4awBg&q=design+patterns+by+looking+at+code&oq=design+patterns+by+looking+at+code&gs_l=mobile-gws-wiz-serp.12...0.0..6387...0.0..0.0.0.......0.2_4M6EKNmzE</a></div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 3, 2020 at 11:24 AM Don Brutzman <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[Dick and I are on a teleconference]<br>
<br>
The way that you have written this, it looks to us like each object is independent.<br>
<br>
Thus if you create a 'rot' SFRotation object, its values are passed by value only change if they are directly modified.<br>
<br>
This seems to be a straightforward case of object encapsulation. For those interested in learning more, general information:<br>
<br>
* Encapsulation (computer programming)<br>
<a href="https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)</a><br>
<br>
<br>
On 3/3/2020 7:06 AM, Andreas Plesch wrote:<br>
> 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>
all the best, Don<br>
-- <br>
Don Brutzman Naval Postgraduate School, Code USW/Br <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149<br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzman</a><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>
</blockquote></div>