jme3 camera questions

Guys, i have two questions about jme3 camera:

  1. How to turn off WASD controls from simple application? I read about it in tutorial, tryed some stuff with app settings, but failed…
  2. I’m trying to implement some kind of logical culling system - i have regular quads with known dimensions - if quad isn’t in cam viewing fructrum - i disconnect the node of this quad - how i can do it with jme3 entities? i saw some floats in camera get# methods but do not found frustrum of fructrum planes - any suggestions or code or link will be very cool…

    thanks in advance…:wink:
  1. Did you see this?
  2. Culling is already implemented and used automatically to cull objects outside the cam frustum, you can manually control it via setCullHint()
  1. no - thanks a lot…)
  2. if i understand correctly - it culls every node/object. if node detached at all - it wouldn’t even ask it. I have pretty much objects AND i can devide all my static geometry on regular quads. so i can logically deside - if the whole quad is in cam frustrum - and detach - no inner objects asked… It is more higer level of culling logic… So - my task is to find a way to construct cam fructrum from cam data and quad and check for intersection - i’m pretty sure that there are classes in jme alredy implemented this logic…

so,

1 level - i have regular quads (for e.g. 100 X 100 units) and cull it manually

2 level - from nodes left rendering engine deside if node in frustrum ind cull it automatically

Correct me please if i’m wrong…

I dont quite understand what you say but yes, the engine only culls based on the cam frustum, you have to implement other types of culling yourself by setting the cullstate based on the situation in your game.

madeinsoviets said:
So - my task is to find a way to construct cam fructrum from cam data and quad and check for intersection

Like Normen said this IS frustum culling already implemented in the engine and automatically used... If you implement a higher level of culling based on node detachment/attachment it'll just slow down the whole process and make the built in culling useless....

Imagine, for example two rooms. Both rooms have root nodes. There are many another nodes, connected to root nodes in every room. What is faster 1) check - nodes in each rooms and cull automatically or 2) disconnect root node of whole room if you know that player is in another?



p.s. what is the fastest way of drawing static geometry in jme3? For example quads like in minecraft - no animation, no moving, no changes in lightning - only quads? Maybe i need to implement something myself?

Problem solved - thanks for support…))

Best way of drawing just quads would be to batch them, so that all the quads are in one mesh. This is how the particle system works and it will yield the best performance.

Once you finish constructing your scene made out of quads, you can automatically batch it by using the just-added class GeomtryBatchFactory, by using the optimize method. This is of course assuming the scene is static.

Momoko_Fan said:
Best way of drawing just quads would be to batch them, so that all the quads are in one mesh. This is how the particle system works and it will yield the best performance.
Once you finish constructing your scene made out of quads, you can automatically batch it by using the just-added class GeomtryBatchFactory, by using the optimize method. This is of course assuming the scene is static.

Really good idea - thanks man, i would try this really soon... I'm almost begin to make level as manual mesh - if i will still have lack of performance - i'l do that way..

By the way - does GeomtryBatchFactory remove inside geometry?

madeinsoviets said:
By the way - does GeomtryBatchFactory remove inside geometry?

It doesn't remove anything, you give it a bunch of triangles and it gives you a bunch of triangles, its just stored in less meshes than before (usually)
Momoko_Fan said:
It doesn't remove anything, you give it a bunch of triangles and it gives you a bunch of triangles, its just stored in less meshes than before (usually)

Understood - thanks..;)

Guys, having a problem, using GeometryBatch or GeometryBatchFactory - no such classes - i’m using jme3 and nightly builds - can you write the whole path to class?

God, help me…:wink:

http://madeinsoviets.net/index.php?option=com_content&view=article&id=7&Itemid=5