コード例 #1
0
ファイル: transform3d.cpp プロジェクト: DimitarBabov/QT_tests
// Qt Streams
QDebug operator<<(QDebug dbg, const Transform3D &transform)
{
  dbg << "Transform3D\n{\n";
  dbg << "Position: <" << transform.translation().x() << ", " << transform.translation().y() << ", " << transform.translation().z() << ">\n";
  dbg << "Scale: <" << transform.scale().x() << ", " << transform.scale().y() << ", " << transform.scale().z() << ">\n";
  dbg << "Rotation: <" << transform.rotation().x() << ", " << transform.rotation().y() << ", " << transform.rotation().z() << " | " << transform.rotation().scalar() << ">\n}";
  return dbg;
}
コード例 #2
0
void DebugAttachmentSystem::updateSphere(
    DebugSphereInstance &               sphere,
    const std::shared_ptr<Attachment> & attachment,
    const Transform3D &                 transform)
{
    sphere.setTransform(Transform3D::fromPose(attachment->worldPose()));
    sphere.setColor({0.3f, 1.0f, 0.3});
    sphere.setVisible(false);
    sphere.setRadius(transform.scale());
}
コード例 #3
0
ファイル: Transform3D.cpp プロジェクト: mrzzzrm/Deliberation2
Transform3D Transform3D::interpolated(const Transform3D & other, float v) const
{
    Transform3D result;

    result.setOrientation(glm::slerp(m_orientation, other.orientation(), v));
    result.setPosition(glm::mix(m_position, other.position(), v));
    result.setScale(glm::mix(m_scale, other.scale(), v));
    result.setCenter(glm::mix(m_center, other.center(), v));

    return result;
}
コード例 #4
0
ファイル: ImGui.cpp プロジェクト: mrzzzrm/deliberation
void ImGuiProperty(const Transform3D &transform3D) {
    auto position = transform3D.position();
    auto center = transform3D.center();
    auto scale = transform3D.scale();
    auto orientation = transform3D.orientation();

    ImGui::InputFloat3("Position", &position[0]);
    ImGui::InputFloat3("Center", &center[0]);
    ImGui::InputFloat("Scale", &scale);
    ImGui::InputFloat4("Orientation", &orientation[0]);
}
コード例 #5
0
void DebugAttachmentSystem::updatePose(
    DebugPoseInstance &                 pose,
    const std::shared_ptr<Attachment> & attachment,
    const Transform3D &                 transform)
{
    auto transform2 = transform;

    transform2.setScale(transform.scale() * 20.0f);
    pose.setTransform(transform);
    pose.setVisible(true);
}
コード例 #6
0
ファイル: ImGui.cpp プロジェクト: mrzzzrm/deliberation
void ImGuiProperty(Transform3D &transform3D) {
    auto position = transform3D.position();
    auto center = transform3D.center();
    auto scale = transform3D.scale();
    auto orientation = transform3D.orientation();

    if (ImGui::InputFloat3("Position", &position[0]))
        transform3D.setPosition(position);
    if (ImGui::InputFloat3("Center", &center[0]))
        transform3D.setCenter(position);
    if (ImGui::InputFloat("Scale", &scale)) transform3D.setScale(scale);
    if (ImGui::InputFloat4("Orientation", &orientation[0]))
        transform3D.setOrientation(orientation);
}
コード例 #7
0
ファイル: cxTransform3D.cpp プロジェクト: normit-nav/CustusX
/**Create a transform representing a scale in x,y,z
 */
Transform3D createTransformScale(const Vector3D& scale_)
{
	Transform3D retval = Transform3D::Identity();
	retval.scale(scale_);
	return retval;
}