J3o Scene With Inconsistent Physics

I’ve been having an issue with the scene I’m working on in the terrain editor and scene composer. I started sculpting and adding models into my scene, and essentially what I have right now is a tall mountain and a wall sticking out of the mountain (I’ll post a screenshot when I have the chance, although its a mostly basic setup). I was noticing for a while that in certain places near that mountain, the enemy’s spells seem to pass through the mountain, and since I’ve just recently coded the AI path seeking I’m noticing that when I’m behind the mountain, the enemies react as if I’m in their line of sight. It always happens at the same places, and It’s near impossible to recreate this issue with the wall I imported from blender aside from just one specific location.

So it seems like I’m having trouble with the terrain not being detected by rays, bounding volumes, or rigid body controls. Weirdly though have absolutely no problem with the better character control detecting terrain. I’ve tried various ways of colliding these objects to test intersection and the rays and rigid body controls always seem to fly right through the same exact points in my map. I’ve tried adding the rigid body control to my entire scene’s node as well as adding the physic controls through the scene composer, all with the same results. The high points of the mountain seem to all have absolutely no responsiveness. I can walk all over them perfectly, but there aren’t any locations near the mountain peaks that will register any type of collision aside from better character control.

I was going to just start my scene from scratch again and be more careful with my terrain sculpting and scene composing, but if there’s any solution or reason I mya have caused my scene to be so glitchy, I’d like to make sure I don’t do so again especially once I have a fully composed scene :stuck_out_tongue:

My best guess so far is that I may have just gltiched my scene from messing with it so frequently and need to restart if tha’s a possibility? I’ve removed and re-added the physics controls through both the scene composer and code a whole lot looking for a solution, and I know sometimes I’ve managed to completely corrupt and have to scrap a j3o scene from improperly adding controls in the scene composer.

First of all, are you visually debugging the physics? (bulletAppState.setDebugEnabled(true);), and they look right?. Which kind of collision shape are you giving to the terrain?

Yeah the visual debug shows that all the terrain and objects have physics even in the places im having issues. And I’m using the rigid body control for the terrain, I’ve also tried adding the physics control in the scene composer and used the .getPhyicsSpace().addAll(landScape) method with the same results. I’m just using a default shape for the rigidbodycontrol as well, I tried using the CollisionShapeFactory to generate a terrain shaped control a while ago and couldn’t get that to work

Maybe your spell is too fast so it makes a too big step in that special place? Or the spell’s spawning origin and is behind the collision shape. Just guess around.

1 Like

Thanks that helped me solve the problem :smile:. It looks like I also needed to scale down some of the vector direction with the rays I was using. With some spells that need to go fast I was using a ray with the same direction and origin as the spell’s Node to find the spot where the spell should eventually collide, but I didn’t think that the ray direction was distance sensitive, but I must’ve been wrong. I appreciate the help.

1 Like