com.jme3.bullet.objects
クラス PhysicsVehicle

java.lang.Object
  上位を拡張 com.jme3.bullet.collision.PhysicsCollisionObject
      上位を拡張 com.jme3.bullet.objects.PhysicsRigidBody
          上位を拡張 com.jme3.bullet.objects.PhysicsVehicle
すべての実装されたインタフェース:
Savable
直系の既知のサブクラス:
VehicleControl

public class PhysicsVehicle
extends PhysicsRigidBody

PhysicsVehicleNode - Special PhysicsNode that implements vehicle functions

From bullet manual:
For most vehicle simulations, it is recommended to use the simplified Bullet vehicle model as provided in btRaycastVehicle. Instead of simulation each wheel and chassis as separate rigid bodies, connected by constraints, it uses a simplified model. This simplified model has many benefits, and is widely used in commercial driving games.
The entire vehicle is represented as a single rigidbody, the chassis. The collision detection of the wheels is approximated by ray casts, and the tire friction is a basic anisotropic friction model.


フィールドの概要
 
クラス com.jme3.bullet.collision.PhysicsCollisionObject から継承されたフィールド
COLLISION_GROUP_01, COLLISION_GROUP_02, COLLISION_GROUP_03, COLLISION_GROUP_04, COLLISION_GROUP_05, COLLISION_GROUP_06, COLLISION_GROUP_07, COLLISION_GROUP_08, COLLISION_GROUP_09, COLLISION_GROUP_10, COLLISION_GROUP_11, COLLISION_GROUP_12, COLLISION_GROUP_13, COLLISION_GROUP_14, COLLISION_GROUP_15, COLLISION_GROUP_16, COLLISION_GROUP_NONE
 
コンストラクタの概要
PhysicsVehicle()
           
PhysicsVehicle(CollisionShape shape)
           
PhysicsVehicle(CollisionShape shape, float mass)
           
 
メソッドの概要
 void accelerate(float force)
          Apply the given engine force to all wheels, works continuously
 void accelerate(int wheel, float force)
          Apply the given engine force, works continuously
 VehicleWheel addWheel(Spatial spat, Vector3f connectionPoint, Vector3f direction, Vector3f axle, float suspensionRestLength, float wheelRadius, boolean isFrontWheel)
          Add a wheel to this vehicle
 VehicleWheel addWheel(Vector3f connectionPoint, Vector3f direction, Vector3f axle, float suspensionRestLength, float wheelRadius, boolean isFrontWheel)
          Add a wheel to this vehicle
 void applyWheelTransforms()
          used internally
 void brake(float force)
          Apply the given brake force to all wheels, works continuously
 void brake(int wheel, float force)
          Apply the given brake force, works continuously
 void createVehicle(PhysicsSpace space)
          Used internally, creates the actual vehicle constraint when vehicle is added to phyicsspace
 void destroy()
          destroys this PhysicsRigidBody and removes it from memory
 float getCurrentVehicleSpeedKmHour()
          Get the current speed of the vehicle in km/h
 Vector3f getForwardVector(Vector3f vector)
          Get the current forward vector of the vehicle in world coordinates
 float getFrictionSlip()
           
 float getMaxSuspensionForce()
           
 float getMaxSuspensionTravelCm()
           
 int getNumWheels()
           
 float getSuspensionCompression()
           
 float getSuspensionDamping()
           
 float getSuspensionStiffness()
           
 com.bulletphysics.dynamics.vehicle.RaycastVehicle getVehicleId()
          used internally
 VehicleWheel getWheel(int wheel)
          You can get access to the single wheels via this method.
 void read(JmeImporter im)
           
 void removeWheel(int wheel)
          This rebuilds the vehicle as there is no way in bullet to remove a wheel.
 void resetSuspension()
          Reset the suspension
 void setFrictionSlip(float frictionSlip)
          Use before adding wheels, this is the default used when adding wheels.
 void setFrictionSlip(int wheel, float frictionSlip)
          The coefficient of friction between the tyre and the ground.
 void setMaxSuspensionForce(float maxSuspensionForce)
          This vaue caps the maximum suspension force, raise this above the default 6000 if your suspension cannot handle the weight of your vehcile.
 void setMaxSuspensionForce(int wheel, float maxSuspensionForce)
          This vaue caps the maximum suspension force, raise this above the default 6000 if your suspension cannot handle the weight of your vehcile.
 void setMaxSuspensionTravelCm(float maxSuspensionTravelCm)
          Use before adding wheels, this is the default used when adding wheels.
 void setMaxSuspensionTravelCm(int wheel, float maxSuspensionTravelCm)
          The maximum distance the suspension can be compressed (centimetres)
 void setRollInfluence(int wheel, float rollInfluence)
          Reduces the rolling torque applied from the wheels that cause the vehicle to roll over.
 void setSuspensionCompression(float suspensionCompression)
          Use before adding wheels, this is the default used when adding wheels.
 void setSuspensionCompression(int wheel, float suspensionCompression)
          The damping coefficient for when the suspension is compressed.
 void setSuspensionDamping(float suspensionDamping)
          Use before adding wheels, this is the default used when adding wheels.
 void setSuspensionDamping(int wheel, float suspensionDamping)
          The damping coefficient for when the suspension is expanding.
 void setSuspensionStiffness(float suspensionStiffness)
          Use before adding wheels, this is the default used when adding wheels.
 void setSuspensionStiffness(int wheel, float suspensionStiffness)
          The stiffness constant for the suspension. 10.0 - Offroad buggy, 50.0 - Sports car, 200.0 - F1 Car
 void steer(float value)
          Set the given steering value to all front wheels (0 = forward)
 void steer(int wheel, float value)
          Set the given steering value to the given wheel (0 = forward)
 void updateWheels()
          used internally
 void write(JmeExporter ex)
           
 
