nstate.cxx
---
...
/
*-----------------------------------------------------------------------
|
|
|
ChooseJointType |
| - Decides which type of joint to
draw |
|
|
-----------------------------------------------------------------------
*/
#define BLUE_MOON 153
int
NORMAL_STATE::ChooseJointType( )
{
switch( jointStyle ) {
case ELBOWS:
return ELBOW_JOINT;
case BALLS:
return BALL_JOINT;
case EITHER:
// draw a teapot once in a blue moon
if( ss_iRand(1000) == BLUE_MOON )
return( TEAPOT );
default:
// otherwise an elbow or a ball (1/3 ball)
if( !ss_iRand(3) )
return BALL_JOINT;
else
return ELBOW_JOINT;
}
}