Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何将参数转换为需要所有常量值的方法?_C++_Constants - Fatal编程技术网

C++ 如何将参数转换为需要所有常量值的方法?

C++ 如何将参数转换为需要所有常量值的方法?,c++,constants,C++,Constants,为了 此调用返回true,即success camera->set( cVector3d (1, 0.0, 3), // camera position (eye) cVector3d (0.0, 0.0, 0.0), // lookat position (target) cVector3d (-1.0, 0.0, 0.0)); // direction of the "up" vector); } 我没有收到任何错误,但是这个调

为了

此调用返回true,即success

camera->set( cVector3d (1, 0.0, 3),    // camera position (eye)
        cVector3d (0.0, 0.0, 0.0),    // lookat position (target)
        cVector3d (-1.0, 0.0, 0.0));   // direction of the "up" vector);
    }
我没有收到任何错误,但是这个调用返回false,这是因为无法设置摄像机的新位置,为什么

 camera->set( cVector3d(toolPos.x,toolPos.y,toolPos.z),
              cVector3d(toolPos.x,toolPos.y,toolPos.z),
              cVector3d (1.0, 0.0, 0.0)); 
当我使用断点检查时,工具是一个cVector3d变量,具有有效值 cVector3d的定义是

cVector3d (const double a_x, const double a_y, const double a_z)

构造函数通过传递一个double来初始化向量

您的第一个向量(相机位置)和第二个向量(注视位置)具有相同的值。设置新位置的算法无法确定相机所面对的方向,因为没有从
眼睛
注视
的方向。只需将
lookat position
eye
移动到您想看的方向。

这不意味着什么?它怎么不起作用?编译失败?seg故障?
cVector3d (const double a_x, const double a_y, const double a_z)