Commit 11b5ddde authored by Alexis Girault's avatar Alexis Girault
Browse files

ENH: Define Rotd as Eigen::AngleAxisd

parent ddcae651
......@@ -28,7 +28,6 @@
namespace imstk {
// 2D vector
using Vec2f = Eigen::Vector2f;
using Vec2d = Eigen::Vector2d;
......@@ -49,6 +48,10 @@ using VecNd = Eigen::VectorXd;
using Quatf = Eigen::Quaternionf;
using Quatd = Eigen::Quaterniond;
// Angle-Axis
using Rotf = Eigen::AngleAxisf;
using Rotd = Eigen::AngleAxisd;
// 3x3 Matrix
using Mat3f = Eigen::Matrix3f;
using Mat3d = Eigen::Matrix3d;
......
......@@ -105,9 +105,9 @@ VRPNDeviceClient::analogChangeHandler(void *userData, const _vrpn_ANALOGCB a)
if (a.num_channel > 3)
{
deviceClient->m_orientation =
Eigen::AngleAxisd(a.channel[3]*M_PI,Vec3d::UnitX())*
Eigen::AngleAxisd(a.channel[4]*M_PI,Vec3d::UnitY())*
Eigen::AngleAxisd(a.channel[5]*M_PI,Vec3d::UnitZ());
Rotd(a.channel[3]*M_PI,Vec3d::UnitX())*
Rotd(a.channel[4]*M_PI,Vec3d::UnitY())*
Rotd(a.channel[5]*M_PI,Vec3d::UnitZ());
//LOG(DEBUG) << "analog: orientation = " << deviceClient->m_orientation.matrix();
}
}
......
......@@ -61,7 +61,7 @@ Geometry::rotate(const Mat3d& r)
void
Geometry::rotate(const Vec3d& axis, const double& angle)
{
this->rotate(Quatd(Eigen::AngleAxisd(angle, axis)));
this->rotate(Quatd(Rotd(angle, axis)));
}
void
......@@ -126,7 +126,7 @@ Geometry::setOrientation(const Mat3d& orientation)
void
Geometry::setOrientation(const Vec3d& axis, const double& angle)
{
this->setOrientation(Quatd(Eigen::AngleAxisd(angle, axis)));
this->setOrientation(Quatd(Rotd(angle, axis)));
}
const double&
......
......@@ -98,7 +98,7 @@ RenderDelegate::setActorTransform(std::shared_ptr<Geometry>geom)
{
auto scaling = geom->getScaling();
auto quat = geom->getOrientation();
auto angleAxis = Eigen::AngleAxisd(quat);
auto angleAxis = Rotd(quat);
auto pos = geom->getPosition();
auto transform = vtkSmartPointer<vtkTransform>::New();
......
......@@ -74,7 +74,7 @@ Renderer::Renderer(std::shared_ptr<Scene> scene)
// Camera and camera actor
m_sceneVtkCamera = vtkSmartPointer<vtkCamera>::New();
// TODO: init vtkCamera based on imstkCamera
this->updateSceneCamera(scene->getCamera());
auto camActor = vtkSmartPointer<vtkCameraActor>::New();
camActor->SetCamera( m_sceneVtkCamera );
m_debugVtkActors.push_back( camActor );
......
......@@ -297,7 +297,7 @@ void testIsometricMap()
// Isometric Map
auto transform = imstk::RigidTransform3d::Identity();
transform.translate(imstk::Vec3d(0.0, 1.0, 0.0));
transform.rotate(Eigen::AngleAxisd(imstk::PI_4, imstk::Vec3d(0, 1.0, 0)));
transform.rotate(imstk::Rotd(imstk::PI_4, imstk::Vec3d(0, 1.0, 0)));
auto rigidMap = std::make_shared<imstk::IsometricMap>();
rigidMap->setMaster(sphereObj->getVisualGeometry());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment