Physsim::Cylinder Class Reference

Defines a cylinder primitive. More...

#include <Cylinder.h>

Inheritance diagram for Physsim::Cylinder:

Physsim::Primitive Physsim::Base List of all members.

Public Member Functions

 Cylinder ()
 Constructs a cylinder centered at the origin, with the longitudinal axis aligned with the y-axis, radius 1.0, height 1.0, and recursion level of 3.
 Cylinder (Real radius, Real height)
 Constructs a cylinder along the y-axis with specified radius and height, centered at the origin, with recursion level of 3.
 Cylinder (Real radius, Real height, unsigned recursion_level, const Matrix4 &T)
 Constructs a cylinder along the y-axis and centered at the origin with specified, radius, height, recursion level.
 Cylinder (Real radius, Real height, const Matrix4 &T)
 Constructs a cylinder along the y-axis with specified radius and height, centered at the origin, with recursion level of 3.
void set_radius (Real radius)
 Sets the radius for this cylinder.
void set_height (Real height)
 Sets the height for this cylinder.
void set_recursion_level (unsigned level)
 Sets the recursion level for this cylinder.
virtual void load_from_xml (XMLTreeConstPtr node, std::map< std::string, BasePtr > &id_map)
 Implements Base::load_from_xml() for serialization.
virtual void save_to_xml (XMLTreePtr node, std::list< BaseConstPtr > &shared_objects) const
 Implements Base::save_to_xml() for serialization.
virtual Matrix3 calc_inertia ()
 Gets the inertia matrix for this cylinder with current transform applied.
virtual Real calc_mass ()
 Gets the mass for this cylinder, computing it if necessary.
virtual SoNode * create_visualization ()
 Creates the visualization for this primitive.
Real get_radius () const
 Gets the radius of this cylinder.
Real get_height () const
 Gets the height of this cylinder.
unsigned get_recursion_level () const
 Gets the recursion level for the cylinder for collision checking.
virtual Vector3 calc_com ()
 Calculates the center-of-mass for this cylinder.

Detailed Description

Defines a cylinder primitive.


Member Function Documentation

void Cylinder::set_radius ( Real  radius  ) 

Sets the radius for this cylinder.

Note:
forces redetermination of the mesh

void Cylinder::set_height ( Real  height  ) 

Sets the height for this cylinder.

Note:
forces redetermination of the mesh

void Cylinder::set_recursion_level ( unsigned  recursion  ) 

Sets the recursion level for this cylinder.

Note:
forces redetermination of the mesh

unsigned Physsim::Cylinder::get_recursion_level (  )  const [inline]

Gets the recursion level for the cylinder for collision checking.

Higher recursion levels result in better approximations to a true cylinder, but increase the number of triangles used in the resulting mesh by a factor of 2 for each level increase.


The documentation for this class was generated from the following files:
Generated on Wed Oct 24 14:54:22 2007 for Physsim by  doxygen 1.5.1