本文整理汇总了Java中com.leapmotion.leap.Hand.palmNormal方法的典型用法代码示例。如果您正苦于以下问题:Java Hand.palmNormal方法的具体用法?Java Hand.palmNormal怎么用?Java Hand.palmNormal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.leapmotion.leap.Hand
的用法示例。
在下文中一共展示了Hand.palmNormal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDetectionData
import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
public DetectionData getDetectionData(Hand hand)
{
// Get the hand's normal vector and direction
Vector normal = hand.palmNormal();
Vector direction = hand.direction();
float pitch = ((Double) Math.toDegrees(direction.pitch())).floatValue()
/ MAX_PITCH;
float roll = ((Double) Math.toDegrees(normal.roll())).floatValue()
/ MAX_ROLL;
float yaw = ((Double) Math.toDegrees(direction.yaw())).floatValue()
/ MAX_YAW;
float height = hand.palmPosition().getY() / MAX_HEIGHT;
return new DetectionData(roll, pitch, yaw, height);
}
示例2: HandShape
import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
/**
* Constructs a hand shape from the Hand object
*
* @param hand
* the hand to construct the hand shape from
*/
public HandShape(Hand hand) {
if (hand.isLeft()) {
this.data.handSide = LEFT;
} else {
this.data.handSide = RIGHT;
}
this.data.fingerPositions = new Vector[hand.fingers().count()];
for (int i = 0; i < data.fingerPositions.length; i++) {
data.fingerPositions[i] = hand.fingers().get(i).tipPosition();
}
this.data.palmLocation = hand.palmPosition();
// this.data.handBasis = hand.basis();
this.data.palmDirection = hand.palmNormal();
}
示例3: mapLeapHandData
import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
private LeapMotion2.Hand mapLeapHandData(Hand lh) {
LeapMotion2.Hand mrlHand = new LeapMotion2.Hand();
// process the normal
Vector palmNormal = lh.palmNormal();
mrlHand.palmNormalX = palmNormal.getX();
mrlHand.palmNormalY = palmNormal.getY();
mrlHand.palmNormalZ = palmNormal.getZ();
// handle the fingers.
for (Finger.Type t : Finger.Type.values()) {
Finger f = lh.fingers().get(t.ordinal());
double angle = computeAngleDegrees(f, palmNormal);
if (t.equals(Finger.Type.TYPE_INDEX))
mrlHand.index = angle;
else if (t.equals(Finger.Type.TYPE_MIDDLE))
mrlHand.middle = angle;
else if (t.equals(Finger.Type.TYPE_RING))
mrlHand.ring = angle;
else if (t.equals(Finger.Type.TYPE_PINKY))
mrlHand.pinky = angle;
else if (t.equals(Finger.Type.TYPE_THUMB))
mrlHand.thumb = angle;
else
log.warn("Unknown finger! eek..");
}
return mrlHand;
}
示例4: HandObj
import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
public HandObj(Hand h, FrameObj f, ControllerObj controller) {
this.controller = controller;
//fingerList = new FingerListObj(h.fingers());
//pointableList = new PointableListObj(h.pointables());
arm = new ArmObj(h.arm());
confidence = h.confidence();
direction = h.direction();
//elbow
frame = f;
grabStrength = h.grabStrength();
id = h.id();
palmNormal = h.palmNormal();
palmPosition = h.palmPosition();
palmVelocity = h.palmVelocity();
palmWidth = h.palmWidth();
pinchStrength = h.pinchStrength();
//r
//s
sphereCenter = h.sphereCenter();
sphereRadius = h.sphereRadius();
stabilizedPalmPosition = h.stabilizedPalmPosition();
//t
timeVisible = h.timeVisible();
if (h.isLeft()) {
type = "left";
} else {
type = "right";
}
wrist = h.wristPosition();
}
示例5: mapLeapHandData
import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
private LeapHand mapLeapHandData(Hand lh) {
LeapHand mrlHand = new LeapHand();
// process the normal
Vector palmNormal = lh.palmNormal();
mrlHand.palmNormalX = palmNormal.getX();
mrlHand.palmNormalY = palmNormal.getY();
mrlHand.palmNormalZ = palmNormal.getZ();
mrlHand.posX = lh.arm().center().getX();
mrlHand.posY = lh.arm().center().getY();
mrlHand.posZ = lh.arm().center().getZ();
// handle the fingers.
for (Finger.Type t : Finger.Type.values()) {
Finger f = lh.fingers().get(t.ordinal());
int angle = (int) computeAngleDegrees(f, palmNormal);
if (t.equals(Finger.Type.TYPE_INDEX))
mrlHand.index = angle;
else if (t.equals(Finger.Type.TYPE_MIDDLE))
mrlHand.middle = angle;
else if (t.equals(Finger.Type.TYPE_RING))
mrlHand.ring = angle;
else if (t.equals(Finger.Type.TYPE_PINKY))
mrlHand.pinky = angle;
else if (t.equals(Finger.Type.TYPE_THUMB))
mrlHand.thumb = angle;
else
log.warn("Unknown finger! eek..");
}
return mrlHand;
}