本文整理汇总了C++中wfmath::Vector::sqrMag方法的典型用法代码示例。如果您正苦于以下问题:C++ Vector::sqrMag方法的具体用法?C++ Vector::sqrMag怎么用?C++ Vector::sqrMag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wfmath::Vector
的用法示例。
在下文中一共展示了Vector::sqrMag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showEntityInfo
void InspectWidget::showEntityInfo(EmberEntity* entity)
{
Eris::Entity* parent = entity->getLocation();
std::stringstream ss;
ss.precision(4);
ss << "Name: " << entity->getName() << "\n";
ss << "Id: " << entity->getId() << "\n";
ss << "Parent: ";
if (parent) {
ss << parent->getName() << " (Id: " << parent->getId() << ")";
} else {
ss << "none";
}
ss << "\n";
if (entity->getPredictedPos().isValid()) {
ss << "PredPosition: " << entity->getPredictedPos() << "\n";
}
if (entity->getPosition().isValid()) {
ss << "Position: " << entity->getPosition() << "\n";
}
WFMath::Vector<3> velocity = entity->getPredictedVelocity();
if (velocity.isValid()) {
ss << "Velocity: " << velocity << ": " << sqrt(velocity.sqrMag()) << "\n";
}
if (entity->getOrientation().isValid()) {
ss << "Orientation: " << entity->getOrientation() << "\n";
}
if (entity->getBBox().isValid()) {
ss << "Boundingbox: " << entity->getBBox() << "\n";
}
ss << "Type: " << entity->getType()->getName() << "\n";
ss << "Attributes:\n";
ss << mAttributesString;
mInfo->setText(ss.str());
mChangedThisFrame = false;
}