# Example glgrav data file
#
# Note that when using object names, case is important.  Case in commands and
# arguments is not.
#
# $Id: dat,v 1.1.1.1 2006-05-02 19:12:45 ianc Exp $
#


# Define position of observer
#
#	camera x,y,z,yaw
#
camera 0.0, 200.0, -1000.0, 0.0;


# If supported by the environment defines the window size.  Illegal window
# sizes should be silently ignored.  Default is 640x480.
#
window_size 500,500;


# Enable/disable flags.  All flags are disabled by default, but can be
# explicitly disabled with disable.  Flags are:
#
#	solid		- Draw objects as solid, not wireframe
#	lighting	- Enable lighting
#	texture		- Enable texturing
#
enable solid;
enable lighting;
enable texture;


# collide allows the values:
#
#	none		- Masses simply pass through each other
#	shatter		- Masses explode into various parts.  See shatter
#			  command for extra details.
#	merge		- The larger mass swallows the smaller mass.
#	delta_merge	- The larger mass swallows the smaller mass, gaining
#			  some of the smaller masses delta in proportion to
#			  the size of the masses.
#
collide delta_merge;

# Define how shatter collisions should behave
#
#   shatter num,dx,dy,min,max,sheild;
#
#	num		- Each mass will split into this many equal massed
#			  objects.
#	delta		- Each new mass will have a pseudo random number
#			  between -delta and +delta added to the parents 
#			  mass's delta.
#	min		- Objects below this mass will not shatter and will
#			  simply be merged into a larger mass (even below the
#			  max control below) on collision.
#	max		- Objects above this mass can only be shattered by
#			  other masses above this max mass.  Objects below the
#			  max limit will simply be merged on collision.
#	shield		- The number of 'ticks' that the newly generated
#			  objects created by a collision are safe from 
#			  collisions with other shatter particles.
#
# Note that when masses shatter they inherit the parent objects colour and
# texture.  The default is:
#
#   shatter 10,5.0,10.0,1000.0,100;
#
shatter	10,5.0,10.0,1000.0,100;


# Defines the maximum number of masses.  This is solely to stop runaway
# shatter collisions crippling your machine.  If left defined the default
# is 1,000,000.
#
max_mass 1000;

# Define gravitational constant
#
const 0.00001;


# By default the radius of the calcualted for each mass as if the sphere has a
# volume equivalent to it's mass.  This allows that to be scaled and defaults
# to 1.0 if undefined.
#
scale 2.5;


# Body definition is:
#
#   body name,mass,x,y,z,dx,dy,dz,r,g,b,rot
#
#	name 		- Name of object
#	mass 		- Mass of object (0 for massless)
#	x,y,z 		- Position of object
#	dx,dy,dz 	- Initial velocity of object
#	r,g,b		- Colour of object [0.0 - 1.0]
#	rot		- Number of degrees to rotate per 'tick'.
#
# Note on 'massless' objects:
#
#	Objects defined with a mass of zero indicate 'massless' objects.
#	They are attracted by other bodies, but have no effect themselves.
#	Also they are not involved with collisions.  Note that so they are
#	attracted 'massless' objects actually have a mass of 0.0001.
#
body 	Sun,
	200.0,
	0.0,0.0,-1500.0,
	0.0,0.0,0.0,
	1.0,1.0,0.0,
	0.0;


# Set the plane for radial and multiple radial objects.  Note that this
# command can appear multiple times to the set the plane for objects defined
# from the point on.  The default plane is 'xy'.
#
# Valid planes are:
#
#	xy		- Create object with a Z co-ord that matches the parent
#	xz		- Create object with a Y co-ord that matches the parent
#	yz		- Create object with a Z co-ord that matches the parent
#
plane xz;


# Radial definition is:
#
#   radial name,mass,parent,distance,angle,speed,r,g,b,rot
#
#	name 		- Name of object
#	mass 		- Mass of object.  Zero indicates body is attracted,
#			  but appears massless to other objects.
#	parent		- Name of object this one orbits.
#	distance	- Distance from parent.
#	angle		- Angle around parent in X-Y plane [0.0 - 360.0]
#	speed		- Speed of object.
#	r,g,b		- Colour of object [0.0 - 1.0]
#	rot		- Number of degrees to rotate per 'tick'.
#
# Note that the vector calculated from the distance, angle and speed will have
# the parent's vector added to it.
#
radial 	Earth,
	30.0,
	Sun,
	400.0,180.0,0.3,
	1.0,1.0,1.0,
	0.5;

radial 	Moon,
	10.0,
	Earth,
	50.0,180.0,0.15,
	1.0,1.0,1.0,
	0.1;


