本文整理汇总了C++中DevicePtr::setLocalRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ DevicePtr::setLocalRotation方法的具体用法?C++ DevicePtr::setLocalRotation怎么用?C++ DevicePtr::setLocalRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevicePtr
的用法示例。
在下文中一共展示了DevicePtr::setLocalRotation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readDeviceNode
void VRMLBodyLoaderImpl::readDeviceNode(LinkInfo& iLink, VRMLProtoInstance* deviceNode, const Affine3& T)
{
const string& typeName = deviceNode->proto->protoName;
if(isVerbose) putMessage(typeName + " node " + deviceNode->defName);
DeviceFactoryMap::iterator p = deviceFactories.find(typeName);
if(p == deviceFactories.end()){
os() << str(format("Sensor type %1% is not supported.\n") % typeName) << endl;
} else {
DeviceFactory& factory = p->second;
DevicePtr device = factory(deviceNode);
if(device){
device->setLink(iLink.link);
const Matrix3 RsT = iLink.link->Rs();
device->setLocalTranslation(RsT * (T * device->localTranslation()));
device->setLocalRotation(RsT * (T.linear() * device->localRotation()));
body->addDevice(device);
}
}
}
示例2: setSensor
void ColladaBodyLoaderImpl::setSensor(DaeNode* extNode, Link* link, Body& body)
{
DaeLink* nodeLink = static_cast<DaeLink*>(extNode);
DaeResultSensors* sensors = parser->findSensor(nodeLink->id);
if (sensors->size() <= 0) {
return;
}
// ForceSensor--------->force6d
// GyroSensor---------->no type(empty string)
// AccelerrationSensor->imu(unit sensor)
// VisionSensor-------->pin-hole-camera
for (DaeResultSensors::iterator iters = sensors->begin(); iters != sensors->end(); iters++) {
DaeSensor* sensor = *iters;
DevicePtr device = createSensor(sensor);
device->setLink(link);
device->setLocalTranslation(extNode->transform.translate + sensor->transform.translate);
device->setLocalRotation (extNode->transform.rotate.matrix() * sensor->transform.rotate.matrix());
body.addDevice(device);
}
}