Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

12046 Posts in 1593 Topics- by 597 Members - Latest Member: Cydfewoot

21. May 2013, 03:06:34 pm
Xith3D CommunityGeneral CategoryNews (Moderators: Marvin Fröhlich, 'n ddrylliog)API changes - update hints
Pages: [1] 2 3 ... 7
Print
Author Topic: API changes - update hints  (Read 32216 times)
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« on: 17. January 2007, 07:12:24 am »

In this thread we (Xith3D-devs) will post news about changes in Xith3D, that effect the API. We will provide short examples, tutorials or at least a note about what to do to port your existing code to the new API.

Since this thread is sticky, please only reply to it, if the answer cannot sensefully be done in another thread.

Marvin
« Last Edit: 24. February 2007, 01:55:09 pm by Marvin Fröhlich » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #1 on: 19. January 2007, 03:22:52 am »

If you make use of the org.xith3d.geometry.Sphere class, you will maybe have to so something to get your code work as before.

There was a bug inside to Sphere class. Well it was not a real bug. But the poles of the Sphere were at front and back (at zero rotation). So it was necessary to put the Planet into a TransformGroup to correct this. This meant wasted GPU power.

I fixed the Sphere class to produce a spheric geometry with top and bottom poles and correct texture coordinates.

If you want the Sphere to be font-back-poled, just set the static boolean flag "frontBackSphere" of the Sphere class to true before you create any Sphere.

Marvin
« Last Edit: 19. January 2007, 03:24:37 am by Marvin Fröhlich » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #2 on: 08. February 2007, 07:12:45 pm »

I've created SVN branches for the new 0.9.0 release. No new features will be applied to these branches, but only bugfixes.

Here are the links to the branches:

https://svn.sourceforge.net/svnroot/xith3d/branches/0.9.0
https://svn.sourceforge.net/svnroot/xith-tk/branches/0.9.0

Any further API changes won't effect the 0.9.0 branches.

Marvin

PS: Now it is time for a major API cleanup Smiley. But never fear. I will document everything here and it won't be too hard to port. The API cleanup will include the removal of the most deprecated methods, which I won't further mention. So make sure to replace all deprecated calls the their appropriate replacements.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #3 on: 08. February 2007, 08:06:53 pm »

All deprecated methods are now removed.

Marvin

EDIT Amos Wenger : typo "new"/"now"
« Last Edit: 09. February 2007, 02:42:49 pm by Amos Wenger » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #4 on: 09. February 2007, 03:11:45 am »

The next step in API cleanup is taken.

All of the Canvas3DWrapper's functionality is moved into Canvas3D. The factory methods are moved into a new class called Canvas3DFactory.

All inner classes of the former Canvas3DWrapper are moved into the package org.xith3d.render.config in the core. Some of them are deleted, since they are no longer needed.

org.xith3d.render.config.DisplayMode replaces the functionality of the removed config classes.

There's a new interface called Canvas3DWrapper (yes, I know, it's the same name), which only has a getCanvas() method. It is implemented in Canvas3DPanel and Canvas3DJPanel.

All this meant very many changes in Xith itself, but only means about one or two changed lines in your projects.

Just relpace lines like this
Code:
Canvas3DWrapper canvas = Canvas3DWrapper.createStandalone( ... );
with
Code:
Canvas3D canvas = Canvas3DFactory.createWindowed( ... );

The quite new DisplayMode system allows you to get the supported DisplayModes from the system in an abstract way. So it is used the same way for all OpenGLLayers.

Use it like this:
Code:
DisplayMode[] modes = DisplayModeSelector.getImplementation( OpenGLLayer.LWJGL ).getAvailabelModes();

Or just get the most similar (or even equal) supported mode to to settings you want:
Code:
DisplayMode mode = DisplayModeSelector.getImplementation( OpenGLLayer.LWJGL ).getBestMode( 800, 600 );

Canvas3DFactory accepts a DisplayMode instance as a parameter, as well as CanvasConstructionInfo.

That's all.

