Class SpinEvent
java.lang.Object
com.sparshui.common.messages.events.SpinEvent
- All Implemented Interfaces:
Event
,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the integer value of this event type.float
float
float
byte[]
Constructs the data packet with this event data.void
setRotationX
(float rotation) void
setRotationY
(float rotation) void
setRotationZ
(float rotation) toString()
-
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 interfaceEvent
- 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 -
toString
-