# A multiple radial definition is:
#
#   multiple name,num,mass,mass_inc,parent,distance,distance_inc,
#		angle,ang_inc,speed,speed_inc,r,g,b,rot
#
#	name 		- Name of object.  A number is added to the end of
#			  the name for each object, ie. name 1, name 2, ...
#	num 		- The number of masses to create.
#	mass 		- Mass of objects.  Zero indicates body is attracted,
#			  but appears massless to other objects.
#	mass_inc 	- Amount to change from initial mass per object.
#	parent		- Name of object this one orbits.
#	distance	- Distance from parent.
#	distance_inc	- Amount to change distance per object.
#	angle		- Angle around parent in X-Y plane [0.0 - 360.0]
#	angle_inc	- Amount to change angle per object.
#	speed		- Speed of object.
#	speed_inc	- Amount to change speed per object.
#	r,g,b		- Colour of object [0.0 - 1.0]
#	rot		- Number of degrees to rotate per 'tick'.
#
multiple 	Belt,
		10,
		4.0,
		0.0,
		Sun,
		150.0,
		0.0,
		0.0,
		30.0,
		0.5,
		0.0,
		1.0,1.0,1.0,
		0.0;


# Defines the object which will be a light source:
#
#   light name,r,g,b
#
#	name 		- Name of object
#	r,g,b		- Colour of light [0.0 - 1.0]
#
light Sun,1.0,1.0,1.0;


# Provide a list of the objects you wish to look from and at
#
#   look name;
#   mlook name,num;			(Mutiple look for multiple objects)
#
look Sun;
look Earth;
look Moon;
mlook Belt,10;


# Initial objects to look at and travel as.  Must be after any look commands
#
look_at Sun;
#travel_as Belt 1;


# Define textures for objects.  Textures have to be in raw RGB format.
#
#   num_texture number			(Define no. of textures)
#
#	number		- Number of textures to allocate.  Note this also
#			  includes ring textures.
#
#
#   texture name,file,width,height	(Bind a texture to a body)
#
#	name		- Name of object
#	file		- File holding texture image
#	width,height	- Size of texture
#
#   reuse name,other			(Reuse a previously bound texture)
#
#	name		- Name of object
#	other		- Object name to which the texture is associated
#			  Note that ring textures can be reused too.
#
#   mreuse name,num,other		(Mutliply reuse a texture)
#
#	name		- Name of object
#	num		- Number of objects.  name 1, name 2, etc will be
#			  derived from this to get the real object name.
#	other		- Object name to which the texture is associated
#			  Note that ring textures can be reused too.
#

# eg.
# num_texture 3;
# texture Moon,moon.raw,256,256;
# texture Earth,earth.raw,512,256;
# mreuse Belt,10,Moon;


# Define rings 
#
#
#   ring name,from,to,r,g,b,alpha,rot,angle 	(Define a ring)
#
#	name		- Name of object
#	from,to		- The inner and outer radius of the ring in terms
#			  of the radius of the body.
#	r,g,b		- Colour of the ring [0.0 - 1.0]
#	alpha		- Transparency of the ring [0.0 - 1.0]
#	rot		- Number of degrees to rotate per 'tick'.
#	angle		- Tilt from 'north' pole.
#
#   mring name,num,from,to,r,g,b,alpha 	(Multiply define rings)
#
#	name		- Name of object
#	num		- Number of objects.  name 1, name 2, etc will be
#			  derived from this to get the real object name.
#	from,to		- The inner and outer radius of the ring in terms
#			  of the radius of the body.
#	r,g,b		- Colour of the ring [0.0 - 1.0]
#	alpha		- Transparency of the ring [0.0 - 1.0]
#			  *NOT YET IMPLEMENTED*
#
#   ring_texture name,file,width,height	(Texture a ring)
#
#	name		- Name of object
#	file		- Filename to use for ring texture
#	width,height	- Size of texture
#
#   ring_reuse name,other		(Reuse a previously bound ring texture)
#
#	name		- Name of object
#	other		- Object name to which the texture is associated
#			  Note that normal textures can be reused too.
#
#   ring_mreuse name,num,other		(Mutliply reuse a ring texture)
#
#	name		- Name of object
#	num		- Number of objects.  name 1, name 2, etc will be
#			  derived from this to get the real object name.
#	other		- Object name to which the texture is associated
#			  Note that normal textures can be reused too.
#
ring Earth,2.0,2.1,1.0,1.0,1.0,0.6,0.5,45;

# eg.
# ring_texture Earth,ring.raw,256,256;


# Define trails.  If enabled objects leave behind a point as they travel.
# Each point lives for a time defined by it's alpha decay.
#
#   particles life,max,size;
#
#	decay		- The amount to decrease the alpha per tick.
#	min		- The minimum alpha.  Once this is reached, the particle
#			  is destoryed.
#	size		- Size of each point (currently ignored)
#
particles 0.001,0.0,1.0;


# Define sparks from collisions
#
#   sparks num,max,life,length,delta;
#
#	num		- The number of sparks per collision.
#	decay		- The amount to decrease the alpha per tick.
#	min		- The minimum alpha.  Once this is reached, the particle
#			  is destoryed.
#	length		- The length of a spark.  The actual length will be
#			  (length * delta).
#	delta		- Each spark will have a pseudo random number
#			  between -delta and +delta set for it's speed.
#
sparks 50,0.01,0.0,5,2.0;


# Define a 'fog' to increase depth perception
#
#   fog dist,r,g,b,light;
#
#	dist		- The max distance you can see into the fog
#	r,g,b		- The colour of the fog
#	light		- Whether the light source is effected by fog (yes/no)
#
fog 1000.0,0.2,0.0,0.0,no;