Whats better way to create a collision with scenario?

Hi!!!



I have a simple question:



Whats better way to create a collision with scenario?



I create a method to the collision with the scenarios in my game…But I note that when I call this method, the fps down tragically, something like of 60 to 40 fps. I use the FixedFramerateGame and I set the frameRate to 60, and when I calculate the collision, the game it is slow…



I know that occour because by the calculation of the triangles…But have another way? Something like create a single objetc (Box, for insyance) and call setCullMode() to make the box desapear and create a collision with scenario with this box?



For single objects, like enimes I use the bounding to detect collision…



Sorry for my spelling… :roll:



protected void hasCollisionScenario(){
   scenarioResult.clear();
   player.findCollisions(scenarioCollision, scenarioResult);      
   if (scenarioResult.getNumber() > 0) {
      pos = player.getLocalTranslation();
      data = scenarioResult.getCollisionData(0);         
      for (int i = 0; i < scenarioResult.getCollisionData(0).getSourceTris().size(); i++) {
         if (data.getTargetMesh().hasCollision(data.getSourceMesh(), true)){
            backward();
            System.out.println("< System Collision Data detected >");





Thx a lot!!!