Add invisible plane

Hi I’m quite new to jme and I’m trying to figure out how I can add an invisible plane where through no objects can pass. I found the PlaneCollisionShape though this is not something that can be added to the scene directly …

Does anyone have any advice how to do this ?

A simple solution would be to add a RigidBodyControl with mass=0 and PlaneCollisionShape to the rootNode. That would give you an invisble plane at the origin.

If you want the plane elsewhere, you could create a new childless Node, translate the node, add the control to the Node, and attach the node to rootNode.

What I currently do is:

[java]Plane plane = new Plane(Vector3f.UNIT_X, 0);
plane.setPlanePoints(new Vector3f(-1,0,0), new Vector3f(-1,1,0), new Vector3f(-1,0,1));
PlaneCollisionShape plane2 = new PlaneCollisionShape(plane);
RigidBodyControl planePhysics2 = new RigidBodyControl(plane2, 0);
bulletAppState.getPhysicsSpace().add(planePhysics2);[/java]

Though when i try to put the plane at plane.setPlanePoints(new Vector3f(2,0,0), new Vector3f(2,1,0), new Vector3f(2,0,1)); … it catapults my objects away.

So gonna try your suggestion