Beispiel #1
0
 public void sendUpdate(VehicleControl vehicle) {
   if (this.multiplayer) {
     ActorUpdate update =
         new ActorUpdate(
             this.clientMan.getId(),
             vehicle.getPhysicsLocation(),
             vehicle.getPhysicsRotationMatrix(),
             vehicle.getLinearVelocity(),
             vehicle.getAngularVelocity());
     this.clientMan.update(update);
   }
 }
Beispiel #2
0
  private void addWheel(VehicleControl v, ModelBase model, WheelComponent wheel) {
    Vector3f offset = arrayToVector(wheel.offset());
    Vector3f direction = arrayToVector(wheel.direction());
    Vector3f axe = arrayToVector(wheel.axe());

    if (offset.length() == 0) offset = model.getChild(wheel.nodeName()).getLocalTranslation();

    v.addWheel(
        model.getChild(wheel.nodeName()),
        offset,
        direction,
        axe,
        wheel.restLength(),
        wheel.radius(),
        wheel.frontWheel());
  }