Package ea.actor

Enum Class BodyType

All Implemented Interfaces:
Serializable, Comparable<BodyType>, Constable

@API public enum BodyType extends Enum<BodyType>
Aufzählung der drei verschiedenen Typen von Objekten innerhalb der Physics der EA.
  • Statische Objekte:
    • Haben keine Geschwindigkeit
    • Bewegen sich nicht in der Simulation, Kräfte haben keinen Einfluss auf sie.
    Diese Eigenschaft gehört zum Beispiel zu Wänden, Böden und Decken.
  • Dynamische Objekte:
    • Verhalten sich wie Objekte der newton'schen Mechanik.
    • Können Kräfte auf sich wirken lassen und interagieren miteinander.
    Diese Eigenschaft gehört zum Beispiel zu Billiardkugeln, Spielfiguren und Wurfgeschossen.
  • Kinematische Objekte:
    • Können eine Geschwindigkeit haben, aber onKeyDownInternal nicht auf Kräfte.
    • Kollidieren (im Sinne der Physics) nur mit dynamischen Objekten.
    Doese Eigenschaft gehört zum Beispiel zu beweglichen Plattformen.
  • Sensoren:
    • Nehmen nicht an der Physiksimulation teil. Sie werden von der Physics so behandelt, als wären sie nicht da.
    • Generieren troztdem Collision Events
    Dies ist die Standardeinstellung für Actors, wenn sie erstellt werden.
  • Particles:
    • Nehmen wie Sensoren nicht teil an der Physiksimulation
    • Generieren troztdem Collision Events
    Dieser Typ ist hilfreich, wenn du viele Actors generieren willst, diese aber rein optisch auf das Spiel wirken sollen, wie zum Beispiel Dreck, den ein Auto beim Anfahren aufwühlt oder Funken, die von einer Wand nach einem Schuss sprühen.
See Also:
  • Enum Constant Details

    • STATIC

      public static final BodyType STATIC
    • DYNAMIC

      public static final BodyType DYNAMIC
    • KINEMATIC

      public static final BodyType KINEMATIC
    • SENSOR

      public static final BodyType SENSOR
    • PARTICLE

      public static final BodyType PARTICLE
  • Method Details

    • values

      public static BodyType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BodyType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toBox2D

      @Internal public org.jbox2d.dynamics.BodyType toBox2D()
      Konvertierungsmethode zwischen Engine-Physiktyp und JB2D-Physiktyp.
      Returns:
      Der zugehörige JB2D-Phy-Type zu diesem Engine-Phy-Type.
    • isSensor

      public boolean isSensor()