Windows Diary
  • jME3: Each player’s node collision cannot be detected with PhysicsCollisionListener

    My goal is to detect a collision between the player and the box so that I can grab the idea with a key trigger. I didn’t find recognition either. Here is the most important code.

      @OverrideOpen empty collision (PhysicsCollisionEvent arg0)   PhysicsCollisionEvent = arg0;    if (event.getNodeA (). getName (). equals (player.node.getName ()) 

    Here is the part tolassa.

      The public class Item implements PhysicsCollisionListener {Private player final player;private node rootNode;BulletAppState private bulletAppState;private geometry of geometry;private RigidBodyControl HardBody;public object (player player)    this.player = player;public init (Node overrides rootNode, AssetManager AssetManager, BulletAppState, bulletAppState)    this.rootNode RootNode; = this.bulletAppState = bulletAppState;    Box box = new box (1f, 1f, 1f);    Geometry = new geometry ("Subject", Box);    Geometry.setLocalTranslation (10, 10, 10);    Material mat = super new "Common / MatDefs / Misc / Unshaded material (assetmanager, .j3md");    mat.setColor ("Color", ColorRGBA.Red);    Geometry.setMaterial (mat);    this.rootNode.attachChild (geometry);   RigidBody = new types RigidBodyControl (0.1f);    geometry.ad

     

     

    Speed up your computer's performance now with this simple download.