本文整理汇总了Java中com.jme3.bullet.objects.VehicleWheel.getRadius方法的典型用法代码示例。如果您正苦于以下问题:Java VehicleWheel.getRadius方法的具体用法?Java VehicleWheel.getRadius怎么用?Java VehicleWheel.getRadius使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.bullet.objects.VehicleWheel
的用法示例。
在下文中一共展示了VehicleWheel.getRadius方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RemoveVehicleWheelOperation
import com.jme3.bullet.objects.VehicleWheel; //导入方法依赖的package包/类
/**
* Instantiates a new Remove vehicle wheel operation.
*
* @param control the control
* @param wheel the wheel
*/
public RemoveVehicleWheelOperation(@NotNull final VehicleControl control, @NotNull final VehicleWheel wheel) {
this.control = control;
this.connectionPoint = wheel.getLocation();
this.direction = wheel.getDirection();
this.axle = wheel.getAxle();
this.restLength = wheel.getRestLength();
this.wheelRadius = wheel.getRadius();
this.isFrontWheel = wheel.isFrontWheel();
this.createdWheel = wheel;
}
示例2: SuspensionSettings
import com.jme3.bullet.objects.VehicleWheel; //导入方法依赖的package包/类
public SuspensionSettings(VehicleWheel wheel) {
this.direction.set(wheel.getDirection());
this.axle.set(wheel.getAxle());
this.frontWheel = wheel.isFrontWheel();
this.radius = wheel.getRadius();
this.restLength = wheel.getRestLength();
this.maxForce = wheel.getMaxSuspensionForce();
this.stiffness = wheel.getSuspensionStiffness();
this.rollInfluence = wheel.getRollInfluence();
this.compression = wheel.getWheelsDampingCompression();
this.release = wheel.getWheelsDampingRelaxation();
this.friction = wheel.getFrictionSlip();
}
示例3: checkAndUpdateVehicle
import com.jme3.bullet.objects.VehicleWheel; //导入方法依赖的package包/类
private void checkAndUpdateVehicle() {
final int numWheels = body.getNumWheels();
suspensionNode.detachAllChildren();
for (int i = 0; i < numWheels; i++) {
final VehicleWheel physicsVehicleWheel = body.getWheel(i);
final Vector3f location = new Vector3f(physicsVehicleWheel.getLocation());
final Vector3f direction = new Vector3f(physicsVehicleWheel.getDirection());
direction.normalizeLocal();
final Vector3f axle = new Vector3f(physicsVehicleWheel.getAxle());
axle.normalizeLocal();
axle.multLocal(0.3f);
final float restLength = physicsVehicleWheel.getRestLength();
final float radius = physicsVehicleWheel.getRadius();
final Arrow locArrow = new Arrow(location);
final Arrow axleArrow = new Arrow(axle);
final Arrow wheelArrow = new Arrow(direction.multLocal(radius));
final Arrow dirArrow = new Arrow(direction.multLocal(restLength));
final Geometry locGeom = new Geometry("WheelLocationDebugShape" + i, locArrow);
final Geometry dirGeom = new Geometry("WheelDirectionDebugShape" + i, dirArrow);
final Geometry axleGeom = new Geometry("WheelAxleDebugShape" + i, axleArrow);
final Geometry wheelGeom = new Geometry("WheelRadiusDebugShape" + i, wheelArrow);
dirGeom.setLocalTranslation(location);
axleGeom.setLocalTranslation(location.add(direction));
wheelGeom.setLocalTranslation(location.add(direction));
locGeom.setMaterial(debugAppState.getDebugMagenta());
dirGeom.setMaterial(debugAppState.getDebugMagenta());
axleGeom.setMaterial(debugAppState.getDebugMagenta());
wheelGeom.setMaterial(debugAppState.getDebugMagenta());
suspensionNode.attachChild(locGeom);
suspensionNode.attachChild(dirGeom);
suspensionNode.attachChild(axleGeom);
suspensionNode.attachChild(wheelGeom);
}
}
示例4: controlUpdate
import com.jme3.bullet.objects.VehicleWheel; //导入方法依赖的package包/类
@Override
protected void controlUpdate(final float tpf) {
checkAndUpdateVehicle();
for (int i = 0; i < body.getNumWheels(); i++) {
final VehicleWheel physicsVehicleWheel = body.getWheel(i);
final Vector3f location = new Vector3f(physicsVehicleWheel.getLocation());
final Vector3f direction = new Vector3f(physicsVehicleWheel.getDirection());
direction.normalizeLocal();
final Vector3f axle = new Vector3f(physicsVehicleWheel.getAxle());
axle.normalizeLocal();
axle.multLocal(0.3f);
final float restLength = physicsVehicleWheel.getRestLength();
final float radius = physicsVehicleWheel.getRadius();
final Geometry locGeom = (Geometry) suspensionNode.getChild("WheelLocationDebugShape" + i);
final Geometry dirGeom = (Geometry) suspensionNode.getChild("WheelDirectionDebugShape" + i);
final Geometry axleGeom = (Geometry) suspensionNode.getChild("WheelAxleDebugShape" + i);
final Geometry wheelGeom = (Geometry) suspensionNode.getChild("WheelRadiusDebugShape" + i);
final Arrow locArrow = (Arrow) locGeom.getMesh();
locArrow.setArrowExtent(location);
final Arrow axleArrow = (Arrow) axleGeom.getMesh();
axleArrow.setArrowExtent(axle);
final Arrow wheelArrow = (Arrow) wheelGeom.getMesh();
wheelArrow.setArrowExtent(direction.multLocal(radius));
final Arrow dirArrow = (Arrow) dirGeom.getMesh();
dirArrow.setArrowExtent(direction.multLocal(restLength));
dirGeom.setLocalTranslation(location);
axleGeom.setLocalTranslation(location.addLocal(direction));
wheelGeom.setLocalTranslation(location);
}
final Vector3f physicsLocation = body.getPhysicsLocation(physicalLocation);
final Quaternion physicsRotation = body.getPhysicsRotation(physicalRotation);
applyPhysicsTransform(physicsLocation, physicsRotation);
}
示例5: render
import com.jme3.bullet.objects.VehicleWheel; //导入方法依赖的package包/类
public void render(RenderManager rm, ViewPort vp) {
if (enabled && space != null && space.getDebugManager() != null) {
if (debugShape == null) {
attachDebugShape(space.getDebugManager());
}
Node debugNode = (Node) debugShape;
debugShape.setLocalTranslation(spatial.getWorldTranslation());
debugShape.setLocalRotation(spatial.getWorldRotation());
int i = 0;
for (Iterator<VehicleWheel> it = wheels.iterator(); it.hasNext();) {
VehicleWheel physicsVehicleWheel = it.next();
Vector3f location = physicsVehicleWheel.getLocation().clone();
Vector3f direction = physicsVehicleWheel.getDirection().clone();
Vector3f axle = physicsVehicleWheel.getAxle().clone();
float restLength = physicsVehicleWheel.getRestLength();
float radius = physicsVehicleWheel.getRadius();
Geometry locGeom = (Geometry) debugNode.getChild("WheelLocationDebugShape" + i);
Geometry dirGeom = (Geometry) debugNode.getChild("WheelDirectionDebugShape" + i);
Geometry axleGeom = (Geometry) debugNode.getChild("WheelAxleDebugShape" + i);
Geometry wheelGeom = (Geometry) debugNode.getChild("WheelRadiusDebugShape" + i);
Arrow locArrow = (Arrow) locGeom.getMesh();
locArrow.setArrowExtent(location);
Arrow axleArrow = (Arrow) axleGeom.getMesh();
axleArrow.setArrowExtent(axle.normalizeLocal().multLocal(0.3f));
Arrow wheelArrow = (Arrow) wheelGeom.getMesh();
wheelArrow.setArrowExtent(direction.normalizeLocal().multLocal(radius));
Arrow dirArrow = (Arrow) dirGeom.getMesh();
dirArrow.setArrowExtent(direction.normalizeLocal().multLocal(restLength));
dirGeom.setLocalTranslation(location);
axleGeom.setLocalTranslation(location.addLocal(direction));
wheelGeom.setLocalTranslation(location);
i++;
}
debugShape.updateLogicalState(0);
debugShape.updateGeometricState();
rm.renderScene(debugShape, vp);
}
}