home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn 3D Graphics Programming on the PC
/
Learn_3D_Graphics_Programming_on_the_PC_Ferraro.iso
/
rwdos
/
rolltype.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-15
|
6KB
|
168 lines
#ifndef ROLLTYPE_H
#define ROLLTYPE_H
/**********************************************************************
*
* File : rolltype.h
*
* Abstract : Interface to the data type encapsulating an
* inidividual rollercoaster.
*
* This file is a product of Criterion Software Ltd.
*
* This file is provided as is with no warranties of any kind and is
* provided without any obligation on Criterion Software Ltd. or
* Canon Inc. to assist in its use or modification.
*
* Criterion Software Ltd. will not, under any
* circumstances, be liable for any lost revenue or other damages arising
* from the use of this file.
*
* Copyright (c) 1994 Criterion Software Ltd.
* All Rights Reserved.
*
* RenderWare is a trademark of Canon Inc.
*
**********************************************************************/
/**********************************************************************
*
* Application constants.
*
**********************************************************************/
#ifndef M_PI
#define M_PI 3.141592654
#endif /* M_PI */
#define M_2PI 6.283185308
/*
* Tags used to identify the different clumps in the coaster's scene.
*/
#define CONTROLPOINTTAG 1
#define GROUNDPLANETAG 2
#define TRACKTAG 3
#define CARTAG 4
/*
* Default number of control points in the coaster's spline.
*/
#define DEFAULTNUMCONTROLPOINTS 10
/*
* Default radius for the default spline circle.
*/
#define DEFAULTSPLINERADIUS CREAL(1.0)
/*
* Default number of samples to take of the spline in generating
* the coaster's clump.
*/
#define DEFAULTNUMSPLINESAMPLES 100
/*
* Default ground level (beneath which the spline path cannot dip).
*/
#define DEFAULTGROUNDLEVEL CREAL(0.05)
/*
* Default sky level (above which the camera cannot climb).
*/
#define DEFAULTSKYLEVEL CREAL(3.0)
/*
* Default minimum height of a spline control point.
*/
#define DEFAULTMINCONTROLPOINTHEIGHT CREAL(0.1)
/*
* Default maximum height of a spline control point.
*/
#define DEFAULTMAXCONTROLPOINTHEIGHT CREAL(2.0)
/*
* Spline tracking parameters.
*/
#define MINSPLINEDELTA CREAL(0.002)
#define DEFAULTSPLINEDELTA CREAL(0.004)
#define MAXSPLINEDELTA CREAL(0.010)
#define SPLINEDELTAACCELERATION CREAL(0.0005)
#define SPLINEDELTADECCELERATION CREAL(0.0006)
/**********************************************************************
*
* Type definitions.
*
**********************************************************************/
/*
* The rollercoaster data type.
*/
typedef struct
{
RwScene *scene;
RwScene *holdingScene;
RwLight *light;
RwSpline *spline;
RwClump *controlPointClumps[DEFAULTNUMCONTROLPOINTS];
RwClump *coasterClump;
RwClump *groundPlaneClump;
RwClump *carClump;
RwV3d elevationPosition;
RwV3d planPosition;
RwReal t;
RwReal tDelta;
RwV3d tAt;
RwV3d tUp;
RwV3d tRight;
RwV3d tPosition;
char filename[_MAX_PATH];
char description[20];
} RollerCoasterType;
/**********************************************************************
*
* Macro function.
*
**********************************************************************/
#define COASTERCONTROLPOINT(coaster, index) \
((coaster)->controlPointClumps[(index) - 1])
/**********************************************************************
*
* Functions.
*
**********************************************************************/
/**********************************************************************/
extern RollerCoasterType *CreateRollerCoaster(void);
extern RollerCoasterType *ReadRollerCoaster(char* filename);
extern void DestroyRollerCoaster(RollerCoasterType *coaster);
extern RwBool WriteRollerCoaster(RollerCoasterType *coaster, char* filename);
extern void SwitchToCoasterRideMode(RollerCoasterType *coaster);
extern void SwitchToCoasterEditMode(RollerCoasterType *coaster);
extern int IsCoasterControlPointPicked(RollerCoasterType *coaster, RwCamera *camera, int x, int y);
extern void TransformCoasterControlPoint(RollerCoasterType *coaster, int index, RwMatrix4d *matrix);
extern RwBool UpdateCoasterClump(RollerCoasterType *coaster);
extern void UpdateViewParameters(RollerCoasterType *coaster);
extern void TrackCameraToCoaster(RollerCoasterType *coaster, RwCamera *camera);
extern void UpdateCoasterVelocity(RollerCoasterType *coaster);
extern void EnableCoasterCar(RollerCoasterType *coaster);
extern void DisableCoasterCar(RollerCoasterType *coaster);
extern void EnableCoasterControlPoints(RollerCoasterType *coaster);
extern void DisableCoasterControlPoints(RollerCoasterType *coaster);
extern RwBool LoadTextures(RwBool setPalette);
extern void FreeTextures(void);
/**********************************************************************/
/**********************************************************************
*
* End of file.
*
**********************************************************************/
#endif /* ROLLTYPE_H */