クラス com.jme3.bullet.objects.PhysicsRigidBody から継承されたメソッド
activate, addJoint, applyCentralForce, applyForce, applyImpulse, applyTorque, applyTorqueImpulse, clearForces, getAngularDamping, getAngularFactor, getAngularSleepingThreshold, getAngularVelocity, getAngularVelocity, getCcdMotionThreshold, getCcdSquareMotionThreshold, getCcdSweptSphereRadius, getFriction, getGravity, getGravity, getInterpolatedPhysicsLocation, getInterpolatedPhysicsRotation, getJoints, getLinearDamping, getLinearSleepingThreshold, getLinearVelocity, getLinearVelocity, getMass, getMotionState, getObjectId, getPhysicsLocation, getPhysicsLocation, getPhysicsRotation, getPhysicsRotation, getPhysicsRotationMatrix, getPhysicsRotationMatrix, getRestitution, isActive, isKinematic, removeJoint, setAngularDamping, setAngularFactor, setAngularSleepingThreshold, setAngularVelocity, setCcdMotionThreshold, setCcdSweptSphereRadius, setCollisionShape, setDamping, setFriction, setGravity, setKinematic, setLinearDamping, setLinearSleepingThreshold, setLinearVelocity, setMass, setPhysicsLocation, setPhysicsRotation, setPhysicsRotation, setRestitution, setSleepingThresholds
 
クラス com.jme3.bullet.collision.PhysicsCollisionObject から継承されたメソッド
addCollideWithGroup, createDebugShape, debugShape, detachDebugShape, getCollideWithGroups, getCollisionGroup, getCollisionShape, getUserObject, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObject
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

PhysicsVehicle

public PhysicsVehicle()

PhysicsVehicle

public PhysicsVehicle(CollisionShape shape)

PhysicsVehicle

public PhysicsVehicle(CollisionShape shape,
                      float mass)
メソッドの詳細

updateWheels

public void updateWheels()
used internally


applyWheelTransforms

public void applyWheelTransforms()
used internally


createVehicle

public void createVehicle(PhysicsSpace space)
Used internally, creates the actual vehicle constraint when vehicle is added to phyicsspace


addWheel

public VehicleWheel addWheel(Vector3f connectionPoint,
                             Vector3f direction,
                             Vector3f axle,
                             float suspensionRestLength,
                             float wheelRadius,
                             boolean isFrontWheel)
Add a wheel to this vehicle

