Jet  v1.3.3
transform3.h
Go to the documentation of this file.
1 // Copyright (c) 2018 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef INCLUDE_JET_TRANSFORM3_H_
8 #define INCLUDE_JET_TRANSFORM3_H_
9 
10 #include <jet/bounding_box3.h>
11 #include <jet/quaternion.h>
12 #include <jet/ray3.h>
13 #include <jet/vector3.h>
14 
15 namespace jet {
16 
20 class Transform3 {
21  public:
24 
27 
29  const Vector3D& translation() const;
30 
33 
35  const QuaternionD& orientation() const;
36 
39 
41  Vector3D toLocal(const Vector3D& pointInWorld) const;
42 
44  Vector3D toLocalDirection(const Vector3D& dirInWorld) const;
45 
47  Ray3D toLocal(const Ray3D& rayInWorld) const;
48 
50  BoundingBox3D toLocal(const BoundingBox3D& bboxInWorld) const;
51 
53  Vector3D toWorld(const Vector3D& pointInLocal) const;
54 
56  Vector3D toWorldDirection(const Vector3D& dirInLocal) const;
57 
59  Ray3D toWorld(const Ray3D& rayInLocal) const;
60 
62  BoundingBox3D toWorld(const BoundingBox3D& bboxInLocal) const;
63 
64  private:
65  Vector3D _translation;
66  QuaternionD _orientation;
67  Matrix3x3D _orientationMat3;
68  Matrix3x3D _inverseOrientationMat3;
69 };
70 
71 } // namespace jet
72 
73 #include "detail/transform3-inl.h"
74 
75 #endif // INCLUDE_JET_TRANSFORM3_H_
jet::Transform3::toLocal
Ray3D toLocal(const Ray3D &rayInWorld) const
Transforms a ray in world coordinate to the local frame.
jet::Transform3::setTranslation
void setTranslation(const Vector3D &translation)
Sets the traslation.
jet::Transform3::orientation
const QuaternionD & orientation() const
Returns the orientation.
jet::Transform3::toWorld
Vector3D toWorld(const Vector3D &pointInLocal) const
Transforms a point in local space to the world coordinate.
jet::Transform3::translation
const Vector3D & translation() const
Returns the translation.
jet::BoundingBox< T, 3 >
3-D axis-aligned bounding box class.
Definition: bounding_box3.h:41
quaternion.h
jet::Transform3::setOrientation
void setOrientation(const QuaternionD &orientation)
Sets the orientation.
jet::Transform3::toWorld
BoundingBox3D toWorld(const BoundingBox3D &bboxInLocal) const
Transforms a bounding box in local space to the world coordinate.
jet::Matrix< T, 3, 3 >
3-D matrix class.
Definition: matrix3x3.h:28
jet::Transform3::toWorld
Ray3D toWorld(const Ray3D &rayInLocal) const
Transforms a ray in local space to the world coordinate.
jet::Transform3::Transform3
Transform3()
Constructs identity transform.
jet::Quaternion< double >
jet
Definition: advection_solver2.h:18
jet::Transform3::toLocal
Vector3D toLocal(const Vector3D &pointInWorld) const
Transforms a point in world coordinate to the local frame.
ray3.h
jet::Transform3::toLocalDirection
Vector3D toLocalDirection(const Vector3D &dirInWorld) const
Transforms a direction in world coordinate to the local frame.
jet::Ray< T, 3 >
Class for 2-D ray.
Definition: ray3.h:21
vector3.h
jet::Transform3::Transform3
Transform3(const Vector3D &translation, const QuaternionD &orientation)
Constructs a transform with translation and orientation.
jet::Vector< T, 3 >
3-D vector class.
Definition: vector3.h:25
jet::Transform3::toWorldDirection
Vector3D toWorldDirection(const Vector3D &dirInLocal) const
Transforms a direction in local space to the world coordinate.
jet::Transform3::toLocal
BoundingBox3D toLocal(const BoundingBox3D &bboxInWorld) const
Transforms a bounding box in world coordinate to the local frame.
bounding_box3.h
jet::Transform3
Represents 3-D rigid body transform.
Definition: transform3.h:20