# cShapeSphere Class Reference
[Scenegraph]

Implementation of a virtual sphere shape. More...

`#include <CShapeSphere.h>`

Inheritance diagram for cShapeSphere:

[legend]

List of all members.

## Public Member Functions
| cShapeSphere (const double &a_radius)
| Constructor of cShapeSphere.
virtual | ~cShapeSphere ()
| Destructor of cSphere.
virtual void | render (const int a_renderMode=0)
| Render object in OpenGL.
virtual void | updateBoundaryBox ()
| Update bounding box of current object.
virtual void | scaleObject (const cVector3d &a_scaleFactors)
| Object scaling.
virtual void | computeLocalInteraction (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN)
| Update the geometric relationship between the tool and the current object.
void | setRadius (double a_radius)
| Set radius of sphere.
double | getRadius ()
| Get radius of sphere.
## Protected Attributes
double | m_radius
| radius of sphere.

## Detailed Description

Implementation of a virtual sphere shape.

## Constructor & Destructor Documentation

cShapeSphere::cShapeSphere | ( | const double & | a_radius | ) |

Constructor of cShapeSphere.

Constructor of cShapeSphere.

Parameters:

  | a_radius | Radius of sphere

## Member Function Documentation

void cShapeSphere::computeLocalInteraction | ( | const cVector3d & | a_toolPos,
|  | const cVector3d & | a_toolVel,
|  | const unsigned int | a_IDN |
| ) |  |  | `[virtual]`

Update the geometric relationship between the tool and the current object.

From the position of the tool, search for the nearest point located at the surface of the current object. Decide if the point is located inside or outside of the object

Parameters:

  | a_toolPos | Position of the tool.
  | a_toolVel | Velocity of the tool.
  | a_IDN | Identification number of the force algorithm.

Reimplemented from cGenericObject.

void cShapeSphere::render | ( | const int | a_renderMode = `0` | ) | `[virtual]`

Render object in OpenGL.

Render sphere in OpenGL

Parameters:

  | a_renderMode | See cGenericObject::render()

Reimplemented from cGenericObject.

void cShapeSphere::scaleObject | ( | const cVector3d & | a_scaleFactors | ) | `[virtual]`

Object scaling.

Scale object of defined scale factor

Parameters:

  | a_scaleFactors | Scale factor

Reimplemented from cGenericObject.

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

- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/scenegraph/CShapeSphere.h
- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/scenegraph/CShapeSphere.cpp

CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.