KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
kjb::Rigid_object Class Referenceabstract

#include <gr_rigid_object.h>

Inheritance diagram for kjb::Rigid_object:
kjb::Transformable kjb::Cloneable kjb::Parametric_camera_gl_interface kjb::Polymesh kjb::Frustum kjb::Parapiped kjb::Triangular_mesh

Public Member Functions

 Rigid_object ()
 
 Rigid_object (const Rigid_object &ro)
 
virtual Rigid_objectoperator= (const Rigid_object &src)
 
virtual ~Rigid_object ()
 
virtual void swap (Self &other)
 
virtual void translate (double dx, double dy, double dz)
 Translates this rigid object. More...
 
virtual void rotate (double dpitch, double dyaw, double droll)
 rotate this object around its x-axis by dpitch, the y-axis by dyaw, and its z-axis by droll (in this order, starting from the object's current position) More...
 
virtual void compute_new_euler_angles_on_rotations (double dpitch, double dyaw, double droll, kjb::Vector &angles) const
 computes the new values for the object's euler angles, after a rotation of dpitch around the object's x-axis, a rotation of dyaw around the object's y axis, and a rotation of droll around the object's z axis (in this order, starting from the object's current position). The state of this rigid object is not changed More...
 
virtual void set_rotations (double pitch, double yaw, double roll)
 rotate this object so that its pitch, yaw and roll match the input values More...
 
virtual void set_rotations_and_translate (double pitch, double yaw, double roll, double dx, double dy, double dz)
 rotate this object so that its pitch, yaw and roll match the input values, and translates it More...
 
virtual Rigid_objectclone () const =0
 Processes an Option from program command-line arguments. More...
 
virtual void transform (const kjb::Matrix &M)=0
 
const Matrixget_rotations () const
 Returns the current transformation matrix, that is used to store the rotation to be applied to the object. More...
 
const Vectorget_euler_angles () const
 returns vector [pitch, yaw, roll] More...
 
void set_rotation_mode (kjb::Quaternion::Euler_mode imode)
 
const kjb::Quaternionget_orientation () const
 returns the quaternion defining this object's orientation More...
 
void set_orientation (const Quaternion &orientation)
 sets the orientation of this object from an input quaternion More...
 
- Public Member Functions inherited from kjb::Transformable
virtual ~Transformable ()
 Deletes this Transformable. More...
 
virtual ~Transformable ()
 Deletes this Transformable_d. More...
 
- Public Member Functions inherited from kjb::Cloneable
virtual ~Cloneable ()
 Deletes this Cloneable. More...
 

Detailed Description

details

Methods of this class update the gl modelview and projection parameters so that they reflect the changes in the camera extrinsic and intrinsic parameters

Constructor & Destructor Documentation

kjb::Rigid_object::Rigid_object ( )
inline
Rigid_object::Rigid_object ( const Rigid_object ro)
Parameters
roRigid_object to copy into this one.
virtual kjb::Rigid_object::~Rigid_object ( )
inlinevirtual

Member Function Documentation

virtual Rigid_object* kjb::Rigid_object::clone ( ) const
pure virtual

Processes an Option from program command-line arguments.

Implements kjb::Cloneable.

Implemented in kjb::Parametric_camera_gl_interface, kjb::Triangular_mesh, kjb::Parapiped, kjb::Frustum, and kjb::Polymesh.

void Rigid_object::compute_new_euler_angles_on_rotations ( double  dpitch,
double  dyaw,
double  droll,
kjb::Vector angles 
) const
virtual

computes the new values for the object's euler angles, after a rotation of dpitch around the object's x-axis, a rotation of dyaw around the object's y axis, and a rotation of droll around the object's z axis (in this order, starting from the object's current position). The state of this rigid object is not changed

computes the new values for the object's euler angles, after a rotation of dpitch around the object's x-axis, a rotation of dyaw around the object's y axis, and a rotation of droll around the object's z axis (in this order). The state of this rigid object is not changed

Parameters
dpitchthe amount of rotation around the object's x-axis
dyawthe amount of rotation around the object's y-axis
drollthe amount of rotation around the object's z-axis
angleswill contain the new Euler angles (pitch, yaw, roll)
const Vector& kjb::Rigid_object::get_euler_angles ( ) const
inline

returns vector [pitch, yaw, roll]

const kjb::Quaternion& kjb::Rigid_object::get_orientation ( ) const
inline

returns the quaternion defining this object's orientation

const Matrix& kjb::Rigid_object::get_rotations ( ) const
inline

Returns the current transformation matrix, that is used to store the rotation to be applied to the object.

Rigid_object & Rigid_object::operator= ( const Rigid_object src)
virtual
Parameters
srcRigid_object to be assigned to this one
void Rigid_object::rotate ( double  dpitch,
double  dyaw,
double  droll 
)
virtual

rotate this object around its x-axis by dpitch, the y-axis by dyaw, and its z-axis by droll (in this order, starting from the object's current position)

Rotates this object around its x-axis by the input angle dpitch, around its y-axis by the input angle dyaw, around its z-axis by the input angle droll. The rotations will add to the current state of the object, ie if the inputs are dpitch = 0.1, dyaw =0.0 and, droll = 0.2, the object will be rotated around the object's x-axis by dpitch, and then around the object's z axis (that moved after the first rotation by dpitch) by 0.2

Parameters
dpitchthe amount of rotation around the object's x-axis
dyawthe amount of rotation around the object's y-axis
drollthe amount of rotation around the object's z-axis

Reimplemented in kjb::Polymesh.

void Rigid_object::set_orientation ( const Quaternion orientation)

sets the orientation of this object from an input quaternion

void kjb::Rigid_object::set_rotation_mode ( kjb::Quaternion::Euler_mode  imode)
inline
void Rigid_object::set_rotations ( double  pitch,
double  yaw,
double  roll 
)
virtual

rotate this object so that its pitch, yaw and roll match the input values

Rotates this rigid object so that the amount of rotation around its x-axis will match the input pitch, the amount of rotation around its y-axis will match the input yaw and the amount of rotation around its z-axis will match the input roll. The rotations are done in this order starting from a configuration where the object is aligned with the world's axis

Parameters
pitchThe desired amount of rotation around the object's x axis
yawThe desired amount of rotation around the object's y axis
rollThe desired amount of rotation around the object's z axis
void Rigid_object::set_rotations_and_translate ( double  pitch,
double  yaw,
double  roll,
double  dx,
double  dy,
double  dz 
)
virtual

rotate this object so that its pitch, yaw and roll match the input values, and translates it

Rotates this rigid object around its x axis by the input pitch angle, then around the object's y axis by the input yaw angle, and last around the object's z axis by the input roll angle. Rotations are performed IN THIS ORDER, consider this if the resulting rotations are not as you would expect (rotation is not transitive). Last, the object is translated along the world's x-axis by dx, along the world's y axis by dy, and along the world's z axis by dz (The object is translated by these amounts starting from its current location). The method is provided to set rotations and translate in an efficient way, by avoiding a matrix multiplication

Parameters
pitchThe desired amount of rotation around the object's x axis
yawThe desired amount of rotation around the object's y axis
rollThe desired amount of rotation around the object's z axis
dxthe amount of translation along the world's x-axis
dythe amount of translation along the world's y-axis
dzthe amount of translation along the world's z-axis
virtual void kjb::Rigid_object::swap ( Self other)
inlinevirtual

Swap contents with another Perspective_camera. This is implemented to prevent deep copies, which allows it to run much more quickly than: Type tmp = b; b = a; a = tmp;

virtual void kjb::Rigid_object::transform ( const kjb::Matrix M)
pure virtual

@ brief Transforms this rigid object by using the input 3D transformation matrix, in homogeneous coordinates

Implements kjb::Transformable.

Implemented in kjb::Polymesh, kjb::Parapiped, and kjb::Frustum.

void Rigid_object::translate ( double  dx,
double  dy,
double  dz 
)
virtual

Translates this rigid object.

Translates this rigid object

Parameters
dxThe amount of translation along the world's x axis
dyThe amount of translation along the world's y axis
dzThe amount of translation along the world's z axis

Reimplemented in kjb::Polymesh.


The documentation for this class was generated from the following files: