Class SpinEvent

java.lang.Object
com.sparshui.common.messages.events.SpinEvent
All Implemented Interfaces:
Event, Serializable

public class SpinEvent extends Object implements Event
See Also:
  • Constructor Details

    • SpinEvent

      public SpinEvent()
    • SpinEvent

      public SpinEvent(float rotationX, float rotationY, float rotationZ)
    • SpinEvent

      public SpinEvent(byte[] data)
      Constructs a new SpinEvent from a serialized version - 4 bytes : rotationX - 4 bytes : rotationY - 4 bytes : rotationZ - 12 bytes total
      Parameters:
      data - the serialized version of touchEvent
  • Method Details

    • getEventType

      public int getEventType()
      Description copied from interface: Event
      Returns the integer value of this event type. Event type values are defined in the enumeration com.sparshui.common.messages.events.EventType.java
      Specified by:
      getEventType in interface Event
      Returns:
      The event type
    • getRotationX

      public float getRotationX()
    • getRotationY

      public float getRotationY()
    • getRotationZ

      public float getRotationZ()
    • setRotationX

      public void setRotationX(float rotation)
    • setRotationY

      public void setRotationY(float rotation)
    • setRotationZ

      public void setRotationZ(float rotation)
    • serialize

      public byte[] serialize()
      Constructs the data packet with this event data. Message format for this event: - 4 bytes : event type - 4 bytes : rotationX - 4 bytes : rotationY - 4 bytes : rotationZ - 16 bytes total
      Specified by:
      serialize in interface Event
      Returns:
      serialized data
    • toString

      public String toString()
      Overrides:
      toString in class Object