パラメータ:
connectionPoint - The starting point of the ray, where the suspension connects to the chassis (chassis space)
direction - the direction of the wheel (should be -Y / 0,-1,0 for a normal car)
axle - The axis of the wheel, pointing right in vehicle direction (should be -X / -1,0,0 for a normal car)
suspensionRestLength - The current length of the suspension (metres)
wheelRadius - the wheel radius
isFrontWheel - sets if this wheel is a front wheel (steering)
戻り値:
the PhysicsVehicleWheel object to get/set infos on the wheel

addWheel

public VehicleWheel addWheel(Spatial spat,
                             Vector3f connectionPoint,
                             Vector3f direction,
                             Vector3f axle,
                             float suspensionRestLength,
                             float wheelRadius,
                             boolean isFrontWheel)
Add a wheel to this vehicle

パラメータ:
spat - the wheel Geometry
connectionPoint - The starting point of the ray, where the suspension connects to the chassis (chassis space)
direction - the direction of the wheel (should be -Y / 0,-1,0 for a normal car)
axle - The axis of the wheel, pointing right in vehicle direction (should be -X / -1,0,0 for a normal car)
suspensionRestLength - The current length of the suspension (metres)
wheelRadius - the wheel radius
isFrontWheel - sets if this wheel is a front wheel (steering)
戻り値:
the PhysicsVehicleWheel object to get/set infos on the wheel

removeWheel

public void removeWheel(int wheel)
This rebuilds the vehicle as there is no way in bullet to remove a wheel.

パラメータ:
wheel -

getWheel

public VehicleWheel getWheel(int wheel)
You can get access to the single wheels via this method.

パラメータ:
wheel - the wheel index
戻り値:
the WheelInfo of the selected wheel

getNumWheels

public int getNumWheels()

getFrictionSlip

public float getFrictionSlip()
戻り値:
the frictionSlip

setFrictionSlip

public void setFrictionSlip(float frictionSlip)
Use before adding wheels, this is the default used when adding wheels. After adding the wheel, use direct wheel access.
The coefficient of friction between the tyre and the ground. Should be about 0.8 for realistic cars, but can increased for better handling. Set large (10000.0) for kart racers

パラメータ:
frictionSlip - the frictionSlip to set

setFrictionSlip

public void setFrictionSlip(int wheel,
                            float frictionSlip)
The coefficient of friction between the tyre and the ground. Should be about 0.8 for realistic cars, but can increased for better handling. Set large (10000.0) for kart racers

パラメータ:
wheel -
frictionSlip -

setRollInfluence

public void setRollInfluence(int wheel,
                             float rollInfluence)
Reduces the rolling torque applied from the wheels that cause the vehicle to roll over. This is a bit of a hack, but it's quite effective. 0.0 = no roll, 1.0 = physical behaviour. If m_frictionSlip is too high, you'll need to reduce this to stop the vehicle rolling over. You should also try lowering the vehicle's centre of mass


getMaxSuspensionTravelCm

public float getMaxSuspensionTravelCm()
戻り値:
the maxSuspensionTravelCm

setMaxSuspensionTravelCm

public void setMaxSuspensionTravelCm(float maxSuspensionTravelCm)
Use before adding wheels, this is the default used when adding wheels. After adding the wheel, use direct wheel access.
The maximum distance the suspension can be compressed (centimetres)

パラメータ:
maxSuspensionTravelCm - the maxSuspensionTravelCm to set

setMaxSuspensionTravelCm

public void setMaxSuspensionTravelCm(int wheel,
                                     float maxSuspensionTravelCm)
The maximum distance the suspension can be compressed (centimetres)

パラメータ:
wheel -
maxSuspensionTravelCm -

getMaxSuspensionForce

public float getMaxSuspensionForce()

setMaxSuspensionForce

public void setMaxSuspensionForce(float maxSuspensionForce)
This vaue caps the maximum suspension force, raise this above the default 6000 if your suspension cannot handle the weight of your vehcile.

パラメータ:
maxSuspensionForce -

setMaxSuspensionForce

public void setMaxSuspensionForce(int wheel,
                                  float maxSuspensionForce)
This vaue caps the maximum suspension force, raise this above the default 6000 if your suspension cannot handle the weight of your vehcile.

パラメータ:
wheel -
maxSuspensionForce -

getSuspensionCompression

public float getSuspensionCompression()
戻り値:
the suspensionCompression

setSuspensionCompression

