Examples of PhysicsCollisionObject


Examples of com.jme3.bullet.collision.PhysicsCollisionObject

    public void collision(PhysicsCollisionEvent event) {
        if (spatial == null || event.getNodeA() == null || event.getNodeB() == null) {
            return;
        }

        PhysicsCollisionObject object = null;
        Spatial target = null;
        if (event.getNodeA().equals(spatial)) {
            object = event.getObjectA();
            target = event.getNodeB();
        }
        if (event.getNodeB().equals(spatial)) {
            object = event.getObjectB();
            target = event.getNodeA();
        }
        if (object != null && target != null && object.equals(losGhost)) {
            hasLosAggro = true;
            losTarget = target;
        } else if (object != null && target != null && object.equals(attackGhost)) {
            hasAttackAggro = true;
            attackTarget = target;
        }
    }
View Full Code Here

Examples of com.jme3.bullet.collision.PhysicsCollisionObject

     * For internal use only callback for collisionevent
     *
     * @param event
     */
    public void collision(PhysicsCollisionEvent event) {
        PhysicsCollisionObject objA = event.getObjectA();
        PhysicsCollisionObject objB = event.getObjectB();

        //excluding collisions that involve 2 parts of the ragdoll
        if (event.getNodeA() == null && event.getNodeB() == null) {
            return;
        }

        //discarding low impulse collision
        if (event.getAppliedImpulse() < eventDispatchImpulseThreshold) {
            return;
        }

        boolean hit = false;
        Bone hitBone = null;
        PhysicsCollisionObject hitObject = null;

        //Computing which bone has been hit
        if (objA.getUserObject() instanceof PhysicsBoneLink) {
            PhysicsBoneLink link = (PhysicsBoneLink) objA.getUserObject();
            if (link != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.