Eric, Essentially it's a performance trick. There have been several excellent replies explaining this but I think using the term "copy" is misleading. By passing in the object you pass in a pointer which is easily updated. If it returns a new pointer then it's created an new "object" and this leads to garbage generation / collection issues.
In 3D this can be critical as a single call that creates an extra 4 bytes might run thousands or millions of times per second and can result in a HUGE amount of garbage collection. - John Wright Starfire Research Ian M Nieves wrote: > > Rob, > > It is a "copy" in some sense. It is not the actual data.. rather, a copy > placed in the container that you hand to the method. I see where the > confusion enters though. > > It os obviously not a copy in the sense that a new object was allocated > expressly to transmit the data. > > Make sense? > > Ian > > On Wed, 19 Feb 2003, Rob Nugent wrote: > > > Eric, > > > > I presume it's because it's documented as returning a *copy* of the Transform3D. > > > > If it created a copy and returned that, it'd lead to lots of unwanted garbage if > > called repeatedly. > > > > Rob > > > > Sandegren, Eric S. wrote: > > > This may seem like a silly question but - why does the getTransform method > > > of TransformGroup take a parameter and set it's reference, rather than > > > returning a reference to the Transform3D? All the other "get" methods I've > > > ever seen return the object rather than having you pass it in and then the > > > method fill it. > > > > > > ?? > > > > > > Regards, > > > > > > Eric Sandegren > > > > > > =========================================================================== > > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > > > of the message "signoff JAVA3D-INTEREST". For general help, send email to > > > [EMAIL PROTECTED] and include in the body of the message "help". > > > > -- > > > > > > Rob Nugent > > Sun Microsystems, Southampton, UK > > > > [EMAIL PROTECTED] > > > > Tel: +44 (0) 1489 585503 > > Fax: +44 (0) 1489 881363 > > > > =========================================================================== > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > > of the message "signoff JAVA3D-INTEREST". For general help, send email to > > [EMAIL PROTECTED] and include in the body of the message "help". > > > > > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA3D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".