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: intickyes

19. May 2013, 11:35:14 am
Xith3D CommunityGeneral CategoryNews (Moderators: Marvin Fröhlich, 'n ddrylliog)API changes - update hints
Pages: 1 ... 3 4 [5] 6 7
Print
Author Topic: API changes - update hints  (Read 32200 times)
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #60 on: 07. October 2007, 04:21:17 pm »

I have created a ModelAnimation class, which abstracts a Model's animations. All animation related methods use this class instead of Strings now.

Additionally you can add an AnimationListener to a model, that tells you about animation starts and stops.

And don't call interpolateAnimation() directly anymore. Instead add the model to the Animator (it now implements Animatable).

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #61 on: 07. October 2007, 11:35:21 pm »

I have cleaned up the multi-texturing API. There is no difference anymore between single-texture and multi-texture Appearance. The setTexture( Texture ) method is simply a shortcut for setTexture( int, Texture ), where the int is the texture unit index. The same for TextureAttributes and TexCoordGeneration.

The TextureUnitState class has been renamed to TextureUnit, which is a lot more intuitive.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #62 on: 11. October 2007, 07:03:01 pm »

I have cleaned up Xith's ShaderProgram API. Now there are no vertex program or fragment program fields in Appearance or GLSLShaderProgram. There's simply a ShaderProgram field.

So, if you want to use a GLSLShaderProgram, there's not much, that changed. It's only the setShaderProgram() except for setGLSLShaderProgram().

If you want to use assembly shaders, there changed a lot. Except for app.setVertexProgram() and app.setFragmentProgram() it's now simply setShaderProgram(). There is a new AssemblyShaderProgram class, that you use at this place. And you add a AssemblyVertexShader and AssemblyFragmentShader instance to the AssemblyShaderProgram, just like you would do for a GLSLShaderProgram.

This way, there's no chance to mix the two shader languages, which would have lead to a GL error. And the API design is more general and open to other shader languages, that might be implemented in the future.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #63 on: 14. October 2007, 01:23:03 am »

I have removed Link/SharedGroup from the Xith3D API, which indeed boosted performance by a few percent. Please use sharedCopy() instead from now on (or sharedInstance() in case of models).

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #64 on: 14. October 2007, 02:41:35 pm »

I have cleaned up xith's world-bounds system and world-transform system.

The getLocalToVWorld() method is now called getWorldTransform(). There is a new method getLocalTransform(), which is simply an alias for getTransform() (for clarity).

The getVWorldBounds() method is now called getWorldBounds() and doesn't return a BoundingSphere, but a Bounds instance. This is a result of the fact, that the world-bounds are not fixed to BoundingSphere, but can also be an AABB depending on the local-bounds type.
You can check the type through bounds.getType() method, so that you don't need to make use of the expensive instanceof operator. Don't simply cast to BoundingSphere, since your application might crash, if it is not a BoundingSphere.

The Bounds interface has four new methods:
getType()
getCenter()
getMaxSquaredDistance()
getMaxDistance()

They should help you to avoid some type checks and casts. For a BoundingSphere the getMaxDistance() and getMaxSquaredDistance() methods simply return the (squared) radius of the sphere. For an AABB it is the (squared) distance of the lower or upper extend to the center.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #65 on: 14. October 2007, 03:07:05 pm »

I have removed the NodeGroup interface from the API, since it was abolutely useless and potentially slowed down the system.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #66 on: 14. October 2007, 09:43:22 pm »

I have simplified CollisionMatch. You now simply add a CollisionMatch instance to PhysicsEngine and everything is done automatically.

PhysicsEngine holds a default SurfaceParameters instance (which you can modify/replace).

If you wan't more control over the CollisionMatch handling, you can still add a CollisionMatchListener to the PhysicsEngine, which is called when a collision is to be resolved. The event method returns a boolean, that tells the PhysicsEngine, if the event has been consumed, which makes the PhysicsEngine not handle the event anymore. If you have more than one listener added, the second one will get the result of the preceding consumed boolean as a parameter, so you have full control.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #67 on: 06. November 2007, 02:40:30 am »

I have modularized the FirstPersonInputHandler to make some of its components reusable. Therefore the API hans changed in some points, since some methods are not directly accessible through the FPIH's interface, but through a getter for the module. Please see the testcases for examples.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #68 on: 06. November 2007, 11:14:58 pm »

I have fixed the XPAL-geom-swap-bug. Now the order of the two Collideables of a Collision is always the same as you chose for the checkCollisions() method. You should be aware of that, or you might register no collisions just because you're checking the wrong Collideable. And make sure, you use a (non-)inverted collision normal at the right place.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #69 on: 15. November 2007, 01:42:02 am »

I have renamed MouseObjectRotationInputHandler to ObjectRotationInputHandler, since it is now also keyboard responsive.

I have further renamed mouse-suspended to mouse-movement-suspended to have names for mouse-buttons-suspended and mouse-wheel-suspended.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #70 on: 19. November 2007, 10:56:11 pm »

I have simplified the GLSLShaderProgram uniform var API. In 99% you will want to set one value (one int, float or object) to a specific uniform variable. And in most cases you had to create an array to be able to set the var. This is now simplified by overloading the setUniformVar() methods: One, that takes an array and one that takes a single value.

So this is nothing that will force you to update your code (in the same 99% Wink), but you're free to change a line like this:
Code:
shaderProg.setUniformVar( "myVar", new int[] { 1234 } );
to something like this:
Code:
shaderProg.setUniformVar( "myVar", 1234 );

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #71 on: 20. November 2007, 09:17:10 pm »

I have changed the XPAL API a bit to make it compatible with Odejava.

The newBody() method has been moved from SimulationEngine to SimulationWorld.

Additionally the SurfaceParameters class cannot be instantiated through the constructor anymore, but through a factory method of SimulationEngine. This enables us to let the implementation set default values and fill an array of available parameters, which you can query through the getAvailableParameters() method. the addParameter() and removeParameter() methods have been renamed to setParameter() and resetParameter(). And there's an additional convenience method called getFloatParameter(), that... well you know what Wink.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #72 on: 03. December 2007, 03:39:57 pm »

I have replaced the CollisionMatch class with the new CollisionResolver class. It doesn't have all these kinds of lists anymore. You simply create a CollideableGroup, but Collideables in it and pass it to the CollisionResolver constructor.

You can still pass bodies to it, but you shouldn't do this when you have a Collideable/CollideableGroup to use instead.

By using CollideableGroups you enable the underlying physics engine to use these groups to improve performance. Groups (or spaces like they are called in JOODE/ODE) are, what the engine uses to gain performance boosts from.

And you should follow this rule:
Don't:
Code:
Collideable avatar = ...;
Collideable[] colls = ...;

physEngine.addCollisionResolver( new CollisionResolver( avatar, colls[ 0 ] ) );
physEngine.addCollisionResolver( new CollisionResolver( avatar, colls[ 1 ] ) );
physEngine.addCollisionResolver( new CollisionResolver( avatar, colls[ 2 ] ) );
...
But do:
Code:
Collideable avatar = ...;
CollideableGroup group = collEngine.newGroup();

group.addCollideable( colls[ 0 ] ) );
group.addCollideable( colls[ 1 ] ) );
group.addCollideable( colls[ 2 ] ) );
...

physEngine.addCollisionResolver( new CollisionResolver( avatar, group ) );

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #73 on: 11. December 2007, 08:31:10 pm »

The checkCollisions() methods of CollisionEngine all have an additional boolean parameter now, which tells the engine whether to ignore static collisions or not. This is very important for performance reasons. So I had to slightly change the API here. If you don't know, what to do here, you can simply take "false" for the new argument. "true" will tell the engine to ignore static collisions, which are collisions between Collideables without a Body.

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

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #74 on: 12. December 2007, 08:50:55 pm »

I have cleaned up the HUD packages a bit. All the theme related classes (only three so far) have been moved into an own package "org.xith3d.ui.hud.theming".

Marvin
Logged
Pages: 1 ... 3 4 [5] 6 7
Print
Jump to:  

Theme orange-lt created by panic