/*
       PROJET:
       SUBSYSTEM:
       MODULE:
 
       FILE:           $RCSfile: vceltype.h,v $
       REVISION:       $Revision: 1.1 $
       Date:           $Date: 95/05/18 10:24:13 $
       Author:         $Author: john $
       RCS Ident:      $Id: vceltype.h,v 1.1 1995/03/10 14:52:46 john Exp $
 
       FUNCTION:
 
 
 
 
  Copyright (c) 1992 Division Ltd.
 
  All Rights Reserved.
 
  This Document may not, in whole or in part, be copied,
  photocopied, reproduced, translated, or reduced to and
  electronic medium or machine readable form without prior
  written consent from Division Ltd.
*/
#ifndef VCELTYPE_H
#define VCELTYPE_H
#ifdef _LIB_VC
#include <vcdefs.h>

#else
#include <dvs/vcdefs.h>
#endif


#define InstanceNo uint32	/* Define InstanceNo as a basic type !! */

#ifndef VCColor
typedef float32		VCColour[3];
#endif
#ifndef _VCDTYPES_H
typedef struct
{
    uint32 	secs;
    uint32	uSecs;
}VCTime;
#endif
/*
typedef VCPositionData _VCPosition; 
*/

/*
typedef struct
{
    uint32	secs;
    uint32	uSecs;
}VCTime;
*/

typedef struct 
{
    dmPosition		dmPos;
    uint32		mode;
}_VCPosition;

typedef struct
{
    _VCPosition		vcPos;
    uint32		parent;
}_VCObjectPosition;


typedef struct 
{
    uint32          	mode;
    int32	    	loopCnt;
    float32         	gain;
    uint16		play;
    uint8		velocity;
    int8		priority;
    char8		voice[1];
}_VCAudio;


typedef struct
{
    char8	name[VC_RADIATOR_NAME_LENGTH];
    int32       numPoints;
    float32	points[VC_RADIATOR_MAX_POINTS];
} _VCRadiator;


typedef struct
{
        uint32          mode;
        uint32		flags;
        float32		point[6];
        float32 	rotation[6];
} _VCConstraints;

typedef struct
{
    uint32          	mode;
    uint32		intersectMask;
    InstanceNo		dynamicIno;
    char8		geometry[1];
} _VCVisual;


typedef struct
{
    uint32	mode;
    float32     ambient[3];
    float32     diffuse[3];
    float32     specular[4];
    float32     emissive[3];
    float32     opacity[3];
    char8       name[1];
} _VCMaterial;

typedef struct
{
    uint32	mode;
    uint8	minify;
    uint8       magnify;
    uint8       alpha;
    uint8       wrapU;
    uint8       wrapV;
    uint8       detailType;
    char8       name[1];
} _VCTexture;

typedef struct
{
        InstanceNo      boundaryIno;
        uint16          flags;
        dmPoint        	point;
        dmVector       	direction;
        VCTime          time;
} _VCCollisionReport;

typedef struct
{
    InstanceNo		myBoundaryIno;
    uint32		numberCollisions;
    _VCCollisionReport	collisions[1];
} _VCCollisionState;


typedef struct
{
        float32         bound[VC_BOUND_SIZE];
        uint32          mode;
        int32		numberCollisions;
        InstanceNo	collisionStateIno;
        InstanceNo	dynamicVisual;
        char8           geometry[1];
} _VCBoundary;

/*
typedef struct VCLightData _VCLight;
*/

typedef struct 
{
    uint32           mode;
    VCColour         colour;
    float32	     exponent;
    float32	     theta;
}_VCLight;



typedef struct 
{
    _VCObjectPosition	pos;
    InstanceNo		attributes[VC_MAX_OBJECT_ATTRIBUTES];
}_VCObject;

typedef struct
{
        uint32	actorId;
        char8	name[1];
} _VCBodyPart;

typedef struct 
{
    float32     headUpdateRate;     /* No updates / second */
    float32     geometryUpdates;    /* No updates / second */
    float32     frameRate;          /* No frames drawn/second */
    float32     drawRate;           /* Tri's per second */
    char8       name[1];               /* Name of the actor. */
}_VCVisualMonitor;


typedef struct
{
    float32     sensorRate[VC_MAX_SENSORS];      /* Sensor updates per second */
    uint32	sensorBaseNumber;
    char8       name[1];               /* Name of the actor. */
}_VCTrackerMonitor;

typedef struct {
    uint32 	updateRate;
    uint32 	transmissionDelay;
    dmPoint 	sourcePosition;
    dmEuler 	sourceEuler;
    uint32 	baudRate;
    char8 	name[1];
} _VCTracker;

typedef struct {
    uint32		mode;
    InstanceNo		trackerIno;
    uint32 		sensorId;
    float32 		scaleTranslate[3];
    float32 		scaleRotate[3];
    float32 		rotationCurveOrder[3];
    float32 		translationCurveOrder[3];
    dmPoint 		prePosition;
    dmPoint 		postPosition;
    dmEuler 		preEuler;
    dmEuler 		postEuler;
    float32 		relativeSphere[6];
    InstanceNo 		positionIno;
    _VCConstraints 	constraints;
    char8       	name[1];               /* Name of the actor. */
} _VCSensorResource;

