Package org.jdesktop.wonderland.common.cell.component.state

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


    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

                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

Related Classes of org.jdesktop.wonderland.common.cell.component.state.PhysicsProperties

Copyright © 2018 www.massapicom. 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.