public void setSuspensionCompression(float suspensionCompression)
Use before adding wheels, this is the default used when adding wheels. After adding the wheel, use direct wheel access.
The damping coefficient for when the suspension is compressed. Set to k * 2.0 * FastMath.sqrt(m_suspensionStiffness) so k is proportional to critical damping.
k = 0.0 undamped & bouncy, k = 1.0 critical damping
0.1 to 0.3 are good values

パラメータ:
suspensionCompression - the suspensionCompression to set

setSuspensionCompression

public void setSuspensionCompression(int wheel,
                                     float suspensionCompression)
The damping coefficient for when the suspension is compressed. Set to k * 2.0 * FastMath.sqrt(m_suspensionStiffness) so k is proportional to critical damping.
k = 0.0 undamped & bouncy, k = 1.0 critical damping
0.1 to 0.3 are good values

パラメータ:
wheel -
suspensionCompression -

getSuspensionDamping

public float getSuspensionDamping()
戻り値:
the suspensionDamping

setSuspensionDamping

public void setSuspensionDamping(float suspensionDamping)
Use before adding wheels, this is the default used when adding wheels. After adding the wheel, use direct wheel access.
The damping coefficient for when the suspension is expanding. See the comments for setSuspensionCompression for how to set k.

パラメータ:
suspensionDamping - the suspensionDamping to set

setSuspensionDamping

public void setSuspensionDamping(int wheel,
                                 float suspensionDamping)
The damping coefficient for when the suspension is expanding. See the comments for setSuspensionCompression for how to set k.

パラメータ:
wheel -
suspensionDamping -

getSuspensionStiffness

public float getSuspensionStiffness()
戻り値:
the suspensionStiffness

setSuspensionStiffness

public void setSuspensionStiffness(float suspensionStiffness)
Use before adding wheels, this is the default used when adding wheels. After adding the wheel, use direct wheel access.
The stiffness constant for the suspension. 10.0 - Offroad buggy, 50.0 - Sports car, 200.0 - F1 Car

パラメータ:
suspensionStiffness -

setSuspensionStiffness

public void setSuspensionStiffness(int wheel,
                                   float suspensionStiffness)
The stiffness constant for the suspension. 10.0 - Offroad buggy, 50.0 - Sports car, 200.0 - F1 Car

パラメータ:
wheel -
suspensionStiffness -

resetSuspension

public void resetSuspension()
Reset the suspension


accelerate

public void accelerate(float force)
Apply the given engine force to all wheels, works continuously

パラメータ:
force - the force

accelerate

public void accelerate(int wheel,
                       float force)
Apply the given engine force, works continuously

パラメータ:
wheel - the wheel to apply the force on
force - the force

steer

public void steer(float value)
Set the given steering value to all front wheels (0 = forward)

パラメータ:
value - the steering angle of the front wheels (Pi = 360deg)

steer

public void steer(int wheel,
                  float value)
Set the given steering value to the given wheel (0 = forward)

パラメータ:
wheel - the wheel to set the steering on
value - the steering angle of the front wheels (Pi = 360deg)

brake

public void brake(float force)
Apply the given brake force to all wheels, works continuously

パラメータ:
force - the force

brake

public void brake(int wheel,
                  float force)
Apply the given brake force, works continuously

パラメータ:
wheel - the wheel to apply the force on
force - the force

getCurrentVehicleSpeedKmHour

public float getCurrentVehicleSpeedKmHour()
Get the current speed of the vehicle in km/h

戻り値:

getForwardVector

public Vector3f getForwardVector(Vector3f vector)
Get the current forward vector of the vehicle in world coordinates

パラメータ:
vector -
戻り値:

getVehicleId

public com.bulletphysics.dynamics.vehicle.RaycastVehicle getVehicleId()
used internally


destroy

public void destroy()
クラス PhysicsRigidBody の記述:
destroys this PhysicsRigidBody and removes it from memory

オーバーライド:
クラス PhysicsRigidBody 内の destroy

read

public void read(JmeImporter im)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
オーバーライド:
クラス PhysicsRigidBody 内の read
例外:
java.io.IOException

write

public void write(JmeExporter ex)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
オーバーライド:
クラス PhysicsRigidBody 内の write
例外:
java.io.IOException