当前位置: 首页>>代码示例>>Java>>正文


Java VehicleWheel.setWheelsDampingCompression方法代码示例

本文整理汇总了Java中com.jme3.bullet.objects.VehicleWheel.setWheelsDampingCompression方法的典型用法代码示例。如果您正苦于以下问题:Java VehicleWheel.setWheelsDampingCompression方法的具体用法?Java VehicleWheel.setWheelsDampingCompression怎么用?Java VehicleWheel.setWheelsDampingCompression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.bullet.objects.VehicleWheel的用法示例。


在下文中一共展示了VehicleWheel.setWheelsDampingCompression方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doApplyWheelData

import com.jme3.bullet.objects.VehicleWheel; //导入方法依赖的package包/类
public void doApplyWheelData(VehicleControl control, int wheels, SuspensionSettings settings) {
        for (int i = 0; i < control.getNumWheels(); i++) {
            VehicleWheel wheel = control.getWheel(i);
            switch (wheels) {
                case 0:
                    break;
                case 1:
                    if (!wheel.isFrontWheel()) {
                        continue;
                    }
                    break;
                case 2:
                    if (wheel.isFrontWheel()) {
                        continue;
                    }
                    break;
            }
            wheel.setRestLength(settings.getRestLength());
            wheel.setMaxSuspensionForce(settings.getMaxForce());
            wheel.setSuspensionStiffness(settings.getStiffness());
            wheel.setRollInfluence(settings.getRollInfluence());
            wheel.setWheelsDampingCompression(settings.getCompression());
            wheel.setWheelsDampingRelaxation(settings.getRelease());
//            wheel.setRadius(settings.getRadius());
            wheel.setFrictionSlip(settings.getFriction());
        }
    }
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:28,代码来源:VehicleEditorController.java

示例2: applyData

import com.jme3.bullet.objects.VehicleWheel; //导入方法依赖的package包/类
public void applyData(VehicleWheel wheel){
    wheel.setRadius(getRadius());
    wheel.setFrictionSlip(getFriction());
    wheel.setRollInfluence(getRollInfluence());
    wheel.setMaxSuspensionForce(getMaxForce());
    wheel.setSuspensionStiffness(getStiffness());
    wheel.setWheelsDampingCompression(getCompression());
    wheel.setWheelsDampingRelaxation(getRelease());
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:10,代码来源:SuspensionSettings.java

示例3: cloneForSpatial

import com.jme3.bullet.objects.VehicleWheel; //导入方法依赖的package包/类
public Control cloneForSpatial(Spatial spatial) {
    VehicleControl control = new VehicleControl(collisionShape, mass);
    control.setAngularFactor(getAngularFactor());
    control.setAngularSleepingThreshold(getAngularSleepingThreshold());
    control.setAngularVelocity(getAngularVelocity());
    control.setCcdMotionThreshold(getCcdMotionThreshold());
    control.setCcdSweptSphereRadius(getCcdSweptSphereRadius());
    control.setCollideWithGroups(getCollideWithGroups());
    control.setCollisionGroup(getCollisionGroup());
    control.setDamping(getLinearDamping(), getAngularDamping());
    control.setFriction(getFriction());
    control.setGravity(getGravity());
    control.setKinematic(isKinematic());
    control.setLinearSleepingThreshold(getLinearSleepingThreshold());
    control.setLinearVelocity(getLinearVelocity());
    control.setPhysicsLocation(getPhysicsLocation());
    control.setPhysicsRotation(getPhysicsRotationMatrix());
    control.setRestitution(getRestitution());

    control.setFrictionSlip(getFrictionSlip());
    control.setMaxSuspensionTravelCm(getMaxSuspensionTravelCm());
    control.setSuspensionStiffness(getSuspensionStiffness());
    control.setSuspensionCompression(tuning.suspensionCompression);
    control.setSuspensionDamping(tuning.suspensionDamping);
    control.setMaxSuspensionForce(getMaxSuspensionForce());

    for (Iterator<VehicleWheel> it = wheels.iterator(); it.hasNext();) {
        VehicleWheel wheel = it.next();
        VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel());
        newWheel.setFrictionSlip(wheel.getFrictionSlip());
        newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());
        newWheel.setSuspensionStiffness(wheel.getSuspensionStiffness());
        newWheel.setWheelsDampingCompression(wheel.getWheelsDampingCompression());
        newWheel.setWheelsDampingRelaxation(wheel.getWheelsDampingRelaxation());
        newWheel.setMaxSuspensionForce(wheel.getMaxSuspensionForce());

        //TODO: bad way finding children!
        if (spatial instanceof Node) {
            Node node = (Node) spatial;
            Spatial wheelSpat = node.getChild(wheel.getWheelSpatial().getName());
            if (wheelSpat != null) {
                newWheel.setWheelSpatial(wheelSpat);
            }
        }
    }
    control.setApplyPhysicsLocal(isApplyPhysicsLocal());

    control.setSpatial(spatial);
    return control;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:51,代码来源:VehicleControl.java


注:本文中的com.jme3.bullet.objects.VehicleWheel.setWheelsDampingCompression方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。