Enjoy this new clean part of the API.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #5 on: 09. February 2007, 11:58:37 pm »

The next step:

The EgoInputAdapter is now called FirstPersonInputHandler. And it doesn't implement InputListener anymore. Instead it takes an instance of InputManager as a constructor parameter. This is done to let the handler work with KeyboardDevice.isKeyPressed(int) instead of events. This is better for this kind of input handling.

Everything else has kept backwards compatible in this class.

Do use the new version to this:
Code:
FirstPersonInputHandler fpHandler = new FirstPersonInputHandler( this.getInputManager(), view, canvas, 1.0f, -1.0f, 1.0f );

Where 'this' is the RenderLoop. And of course invoke the updateView() method inside the render loop.

That's all.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #6 on: 10. February 2007, 12:13:38 am »

And the next one:

I moved all the HUD listeners and adapters into the new org.xith3d.ui.hud.listeners package.

Should be clear, how to port.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #7 on: 10. February 2007, 01:19:20 am »

I have deleted the HUDPickListener. If you need to know, if a Widget was clicked, just use the WidgetInputListener.

HUD picking is to be treated as internal stuff and should never be used from outside. The only reason, why the appropriate methods are public is that Java lacks reasonable encapsulation modifiers.

Marvin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #8 on: 10. February 2007, 06:17:50 pm »

setRotation() methods in org.xith3d.scenegraph.Transform (Xith-tk) have been renamed setRotationXYZ() because of a conflict between the Placeable interface (which TransformGroup implements, of which Transform is derived).
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #9 on: 11. February 2007, 02:13:13 am »

I have made the first step of making the the HUD GC cheap.

If you have written your own Widgets and extended the WidgetBase or RectangularWidget, then you cannot use the Tuple2f parameter for the size anymore. Instead you must use the two-float constructors.

Very simple to port, if necessary.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #10 on: 11. February 2007, 05:18:19 am »

The HUD is now as GC friendly as possible. To achive this, I had to modify the signatures of the getLocationHUD2SG() etc. methods. They all take an additional tuple parameter as return buffer.

Most of you will not use these methods. But if you do, you simply have to pass a new Tuple2f instance to these methods, which can be cached in your classes to improve GC friendliness on your side, too.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #11 on: 11. February 2007, 07:05:04 pm »

As hawkwind pointed out, this should be in the API change thread, too:

We integrated the vecmath-kh stuff into the openmail. So even if the API didn't change for this cause, the classpath did.

ClassPath:
-vecmath-kh.jar
+openmali.jar

This is already included in the current 0.9.0-beta2 and was initially reported here.

Marvin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #12 on: 12. February 2007, 02:50:53 pm »

Renamed org.xith3d.utility.general.MemberLink to org.xith3d.utility.general.MemberConnection for consistency with the (not yet committed) Connection API.
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #13 on: 13. February 2007, 09:37:05 pm »

setRotation() methods in org.xith3d.scenegraph.Transform (Xith-tk) have been renamed setRotationXYZ() because of a conflict between the Placeable interface (which TransformGroup implements, of which Transform is derived).

THIS CHANGE HAS BEEN REVERTED due to compatilibity issues. And now the TransformNode doesn'te xtend Placeable anymore. It's not good. Other connection means between objects will be provided.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #14 on: 13. February 2007, 11:33:07 pm »

The FirstPersonInputHandler now supports an interface called InputManager. You don't need to store your FPIH instance class globally anymore and invoke the updateView() mehtod inside the loopIteration method. You simply have to do the following:

Code:
FirstPersonInputHandler fpHandler = new FirstPersonInputHandler( view, canvas, 1.0f, -1.0f, 1.0f );
fpHandler.createDefaultKeyBindings( true ); // optional
this.getInputManager().addInputHandler( fpHandler );

where 'this' is the RenderLoop. And everything will be done automatically.

Note, that the updateView() mehtod has benn renamed to update().

Marvin
Logged
Pages: [1] 2 3 ... 7
Print
Jump to:  

Theme orange-lt created by panic