Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - K24A3

Pages: 1 [2]
16
Support / checkForCollisionEllipsoid() framerate drop
« on: October 08, 2011, 05:34:35 pm »
Basically I'm trying to increase the frame rate as much as possible.

I'm using checkForCollisionEllipsoid to collision check the main character but it's dropping the frame rate down from 60FPS+ to about 30-35 FPS, even when using the lowest recursionDepth of 1.

The checkForCollisionEllipsoid frame rate drops even when there are no COLLISION_CHECK_OTHERS objects nearby (they are visible though), does checkForCollisionEllipsoid do any object/mesh distance filtering before calculating using ellipsoid collision?
Perhaps the function could be modified to do a translation/boundingbox distance check before focusing on the ellipsoid precision.
The function seems to be based on the visibility of objects since the framerate dropped as soon as the objects were visible.

I tried using three checkForCollisionSpherical() checks which helped considerably, the frame rate was around 45-50FPS. However I would like to improve the FPS a bit more if possible


Perhaps a new checkForCollisionDualBox() function can be introduced that does dual-box calculations?
i.e. the function would parse two boxes, one large/main box to cover the main body, and another smaller box to cover the head and feet.
checkForCollisionDualBox(SimpleVector translation, SimpleVector box1size, SimpleVector box2size)

17
Support / Object3D.setBillboarding()
« on: October 07, 2011, 04:09:22 am »
Question 1: How can I scale billboarded objects? setScale() appears to do nothing.

Question 2: How can I disable billboarding lighting? setLighting(LIGHTING_NO_LIGHTS) doesn't ignore nearby lighting.


Code: [Select]
obj = Primitives.getPlane(2, 2);
obj.setTexture("bb");
obj.setTransparency(50);
obj.setLighting(Object3D.LIGHTING_NO_LIGHTS); //?
obj.setBillboarding(true);
obj.setScale(0.02f); //?
world.addObject(obj);


18
Support / Switching between multiple Worlds
« on: September 19, 2011, 04:09:06 pm »
I'm trying to utilize two separate worlds, one world is for the menu, the other is for the game.

My design is this:

-start the app
-load the menu world
-when 'start' is pressed, load another world
-go back to the original world when done

I created a class for the menu world, within that menu world I load another world on the fly, and redirect the main GLSurfaceView.Renderer OnFrame call to the game world.

I've ran into all kinds of problems. It's crashing when loading the game world, it always crashed on world.draw() for some reason. If I remove world.draw, the skymap renders ok but nothing else. If I remove all the object3D creations, draw.world works fine.
I tried using the same World both both the menu and game, but still have problems.
The confusing thing is, if I load the game world first, it works ok.


But anyway, ignore all that... Time to start fresh!

1. My main questions is, how do you handle two separate worlds correctly? Logically?

2. Do you need to dispose the first world then reload the second?  Or can both worlds coexists side by side, redirecting the onFrame method to the current world?

3. Rather calling/loading a world from within a world (in terms of class files), would it be better to create a World Handler that disposes the current world before creating the new world, having each world in it's own class?


Any help is appreciated, thanks.

Pages: 1 [2]