typedef struct
{
    uint32    		 mode;
    InstanceNo     	 inputIno;
    char8       	 name[1];               /* Name of the actor. */
} _VCInputResource;

typedef struct
{
    float32     objectInRate;       /* Object updates per second */
    float32     objectInActive;     /* Objects that are collidable per second */
    float32     objectTests;        /* Number of collision tests per second */
    char8       name[1];               /* Name of the actor. */
} _VCCollideMonitor;


typedef struct
{
    char8       name[1];               /* Name of the actor. */
} _VCBodyMonitor;

typedef struct
{
    uint32         mode;
    float32        frameRate;
    float32        iod;
    float32        convergence;
    float32        background[3];
    float32        nearClip;
    float32        farClip;
    float32        fogColour[3];
    float32        nearFog;
    float32        farFog;
    float32        lodScale;
    uint32	   actorId;
    char8          name[1];
} _VCVisualResource;


typedef struct
{
    InstanceNo	visualResourceIno;
    uint32     	mode;
    dmPoint    	offset;
    dmEuler    	orientation;
    float32    	size[2];
    char8      	name[1];
} _VCVisualViewResource;


typedef struct
{
    float32	slow_speed;
    float32	fast_speed;
    float32	acceleration;
    float32	max_speed;
    uint32	slow_key;
    uint32	fast_key;
    uint32	accelerate_key;
}_VCBodyFlyInfo;

typedef struct
{
    uint32		actorId;
    InstanceNo  	bodyRoot;
    InstanceNo  	bodyPosObject;
    _VCBodyFlyInfo	fly_forward;
    _VCBodyFlyInfo	fly_backward;
    _VCBodyFlyInfo	fly_up;
    _VCBodyFlyInfo	fly_down;
    _VCBodyFlyInfo	fly_left;
    _VCBodyFlyInfo	fly_right;
    _VCBodyFlyInfo	rot_left;
    _VCBodyFlyInfo	rot_right;
    _VCBodyFlyInfo	rot_up;
    _VCBodyFlyInfo	rot_down;
    uint32		verticalFly_key;
    uint32		altFly_key;
    InstanceNo		flyDirectionLimb;
    InstanceNo		altFlyDirectionLimb;
    InstanceNo		altFlyLimb;
    uint32		flyMode;
    char8       	name[1];
} _VCBody;

typedef struct
{
    InstanceNo ino;
    char8	name[1];
} _VCConfigRequest;

typedef struct
{
    InstanceNo user;
    int32      verbose;
    int32      enable;
    char8       log[4];
    char8       config[1];
} _VCConfigReply;

typedef struct
{
    char8  name[1];
} _VCUser;

typedef struct 
{
        InstanceNo	resourceIno;
        uint8  		allocated;
        char8		name[1];
}_VCResource;

typedef struct
{
        InstanceNo	resource;
        int32		updated;
        InstanceNo	serverResource;
        uint32		resourceType;
} _VCResourceRequest;

typedef struct
{
    uint32		mode;
    float32		iad;
    float32		volume;
    float32		spreadingRollOff;
    float32	 	atmosphericAbsorption;
    float32		worldScale;
    char8		name[1];
} _VCAudioResource;

typedef struct
{
    uint32		numWraps;
    int32		head;
    uint32		input[1];
}_VCInput;

typedef struct
{
    InstanceNo		pickInstance;
    uint32		mode;
    uint32		pickActorId;
}_VCPickObject;

typedef struct {
    uint32  windowId;               /* Identity of the window */
    char8   name [1];               /* Name of the resource. */
} _VCXWindowId;

typedef struct {
    
    uint32	 actorId;
    uint32	 mode;
    InstanceNo	 subject;
} _VCQuery;

typedef struct {
    uint32	 status;
    InstanceNo	 result;
} _VCResponse;

typedef struct {
    _VCQuery	 query;
    _VCResponse	 response;
} _VCVisualQuery;

typedef struct
{
    InstanceNo	object;
    InstanceNo	visual;
    InstanceNo	patch;
    dmPoint	point;
} _VCIntersectionReport;    

typedef struct
{
    InstanceNo		myVectorIntersectIno;
    uint32		numberIntersections;
    _VCIntersectionReport	intersections[1];
} _VCIntersectionState;

typedef struct
{
    uint32	mode;
    float32	length;
    uint32	intersectMask;
    int32	numberIntersections;
    InstanceNo	intersectStateIno;
}_VCVectorIntersect;

typedef struct
{
    uint32     mode;
    uint32     type;
    dmPoint    offset;
    float32    data[72];
    char8      texture[1];
}_VCVisualEffect;

typedef struct
{
    uint32	mode;
    float32	iMass;
    float32	gMass;
    dmPoint	centre;
    float32	iTensor[6];
    float32	spring;
    float32	damper;
    float32	staticFriction;
    float32	dynamicFriction;
}_VCDynamics;


