Crashing waves

I wish to create an effect of waves crashing against the walls of the playing field of the main game to add a more dynamic effect. I currectly am using the simple water processor to make the waves (makes a nice lake but not what i want) i cant find a way to make the waves crash against the wall to create this effect, and adding it to the physics state makes the fps divebomb (2fps)

current code: [java]SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor(assetManager);
waterProcessor.setReflectionScene(scene);

// we set the water plane
Vector3f waterLocation=new Vector3f(0,-17,0);
waterProcessor.setPlane(new Plane(Vector3f.UNIT_Y, waterLocation.dot(Vector3f.UNIT_Y)));
viewPort.addProcessor(waterProcessor);

// we set wave properties
waterProcessor.setWaterDepth(4); // transparency of water
waterProcessor.setDistortionScale(.05f); // strength of waves
waterProcessor.setWaveSpeed(0.05f); // speed of waves

// we define the wave size by setting the size of the texture coordinates
Quad quad = new Quad(400,400);
quad.scaleTextureCoordinates(new Vector2f(6f,6f));

// we create the water geometry from the quad
Geometry water=new Geometry(“water”, quad);
water.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
water.setLocalTranslation(-200, -17, 250);
water_phy = new RigidBodyControl(2f);
/** Add physical brick to physics space. */
water.addControl(water_phy);

bulletAppState.getPhysicsSpace().add(water_phy);

water.setShadowMode(ShadowMode.Receive);
water.setMaterial(waterProcessor.getMaterial());
rootNode.attachChild(water);
//[/java]
is this even possible?

@stevemk14ebr I don’t think you want to literally add your water to the physics space. It might be a better idea to have it as a particle effect, really. Check out the particle effect tutorials and examples, and play around with them in the SceneComposer until you’ve got a fairly decent idea of what you’re doing, then try to create the effect with particles. There are very few physics engines capable of simulating real-time fluid dynamics, and jBullet isn’t one of them unfortunately.

1 Like

thanks ill check it out