Moby
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Moby::HeightmapPrimitive Class Reference

Represents a heightmap with height zero on the xz plane (primitive can be transformed) More...

#include <HeightmapPrimitive.h>

Inheritance diagram for Moby::HeightmapPrimitive:
Moby::Primitive Moby::Base

Public Member Functions

 HeightmapPrimitive ()
 Initializes the heightmap primitive.
 
 HeightmapPrimitive (const Ravelin::Pose3d &T)
 Initializes the heightmap primitive.
 
virtual void set_pose (const Ravelin::Pose3d &T)
 Transforms the primitive.
 
virtual void get_vertices (boost::shared_ptr< const Ravelin::Pose3d > P, std::vector< Point3d > &vertices) const
 Get vertices corresponding to this primitive. More...
 
void get_vertices (BVPtr bv, boost::shared_ptr< const Ravelin::Pose3d > P, std::vector< Point3d > &vertices) const
 
virtual double calc_dist_and_normal (const Point3d &point, std::vector< Ravelin::Vector3d > &normals) const
 Finds the signed distance betwen the heightmap and a point.
 
virtual double calc_signed_dist (boost::shared_ptr< const Primitive > p, Point3d &pthis, Point3d &pp) const
 Computes the signed distance between this and another primitive.
 
double calc_signed_dist (boost::shared_ptr< const SpherePrimitive > s, Point3d &pthis, Point3d &psph) const
 
virtual Point3d get_supporting_point (const Ravelin::Vector3d &d) const
 Gets the supporting point.
 
virtual double calc_signed_dist (const Point3d &p) const
 Computes the signed distance of the given point from this primitive.
 
virtual osg::Node * create_visualization ()
 Computes the OSG visualization.
 
virtual boost::shared_ptr
< const IndexedTriArray
get_mesh (boost::shared_ptr< const Ravelin::Pose3d > P)
 Gets the mesh of the heightmap.
 
virtual void calc_mass_properties ()
 
virtual BVPtr get_BVH_root (CollisionGeometryPtr geom)
 Gets the BVH root for the heightmap.
 
virtual void load_from_xml (boost::shared_ptr< const XMLTree > node, std::map< std::string, BasePtr > &id_map)
 Implements Base::load_from_xml() for serialization.
 
virtual void save_to_xml (XMLTreePtr node, std::list< boost::shared_ptr< const Base > > &shared_objects) const
 Implements Base::save_to_xml() for serialization.
 
const Ravelin::MatrixNd & get_heights () const
 
double get_width () const
 
double get_depth () const
 
virtual double get_bounding_radius () const
 
- Public Member Functions inherited from Moby::Primitive
 Primitive ()
 Constructs a primitive under the identity transformation.
 
 Primitive (const Ravelin::Pose3d &T)
 
void update_visualization ()
 Updates the visualization on the primitive.
 
void set_mass (double mass)
 Sets the mass of this primitive. More...
 
void set_density (double density)
 Sets the density of this primitive.
 
void add_collision_geometry (CollisionGeometryPtr cg)
 Adds a collision geometry.
 
void remove_collision_geometry (CollisionGeometryPtr cg)
 Removes a collision geometry.
 
boost::shared_ptr< const
Ravelin::Pose3d > 
get_pose (CollisionGeometryPtr g) const
 Gets the pose of this primitive relative to a particular collision geometry.
 
virtual double calc_max_dist (double lin_cont, double ang_cont, double dist, const Ravelin::Vector3d &d0, const Ravelin::Vector3d &w0, boost::shared_ptr< const Ravelin::Pose3d > P)
 Computes the maximum distance by a point on the geometry.
 
virtual bool is_convex () const
 Determines whether this primitive is convex.
 
virtual osg::Node * get_visualization ()
 Gets the visualization for this primitive. More...
 
boost::shared_ptr< const
Ravelin::Pose3d > 
get_inertial_pose () const
 Gets the inertial frame of this primitive.
 
boost::shared_ptr< const
Ravelin::Pose3d > 
get_pose () const
 Gets the pose of this primitive.
 
const Ravelin::SpatialRBInertiad & get_inertia () const
 Gets the inertia for this primitive.
 
- Public Member Functions inherited from Moby::Base
 Base (const Base *b)
 

Protected Member Functions

virtual double calc_height (const Point3d &p) const
 Computes the height at a particular point.
 
void calc_gradient (const Point3d &p, double &gx, double &gz) const
 Computes the gradient at a particular point.
 

Protected Attributes

double _width
 width of the heightmap
 
double _depth
 depth of the heightmap
 
Ravelin::MatrixNd _heights
 
std::map< CollisionGeometryPtr,
boost::shared_ptr< OBB > > 
_obbs
 The bounding volumes for the heightmap.
 
- Protected Attributes inherited from Moby::Primitive
boost::shared_ptr
< Ravelin::Pose3d > 
_F
 The pose of this primitive (relative to the global frame)
 
boost::shared_ptr
< Ravelin::Pose3d > 
_jF
 The inertial pose of this primitive (relative to the global frame)
 
boost::shared_ptr< double > _density
 The density of this primitive.
 
Ravelin::SpatialRBInertiad _J
 The inertia of the primitive.
 
std::map< boost::weak_ptr
< CollisionGeometry >
, boost::shared_ptr
< Ravelin::Pose3d > > 
_cg_poses
 The poses of this primitive, relative to a collision geometry.
 
std::set< boost::shared_ptr
< Ravelin::Pose3d > > 
_poses
 The poses, relative to a particular collision geometry.
 

Friends

class CCD
 

Additional Inherited Members

- Static Public Member Functions inherited from Moby::Base
template<class T >
static boost::shared_ptr< T > clone (boost::shared_ptr< T > x)
 Static method for cloning a shared pointer.
 
- Public Attributes inherited from Moby::Base
boost::shared_ptr< void > userdata
 Any relevant userdata.
 
std::string id
 The unique ID for this object.
 

Detailed Description

Represents a heightmap with height zero on the xz plane (primitive can be transformed)

Member Function Documentation

virtual void Moby::HeightmapPrimitive::get_vertices ( boost::shared_ptr< const Ravelin::Pose3d >  P,
std::vector< Point3d > &  vertices 
) const
virtual

Get vertices corresponding to this primitive.

Gets the vertex indices from selected facets of an IndexedTriArray.

Parameters
tristhe triangle mesh
fselect_beginiterator to a container of type unsigned (facet indices)
fselect_enditerator to a container of type unsigned (facet indices)
outputbeginning iterator to a container of type Point3d; unique vertices are copied here on return
Returns
ending iterator to a container of type Point3d; unique vertices are copied here on return

Implements Moby::Primitive.

Referenced by create_visualization().


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