summaryrefslogtreecommitdiff
path: root/simulation/protos/Ball.proto
blob: c9921894f558fb656bab79b5bcdd2997a0014876 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#VRML_SIM R2023b utf8
# license: Copyright Cyberbotics Ltd. Licensed for use only with Webots.
# license url: https://cyberbotics.com/webots_assets_license
# documentation url: https://webots.cloud/run?url=https://github.com/cyberbotics/webots/blob/released/projects/objects/balls/protos/Ball.proto
# keywords: exterior/sport
# The Ball's size, mass and color correspond to the soccer ball used in the Robocup SPL.
# You can change the centerOfMass to [0 0 0] to avoid the random rolling effect.

PROTO Ball [
  field SFVec3f    translation     0 0 0.1625
  field SFRotation rotation        0 0 1 0
  field SFString   name            "ball"
  field SFColor    color           1.0 0.54 0.08  # Defines the color of the ball.
  field SFFloat    radius          0.0325         # Defines the radius of the ball.
  field SFFloat    mass            0.055          # Defines the mass of the ball.
  field MFVec3f    centerOfMass    [0 0 -0.0001]  # Defines the center of mass of the ball.
  field SFFloat    linearDamping   0.17           # Defines the linear damping of the ball.
  field SFFloat    angularDamping  0.33           # Defines the angular damping of the ball.
  field SFString   contactMaterial "default"      # Is `Solid.contactMaterial`.
]
{
  Solid {
    translation IS translation
    rotation IS rotation
    children [
      DEF BALL_SHAPE Shape {
        appearance PBRAppearance {
            baseColor IS color
            roughness 0.3
            metalness 0
        }
        geometry Sphere {
          radius IS radius
          subdivision 4
        }
      }
    ]
    contactMaterial IS contactMaterial
    boundingObject USE BALL_SHAPE
    physics Physics {
      density -1
      mass IS mass
      centerOfMass IS centerOfMass
      inertiaMatrix [ 0.000023 0.000023 0.000023, 0 0 0 ]
      damping Damping {
        linear IS linearDamping
        angular IS angularDamping
      }
    }
    name IS name
    model "ball"
  }
}