Пример #1
0
 @Override
 public Vector3f supportPointLocalNegative(Vector3f direction) {
   if (direction.lengthSquared() != 0) direction.normalize();
   Vector3f v = QuatMath.transform(collisionshape.getInverseRotation(), direction);
   float vy = 0;
   float capstart =
       (float)
           (halfheight
               / Math.sqrt(
                   radius * radius
                       + halfheight
                           * halfheight)); // VecMath.normalize(new Vector2f(radius,
                                           // halfheight)).y;
   if (Math.abs(direction.y) > capstart) {
     float len = (float) new Vector2f(direction.x / capstart, direction.z / capstart).length();
     vy = (float) (Math.sqrt(radius * radius - len * len));
   }
   vy += halfheight;
   return new Vector3f(-v.x * radius, (v.y < 0 ? vy : -vy), -v.z * radius);
 }