SoPhysicsCylinder Class Reference
[libipsa classesPhysic Classes]

Defines a physics object with the properties of a cylinder. More...

#include <SoPhysicsCylinder.h>

Inheritance diagram for SoPhysicsCylinder:

Inheritance graph
[legend]
Collaboration diagram for SoPhysicsCylinder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SoPhysicsCylinder (const SbString &nodeName="")

Static Public Member Functions

static void initClass ()

Public Attributes

SoSFFloat height
SoSFFloat radius

Protected Member Functions

virtual dMass getInitialMass ()
virtual void updateDependentObjects ()

Private Member Functions

 SO_KIT_HEADER (SoPhysicsCylinder)


Detailed Description

Defines a physics object with the properties of a cylinder.

This physics object is scaleable.

Cylinder.png

A cylinder

Definition at line 31 of file SoPhysicsCylinder.h.


Constructor & Destructor Documentation

SoPhysicsCylinder::SoPhysicsCylinder ( const SbString &  nodeName = ""  ) 

The constructor of SoPhysicsCylinder.

Parameters:
nodeName name of the node in the Inventor scenegraph

We need to rotate the coin appearance for the cylinder because open inventor aligns cylinders along the Y-axis while ODE aligns cylinders along z-axis. So we add a corrective rotation for the visualisation here.

Definition at line 63 of file SoPhysicsCylinder.cpp.

References SoPhysics::CoinRefTransform, height, radius, and SoPhysics::updateDependentObjectsTrigger.


Member Function Documentation

dMass SoPhysicsCylinder::getInitialMass (  )  [protected, virtual]

This method returns the mass of the cylinder object. The mass of the object that will be returned is calculated by taking care of changes in scaling.

Returns:
mass: the mass of the cylinder.

Reimplemented from SoPhysics.

Reimplemented in SoPhysicsCapsule.

Definition at line 97 of file SoPhysicsCylinder.cpp.

References height, SoPhysics::inertia, SoPhysics::mass, radius, and SoPhysics::scale.

void SoPhysicsCylinder::initClass (  )  [static]

Initialises the class and it's type id variables.

Reimplemented from SoPhysics.

Reimplemented in SoPhysicsCapsule.

Definition at line 53 of file SoPhysicsCylinder.cpp.

SoPhysicsCylinder::SO_KIT_HEADER ( SoPhysicsCylinder   )  [private]

void SoPhysicsCylinder::updateDependentObjects (  )  [protected, virtual]

If one of the fields of the object changes these changes are propagated to the collision and visualisation shape if they are of the same type as the physics object. If the field SoPhysics::AUTO_UPDATE_COLLISION_SHAPE is set to FALSE the collision shape doesn't get uptdated.

Reimplemented from SoPhysics.

Reimplemented in SoPhysicsCapsule.

Definition at line 133 of file SoPhysicsCylinder.cpp.

References SoPhysics::AUTO_UPDATE_COLLISION_SHAPE, SoCollisionShapeCylinder::height, height, SoCollisionShapeCylinder::radius, and radius.


Member Data Documentation

The height of the cylinder (default = 1.0f).

Definition at line 42 of file SoPhysicsCylinder.h.

Referenced by getInitialMass(), SoPhysicsCylinder(), and updateDependentObjects().

The radius of the cylinder (default = 1.0f).

Definition at line 41 of file SoPhysicsCylinder.h.

Referenced by getInitialMass(), SoPhysicsCylinder(), and updateDependentObjects().


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

Get IPSA - Inventor Physics Simulation API at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Sat Mar 10 20:00:21 2012 for IPSA by  doxygen 1.5.8