[x3d-public] Problem with SFVec3dObject constructor, X3dToJava.xslt/X3DJSAIL
Don Brutzman
brutzman at nps.edu
Sun May 13 21:14:59 PDT 2018
On 5/12/2018 1:56 PM, John Carlson wrote:
> File is attached.
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project X3DJSONLD: Compilation failure
>
> [ERROR] C:\Users\coderextreme\X3DJSONLD\src\main\java\net\x3djsonld\data\geobubbles.java:[84,86] error: no suitable constructor found for SFVec3dObject(float[])
interesting, hadn't thought of that array-based constructor since Java automatically handles use of individual floats when feeding double parameters.
for the moment, easily handled by just providing floats, i.e.
.setPosition(new SFVec3dObject(0.0f,0.0f,4.0f))
vice
.setPosition(new SFVec3dObject(new float[] {0.0f,0.0f,4.0f}))
also FYI
https://stackoverflow.com/questions/2019362/how-to-convert-array-of-floats-to-array-of-doubles-in-java
to do this properly, likely is needed for setValue() method as well. Then both constructor and setValue() for all of the SFVec*d methods.
In turns out that most of the other field objects for Double types had these methods... i was able to adjust the X3DJSAIL code generator to add them to SFVec2d SFVec2d SFVec2d.
Your example program now passes. Smoke test passed, build uploaded.
X3D Java Scene Access Interface Library (X3DJSAIL)
http://www.web3d.org/specifications/java/X3DJSAIL.html
Still have a bunch of other work going on (especially HAnim updates) but will get back to fixing more things, again thanks for bug reports.
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
More information about the x3d-public
mailing list