typedef struct
{
    uint32	mode;
    dmVector	force;
    dmPoint	point;
} _VCForce;

typedef struct
{
    uint32	mode;
    dmVector	direction;
    float32	gravity;
}_VCPseudoGravity;

typedef struct
{
    uint32	mode;
    uint32	actorMask;
}_VCZone;

typedef struct
{
    uint32     mode;
    InstanceNo lod;
    char8      name[1];
} _VCDynamicVisual;

typedef struct
{
    uint32     mode;
    float32    in;
    float32    out;
    dmPoint    reference;
    InstanceNo next;
    char8      name[1];
} _VCLod;

typedef struct
{
    uint32     mode;
    uint8      faceted;
    uint8      vertexFormat;
    uint8      lock;
    uint8      drawMode;
    uint8      drawWidth;
    int32      decal;
    InstanceNo lod;
    char8      name[1];
} _VCGeogroup;

typedef struct
{
    uint32     mode;
    uint32     numVertices;
    InstanceNo geogroup;
} _VCGeometryHeader;

typedef struct
{
    _VCGeometryHeader header;
    float32          vertices[1];
} _VCGeometry;

typedef struct
{
    uint8   font;
    dmPoint position;
    dmEuler orientation;
    dmScale scale;
    char8   text[1];
} _VCTextData;

typedef struct
{
    _VCGeometryHeader header;
    _VCTextData       text;
} _VCText;

typedef struct
{
    uint32    			 numConnections;
    uint32			 mode;
    InstanceNo			 geometry;
} _VCConnectionListHeader;

typedef struct
{
    _VCConnectionListHeader	 header;
    uint32                	 connections[1];
} _VCConnectionList;

typedef struct
{
    VCTime	time;
    char8	name[1];
} _VCSync;

typedef struct
{
    uint32	mode;
    VCColour	minRgb;
    VCColour	maxRgb;
    char8	name[1];
} _VCRamp;


    

#undef	InstanceNo		/* Remove local Instance Number definition */
#define el_VCPosition el__VCPosition
#define el_VCObjectPosition el__VCObjectPosition
#define el_VCObject el__VCObject
#define el_VCConstraints el__VCConstraints
#define el_VCZone el__VCZone

#define el_VCVisualMonitor el__VCVisualMonitor
#define el_VCConfigRequest el__VCConfigRequest
#define el_VCConfigReply el__VCConfigReply
#define el_VCUser el__VCUser
#define el_VCResource el__VCResource
#define el_VCResourceRequest  el__VCResourceRequest

#define el_VCAudio el__VCAudio
#define el_VCRadiator el__VCRadiator
#define el_VCAudioResource el__VCAudioResource


#define el_VCVisual el__VCVisual
#define el_VCMaterial  el__VCMaterial 
#define el_VCTexture el__VCTexture
#define el_VCLight el__VCLight
#define el_VCVisualResource el__VCVisualResource
#define el_VCVisualViewResource el__VCVisualViewResource

#define el_VCIntersect el__VCIntersect
#define el_VCVectorIntersect el__VCVectorIntersect

#define el_VCIntersectionReport	el__VCIntersectionReport
#define el_VCIntersectionState	el__VCIntersectionState
#define el_VCNewVectorIntersect	el__VCNewVectorIntersect

#define el_VCVisualEffect el__VCVisualEffect

#define el_VCCollisionReport el__VCCollisionReport
#define el_VCCollisionState el__VCCollisionState 
#define el_VCBoundary el__VCBoundary

#define el_VCBodyPart  el__VCBodyPart
#define el_VCBodyMonitor el__VCBodyMonitor
#define el_VCBodyFlyInfo el__VCBodyFlyInfo
#define el_VCBody el__VCBody
#define el_VCPickObject el__VCPickObject

#define el_VCTrackerMonitor el__VCTrackerMonitor
#define el_VCCollideMonitor el__VCCollideMonitor


#define el_VCSensorResource el__VCSensorResource
#define el_VCTracker el__VCTracker

#define el_VCInputResource el__VCInputResource
#define el_VCInput el__VCInput

#define el_VCXWindowId el__VCXWindowId

#define el_VCQuery el__VCQuery 
#define el_VCResponse el__VCResponse
#define el__VCResponse el__VCResponse
#define el_VCVisualQuery el__VCVisualQuery 

#define el_VCDynamics el__VCDynamics
#define el_VCForce el__VCForce
#define el_VCPseudoGravity el__VCPseudoGravity

#define el_VCDynamicVisual el__VCDynamicVisual
#define el_VCLod el__VCLod 
#define el_VCGeogroup el__VCGeogroup 
#define el_VCGeometryHeader el__VCGeometryHeader 
#define el_VCGeometry el__VCGeometry 
#define el_VCTextData el__VCTextData 
#define el_VCText el__VCText 
#define el_VCConnectionListHeader el__VCConnectionListHeader 
#define el_VCConnectionList el__VCConnectionList 
#define el_VCSync el__VCSync
#define el_VCRamp el__VCRamp
#endif /* VCELTYPE_H */
