Documentation
¶
Overview ¶
This package provides a simple API to connect to a leap motion device and parse all the data sent by the device.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
A Conn holds a connection to a leap motion device.
func Connect ¶
Connect connects to a leap device running on the given host, and checks the version running is correct.
type Frame ¶
type Frame struct {
CurrentFrameRate float64 `json:"currentFrameRate"`
ID float64 `json:"id"`
R [][]float64 `json:"r"`
S float64 `json:"s"`
T []float64 `json:"t"`
Timestamp int64 `json:"timestamp"`
Gestures []Gesture `json:"gestures"`
Hands []Hand `json:"hands"`
InteractionBox InteractionBox `json:"interactionBox"`
Pointables []Pointable `json:"pointables"`
}
A Frame contains a snapshot of the data detected by the device.
type Gesture ¶
type Gesture struct {
Center []float64 `json:"center"` // circle only
Direction []float64 `json:"direction"` // swipe, keyTap, screenTap only
Duration int64 `json:"duration"`
HandsIDs []int `json:"handIds"`
ID int `json:"id"`
Normal []float64 `json:"normal"` // circle only
PointableIDs []int `json:"pointableIds"`
Position []float64 `json:"position"` // swipe, keyTap, screenTap only
Progress float64 `json:"progress"` // circle, keyTap, screenTap only
Radius float64 `json:"radius"` // circle only
Speed float64 `json:"speed"` // swipe only
StartPosition []float64 `json:"startPosition"` // swipe only
State GestureState `json:"state"`
Type GestureType `json:"type"`
}
type GestureState ¶
type GestureState string
const ( Start GestureState = "start" Update GestureState = "update" Stop GestureState = "stop" )
type GestureType ¶
type GestureType string
const ( Circle GestureType = "circle" Swipe GestureType = "swipe" KeyTap GestureType = "keyTap" ScreenTap GestureType = "screenType" )
type Hand ¶
type Hand struct {
Direction []float64 `json:"direction"`
ID int `json:"id"`
PalmNormal []float64 `json:"palmNormal"`
PalmPosition []float64 `json:"palmPosition"`
PalmVelocity []float64 `json:"palmVelocity"`
R [][]float64 `json:"r"`
S float64 `json:"s"`
SphereCenter []float64 `json:"sphereCenter"`
SphereRadius float64 `json:"sphereRadius"`
StabilizedPalmPosition []float64 `json:"stabilizedPalmPosition"`
T []float64 `json:"t"`
TimeVisible float64 `json:"timeVisible"`
}
type InteractionBox ¶
type Pointable ¶
type Pointable struct {
Direction []float64 `json:"direction"`
HandID int `json:"handId"`
ID int `json:"id`
Length float64 `json:"length"`
StabilizedTipPosition []float64 `json:"stabilizedTipPosition"`
TimeVisible float64 `json:"timeVisible"`
TipPosition []float64 `json:"tipPosition"`
TipVelocity []float64 `json:"tipVelocity"`
Tool bool `json:"tool"`
TouchDistance float64 `json:"touchDistance"`
TouchZone TouchZone `json:"touchZone"`
}
Click to show internal directories.
Click to hide internal directories.