Public Member Functions

GenSphere Class Reference

Search for all occurrences

Detailed Description

See also:
Class SimpleObject.

Description:
This class provides a method that is used to set the parameters of a sphere object. This allows the object to be created programmatically. All methods of this class are implemented by the system.

#include <simpobj.h>

Inheritance diagram for GenSphere:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void  SetParams (float rad, int segs, BOOL smooth=TRUE, BOOL genUV=TRUE, float hemi=0.0f, BOOL squash=FALSE, BOOL recenter=FALSE)=0

Member Function Documentation

virtual void SetParams ( float  rad,
int  segs,
BOOL  smooth = TRUE,
BOOL  genUV = TRUE,
float  hemi = 0.0f,
BOOL  squash = FALSE,
BOOL  recenter = FALSE 
) [pure virtual]
Remarks:
This method is used to set the parameter of the sphere object.
Parameters:
float rad

The radius.

int segs

The number of segments.

BOOL smooth=TRUE

Smoothing flag.

BOOL genUV=TRUE

Generate UV coordinates flag.

float hemi=0.0f

The hemisphere setting where 0.0 is a full sphere, 0.5 is a half sphere and 1.0 is nonexistent.

BOOL squash=FALSE

If TRUE the number of segments is kept constant when the sphere is a hemisphere. If FALSE the number of segments is truncated based on the hemisphere setting.

BOOL recenter=FALSE

If FALSE, the 'Base To Pivot' setting if off; otherwise it is on.
Sample Code:
The following code demonstrates the creation of the object and the setting of its parameters:

#include "simpobj.h"

GenSphere *gs = (GenSphere *)CreateInstance(GEOMOBJECT_CLASS_ID,

Class_ID(SPHERE_CLASS_ID,0));

gs->SetParams(10.0f/startcomment*rad*endcomment/, 24/startcomment*segs*endcomment/,

TRUE /startcomment*smooth*endcomment/, TRUE/startcomment*genUV*endcomment/);

GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere
GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere GenSphere