public void collision(PhysicsCollisionEvent event) { if (event.getObjectA() instanceof BombControl) { final Spatial node = event.getNodeA(); effect.killAllParticles(); effect.setLocalTranslation(node.getLocalTranslation()); effect.emitAllParticles(); } else if (event.getObjectB() instanceof BombControl) { final Spatial node = event.getNodeB(); effect.killAllParticles(); effect.setLocalTranslation(node.getLocalTranslation()); effect.emitAllParticles(); } }
public PhysicsCollisionEvent getEvent(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, ManifoldPoint cp) { PhysicsCollisionEvent event = eventBuffer.poll(); if (event == null) { event = new PhysicsCollisionEvent(type, source, nodeB, cp); }else{ event.refactor(type, source, nodeB, cp); } return event; }
/** * Recycle the specified event. * * @param event */ public void recycle(PhysicsCollisionEvent event) { event.clean(); eventBuffer.add(event); } }
public void collision(PhysicsCollisionEvent event) { if (space == null) { return; } if (event.getObjectA() == this || event.getObjectB() == this) { space.add(ghostObject); ghostObject.setPhysicsLocation(getPhysicsLocation(vector)); space.addTickListener(this); if (effect != null && spatial.getParent() != null) { curTime = 0; effect.setLocalTranslation(spatial.getLocalTranslation()); spatial.getParent().attachChild(effect); effect.emitAllParticles(); } space.remove(this); spatial.removeFromParent(); } }
private native float getAppliedImpulse(long manifoldPointObjectId);
private native float getAppliedImpulseLateral1(long manifoldPointObjectId);
private native float getAppliedImpulseLateral2(long manifoldPointObjectId);
public void collision(PhysicsCollisionEvent event) { if (space == null) { return; } if (event.getObjectA() == this || event.getObjectB() == this) { space.add(ghostObject); ghostObject.setPhysicsLocation(getPhysicsLocation(vector)); space.addTickListener(this); if (effect != null && spatial.getParent() != null) { curTime = 0; effect.setLocalTranslation(spatial.getLocalTranslation()); spatial.getParent().attachChild(effect); effect.emitAllParticles(); } space.remove(this); spatial.removeFromParent(); } }
private native float getAppliedImpulse(long manifoldPointObjectId);
private native float getAppliedImpulseLateral1(long manifoldPointObjectId);
private native float getAppliedImpulseLateral2(long manifoldPointObjectId);
PhysicsCollisionObject objA = event.getObjectA(); PhysicsCollisionObject objB = event.getObjectB(); if (event.getNodeA() == null && event.getNodeB() == null) { return; if (event.getAppliedImpulse() < eventDispatchImpulseThreshold) { return;
/** * Obtain an unused event. * * @return an event (not null) */ public PhysicsCollisionEvent getEvent(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, long manifoldPointObjectId) { PhysicsCollisionEvent event = eventBuffer.poll(); if (event == null) { event = new PhysicsCollisionEvent(type, source, nodeB, manifoldPointObjectId); }else{ event.refactor(type, source, nodeB, manifoldPointObjectId); } return event; }
public void recycle(PhysicsCollisionEvent event) { event.clean(); eventBuffer.add(event); } }
private native float getAppliedImpulse(long manifoldPointObjectId);
private native float getAppliedImpulseLateral1(long manifoldPointObjectId);
private native float getAppliedImpulseLateral2(long manifoldPointObjectId);
PhysicsCollisionObject objA = event.getObjectA(); PhysicsCollisionObject objB = event.getObjectB(); if (event.getNodeA() == null && event.getNodeB() == null) { return; if (event.getAppliedImpulse() < eventDispatchImpulseThreshold) { return;
public PhysicsCollisionEvent getEvent(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, long manifoldPointObjectId) { PhysicsCollisionEvent event = eventBuffer.poll(); if (event == null) { event = new PhysicsCollisionEvent(type, source, nodeB, manifoldPointObjectId); }else{ event.refactor(type, source, nodeB, manifoldPointObjectId); } return event; }