本文整理汇总了C++中leap::Pointable::direction方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointable::direction方法的具体用法?C++ Pointable::direction怎么用?C++ Pointable::direction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类leap::Pointable
的用法示例。
在下文中一共展示了Pointable::direction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: direction
static VALUE direction(VALUE self)
{
Leap::Pointable * pointer;
Leap::Vector * vector;
Data_Get_Struct(self, Leap::Pointable, pointer);
vector = new Leap::Vector(pointer->direction());
return WrapVector(vector);
}
示例2: convertPointableRotation
void convertPointableRotation(const Leap::Pointable& pointable, MatrixF& outRotation)
{
// We need to convert from Motion coordinates to
// Torque coordinates. The conversion is:
//
// Motion Torque
// a b c a b c a -c b
// d e f --> -g -h -i --> -g i -h
// g h i d e f d -f e
Leap::Vector pointableFront = -pointable.direction();
Leap::Vector pointableRight = Leap::Vector::up().cross(pointableFront);
Leap::Vector pointableUp = pointableFront.cross(pointableRight);
outRotation.setColumn(0, Point4F( pointableRight.x, -pointableRight.z, pointableRight.y, 0.0f));
outRotation.setColumn(1, Point4F( -pointableFront.x, pointableFront.z, -pointableFront.y, 0.0f));
outRotation.setColumn(2, Point4F( pointableUp.x, -pointableUp.z, pointableUp.y, 0.0f));
outRotation.setPosition(Point3F::Zero);
}