Examples of PhysicsProperties


Examples of org.jdesktop.wonderland.common.cell.component.state.PhysicsProperties

    }

    public <T extends CellComponentServerState> T getDefaultCellComponentServerState() {
        CellPhysicsPropertiesComponentServerState state =
                new CellPhysicsPropertiesComponentServerState();
        PhysicsProperties prop = state.getPhyiscsProperties(
                CellPhysicsPropertiesComponentServerState.DEFAULT_NAME);
        if (prop == null) {
            prop = new PhysicsProperties();
            state.addPhysicsProperties(
                    CellPhysicsPropertiesComponentServerState.DEFAULT_NAME,
                    prop);
        }
        prop.setMass(2f);
        return (T) state;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.component.state.PhysicsProperties

    protected PhysicsComponent setupPhysics(CollisionComponent physicsCC, PhysicsSystem physicsSystem, Node rootNode) {
        if (physicsCC!=null && physicsCC instanceof JBulletCollisionComponent && physicsSystem instanceof JBulletPhysicsSystem) {
            JBulletPhysicsComponent pc = ((JBulletPhysicsSystem)physicsSystem).createPhysicsComponent((JBulletCollisionComponent)physicsCC);
            CellPhysicsPropertiesComponent prop = cell.getComponent(CellPhysicsPropertiesComponent.class);
            if (prop!=null) {
                PhysicsProperties phy = prop.getPhysicsProperties(CellPhysicsPropertiesComponent.DEFAULT_NAME);
                if (phy!=null) {
                    System.err.println("---------------> setting mass on "+this);
                    pc.setMass(phy.getMass());
                }
            }
            return pc;
        } else {
            logger.warning("Unsupported PhysicsSystem "+physicsSystem);
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.component.state.PhysicsProperties

                CellPhysicsPropertiesComponentServerState.class);
        if (state == null) {
            state = new CellPhysicsPropertiesComponentServerState();
        }

        PhysicsProperties p = state.getPhyiscsProperties(
                CellPhysicsPropertiesComponentServerState.DEFAULT_NAME);
        if (p == null) {
            p = new PhysicsProperties();
            state.addPhysicsProperties(
                    CellPhysicsPropertiesComponentServerState.DEFAULT_NAME, p);
        }

        p.setMass(((Float) massSpinner.getModel().getValue()).floatValue());
        cellServerState.addComponentServerState(state);
    }
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.