RaydiumWikiNi

RaydiumApiReference

PagePrincipale :: DerniersChangements :: ParametresUtilisateur :: Vous êtes ec2-18-224-73-157.us-east-2.compute.amazonaws.com
Ceci est une version archivée de RaydiumApiReference à 2010-05-14 03:16:54.

Raydium API Reference


CQFD Corp.


This document is the most up-to-date version. This is a work in progress:
there's again some errors and wrong informations. Try, wait, or contribute ;)

Index of chapters
Index of all Raydium functions


This document is autogenerated, any change will be lost,
use RaydiumApiReferenceComments for any need.
Generated: 2010-05-14 03:15:56, for Raydium 0.800


1 Introduction to Raydium:

1.2 Defines:

As mentioned above, the file common.c is quite interesting,
for several reasons: first, as this file includes all others Raydium's
files, you can have an overview of the whole project, just by looking at this.

It can also be used as a "quick help", since all variables are declared
here, and not in the corresponding files. I mean, for example,
that "raydium_light_intensity..." will be declared in common.c,
not in light.c . There's many reasons for using such "style",
but you must only retain that it is simpler for you :)

Ok, after this little disclaimer, we can have a look to the first part
of our file.

After usual #include (nothing interesting here), we find some #defines.

generic limits


The first #define block determine limits of your application,
and here you are the actual values for basic defines:
#define RAYDIUM_MAX_VERTICES 500000
#define RAYDIUM_MAX_TEXTURES 256
#define RAYDIUM_MAX_LIGHTS 8
#define RAYDIUM_MAX_NAME_LEN 255
#define RAYDIUM_MAX_OBJECTS 1024 
 


- As you may expect, MAX_VERTICES defines the amount of memory you'll
waste with vertex tables. These tables will contain all loaded objects,
then remember each time you draw something (object),
Raydium loads it (if not already done). Currently, there is no "delete"
mechanism implemented (except by deleting all objects).
Let me give you a scale: with an Athlon XP1900+, GeForce 3,
actual Raydium devel. version 0.31, with around 100 000 vertices,
losts of options (sky, blending, 2 lights, 15 textures, ...),
Raydium renders ~ 45 FPS. Beyond this, a very correct object uses less
than 10 000 vertices. So 500 000 vertices, the actual default,
is quite large. It's also important to talk about memory: Linux is
very efficient on this point, and allocates only "really used" memory.
Under Linux, with the above scene, Raydium used about 20 MB (data only),
instead of "much more" (~ 5x). I haven't made any test about this under
Windows, but we can expect worse results.

- There's nothing really important to say about MAX_TEXTURES,
since that doesn't influence the amount of memory used. You are not
limited to 8 bits values, but 256 seems very comfortable (and you must
pay attention to the capacities of your 3D hardware !)

- The next define, MAX_LIGHTS is very important: OpenGL, for now
(version 1.3 and lower), impose 8 lights at least, and all current
hardware doesn't manage more. If this situation is likely to evolve,
we will move this #define to a variable, and will ask hardware for its
capacities at initialization, but, for the moment, do not exceed 8.

- Next, NAME_LEN, limits the maximum length of strings (textures and
objects names) used by Raydium. Default value should be perfect.
(avoid higher values, since it could slow down name searches)

- MAX_OBJECTS use the same mechanism as MAX_TEXTURES, and addition
with the fact that hardware is not concerned, it can be ignored.

Options and parameters


This is the next part of our #define section, I will not explain these
constants here, but in respective sections, so you'll have just you to
remember they're declared here.

2.1 Little introduction to math.c:

This section is mostly designed for internal uses, but provides some
usefull maths functions, mostly for trigonometrical uses.

Historical note: most functions here were originally named with "trigo" prefix,
since this module was named trigo.c. Aliases are provided for compatibility
reasons, of course. (but watch out for old bindings !)

2.2 GLfloat raydium_math_cos (GLfloat i):

Obvious (degrees)

2.3 GLfloat raydium_math_sin (GLfloat i):

Obvious (degrees)

2.4 GLfloat raydium_math_cos_inv (GLfloat i):

Obvious (degrees)

2.5 GLfloat raydium_math_sin_inv (GLfloat i):

Obvious (degrees)

2.6 raydium_math_abs(a) (macro):

Obvious
define raydium_trigo_abs is deprecated, for compatibility only.

2.7 raydium_math_min(a,b) (macro):

Obvious
define raydium_trigo_min is deprecated, for compatibility only.

2.8 raydium_math_max(a,b) (macro):

Obvious
define raydium_trigo_max is deprecated, for compatibility only.

2.9 raydium_math_isfloat(a) (macro):

Test two cases : "Not a Number" and "Infinite"
define raydium_trigo_isfloat is deprecated, for compatibility only.

2.10 raydium_math_round(a) (macro):

Will obviously "round" a instead of the default C floor behaviour
define raydium_trigo_round is deprecated, for compatibility only.

2.11 void raydium_math_rotate (GLfloat * p, GLfloat rx, GLfloat ry, GLfloat rz, GLfloat * res):

Rotate p (GLfloat * 3) by (rx,ry,rx) angles (degrees).
Result is stored in res (GLfloat * 3)

2.12 void raydium_math_pos_to_matrix (GLfloat * pos, GLfloat * m):

Generates a ODE style matrix (16 Glfloat) from pos (GLfloat * 3)

2.13 void raydium_math_pos_get_modelview (GLfloat * res):

Stores the translation part of the current OpenGL MODELVIEW matrix in res (3 GLfloat)

2.14 int raydium_math_pow2_next(int value):

Returns next power of two of value. Ugly.

2.15 int _raydium_math_MatrixInverse(const float *m,float *out):

Our matrix_inverse seems broken.
This code works, thanks to Alexander Zaprjagaev (frustum@public.tsu.ru)
This code is not native

2.16 void raydium_math_quaternion_normalize(float *quat):

Normalize quat quaternion. I suppose such code is already available
in ODE.

2.17 void raydium_math_quaternion_slerp(float *start, float *end, float alpha,float *result):

Spherical Linear Interpolation of quaternions, from start to end
with alpha [0,1] as interpolation point.

2.18 void raydium_math_quaternion_multiply(float *q1, float *q2, float *result):

Multiply two quaternions and fill the result with the resulting
quaternion.
Quite usefull for making rotations over quaternions.
Here a list of common quaternions:
W X Y Z
1,0,0,0 Identity quaternion, no rotation
0,1,0,0 180' turn around X axis
0,0,1,0 180' turn around Y axis
0,0,0,1 180' turn around Z axis
sqrt(0.5),sqrt(0.5),0,0 90' rotation around X axis
sqrt(0.5),0,sqrt(0.5),0 90' rotation around Y axis
sqrt(0.5),0,0,sqrt(0.5) 90' rotation around Z axis
sqrt(0.5),-sqrt(0.5),0,0 -90' rotation around X axis
sqrt(0.5),0,-sqrt(0.5),0 -90' rotation around Y axis
sqrt(0.5),0,0,-sqrt(0.5) -90' rotation around Z axis
TODO: Those could be added like defines

2.19 float raydium_math_angle_from_projections(float px, float py):

This function will return the real angle (in radians) for a pair of X
and Y projections of a vector. The vector has to be normalized, this is
, with the values betwen -1 and 1;
The returned angle will be in the range [0-2PI].

2.20 signed char raydium_math_point_unproject_3D(GLfloat x, GLfloat y, GLfloat z, float* resx, float* resy):

Return the (x,y) screen coordinates for a 3D point viewed from the
current camera.
The resx and resy results are in the [0..100] interval.
This function will return 0 if the point is behind the camera (and then,
probably not interesting), and 1 if the point is in the POV of the
camera ("in front of" is more exact).

warning 1: the camera must be placed before calling this function.
warning 2: this function will replace the camera by itself.

2.21 void raydium_math_hms(double t, int *h, int *m, int *s, int *ms):

Converts a duration (in seconds) to H:M:S:MS format.


3 Logging:

3.1 Introduction to log.c:

Raydium uses and provides his own logging system,
hidden behind a single function, as shown below.

3.2 void raydium_log (char *format, ...):

This function must be used like "printf", using a format
("%s, %i, %x, ...") and then, suitable variables,
but without the end-line char ('\n')

raydium_log("You are player %i, %s",player_number,player_name);


For now, this function writes to the parent terminal and the in-game console, with "Raydium: " string prefix.
The user can force logging to a file, using --logfile command line switch.


4 Random:

4.1 Introduction:

These functions deals with random numbers generation.

4.2 void raydium_random_randomize (void):

This function initialize the random number generator
with current time for seed.
Note: You are not supposed to use this function.

4.3 GLfloat raydium_random_pos_1 (void):

"positive, to one": 0 <= res <= 1

4.4 GLfloat raydium_random_neg_pos_1 (void):

"negative and positive, one as absolute limit": -1 <= res <= 1

4.5 GLfloat raydium_random_0_x (GLfloat i):

"zero to x": 0 <= res <= x

4.6 GLfloat raydium_random_f (GLfloat min, GLfloat max):

min <= res <= max (float)

4.7 int raydium_random_i (int min, int max):

min <= res <= max (integer)

4.8 signed char raydium_random_proba (GLfloat proba):

Returns true or false (0 or 1) depending of "proba" factor.
proba must be: 0 <= proba <=1
ex: 90% = 0.9 (this will "very probably" return true)


5 Fog:

5.1 Introduction:

Fog is usefull for two major reasons:

1. Realism: Just try, and you'll understand:
amazing depth impression, no ?

2. Speed: For a correct fog effect (i'm talking
about estetic aspect), you must bring near_clipping to a closer value,
reducing the overall number of triangles displayed at the same time.

There are 3 types of fog. They are:
* Linear: fog = (Far-z) / (Far-Near)
* Exp: fog = e^(-density*z)
* Exp2?: fog = e^((-density*z)^2)

Above z is the distance to the calculated point from the camera.
As you can see, linear mode doesn't use density, and Exp & Exp2? modes don't
use near and far values. Remember that.

5.2 void raydium_fog_enable (void):

Obvious

5.3 void raydium_fog_disable (void):

Obvious

5.4 void raydium_fog_color_update (void):

If you have modified raydium_background_color array, you must
call this function, applying the specified color to hardware.
See also: raydium_background_color_change

5.5 void raydium_fog_mode(GLuint mode):

The fog mode can be change with this function. There are 3 different ways
to apply the fog:

1. RAYDIUM_FOG_MODE_LINEAR - Used by default, the fog is directly applied
according the distance. Not real world fog, but used to avoid drawing
too distant objects.
IMPORTANT: LINEAR mode ignores the density value,
only uses near and far.

2. RAYDIUM_FOG_MODE_EXP - The fog grows exponentially with the distance.
Usual mist in the real world.
IMPORTANT: EXP mode ignores the near and far values,
only uses the density.

3. RAYDIUM_FOG_MODE_EXP2 - The fog grows twice exponentially with the
distance. Used when the observer is inside a cloud/mist.
IMPORTANT: EXP2 mode ignores the near and far values,
only uses the density.

5.6 void raydium_fog_density(GLfloat density):

Sets the density of the fog.
Useless if you are using LINEAR mode.

5.7 void raydium_fog_near(GLfloat near):

Sets the near point to apply the fog.
Useless if you are using EXP or EXP2 modes.

5.8 void raydium_fog_far(GLfloat far):

Sets the far point of the fog.
Useless if you are using EXP or EXP2 modes.

5.9 void raydium_fog_apply(void):

Used to apply changes in your setup of fog.
Also is used to continue a previously stopped fog.
See: raydium_fog_wait() below.

5.10 void raydium_fog_wait(void):

With this function you can deactivate TEMPORALY the fog, but the internal state
of the fog in Raydium won't change, so when you use raydium_fog_apply, the fog
will continue like it was before being stoped.
It's very usefull for certain rendering effects that need to
stop the fog temporaly.

5.11 void raydium_fog_volumetric_support(void):

With this function, you're saying to Raydium that you want a support
for volumetric fog in you application. Call this function as soon as possible
after engine init, since it will change the way Raydium renders objects (think
about display lists).

5.12 void raydium_fog_volumetric_enable(void):

When you call this function, fog is no more applied using fragment depth,
but using RENDER_VOLUMETRIC_FOG_AXIS (see config.h).
You must have called raydium_fog_volumetric_support() before enabling
volumetric fog.

5.13 void raydium_fog_volumetric_disable(void):

Reset fog sytem to default behavior (fragment depth).


6 Window management:

6.1 Introduction:

Some important functions, used for window creation and managment.

6.2 void raydium_window_close (void):

This function is called by Raydium, do not use.

6.3 void raydium_window_create (GLuint tx, GLuint ty, signed char rendering, char *name):

You must call this function once in your program, with following arguments:

1. tx, ty: window size, in pixel
2. rendering: window mode: RAYDIUM_RENDERING_* :
NONE, WINDOW (resizable), WINDOW_FIXED (unresizable) and FULLSCREEN.
3. name: window's name

Raydium is using MyGLUT? for window management, and MyGLUT? fullscreen is not
the same between all implementations. For instance, the Linux MyGLUT? does
not resize the X screen, therefore doesn't care about tx and ty.
But the win32 implementation did resize screen.

This design choice allows to respect usual behaviors of operating systems.

Note that user can force fullscreen using --fullscreen on the command line.

6.4 void raydium_window_resize_callback (GLsizei Width, GLsizei Height):

This function is automaticaly called during a window resize,
and resize OpenGL rendering space.

There is almost no reason to call this function by yourself.

6.5 void raydium_window_view_update (void):

If you've changed 3D window size (clipping: raydium_projection_*),
apply to hardware with this fonction.

6.6 void raydium_window_view_perspective(GLfloat fov, GLfloat fnear, GLfloat ffar):

All-in-one function: sets all "perspective" variables, and updates.


7 Capture (2D):

7.1 Quickview:

Captures are made in TGA (without RLE compression) or JPEG formats and saved into
the current directory.
These functions may fail (garbage in resulting capture) if frame size if
not "standard", mostly after a window resize.

Also there are "auto" functions that provide a simplest method to make an screen
capture. So,the following example (put into the display() function), allows jpeg
screenshots just pressing F9 key:
if(raydium_key_last==9) raydium_capture_frame_jpeg_auto();


Raydium also allow you to capture movies: activate DEBUG_MOVIE option
in raydium/config.h with the needed framerate, and press F11. Raydium
will use a dedicated time line, allowing smooth capture. This system may cause
strange behaviours with movies providing network action.
The movie is stored in multiples files in movie directory, and you can
use mencoder like this:
mencoder -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=780
mf://\*.tga -vf scale=320:240 -mf fps=25 -o ~/ray.avi

You can also use audio file adding this:
-audiofile audio.mp3 -oac copy for example.

7.2 void raydium_capture_frame(char *filename):

Capture current frame to filename.

7.3 void raydium_capture_frame_auto(void):

Same as above, but to an auto-generated filename (raycap*).

7.4 void raydium_capture_frame_jpeg(char *filename):

Same as raydium_capture_frame() but using JPEG image format.
See raydium/config.h for quality setting.

7.5 void raydium_capture_frame_now(char *filename):

Same as raydium_capture_frame(), but without waiting the end of the frame,
saving the hardware color buffer, whatever it contains. Use with caution.

7.6 void raydium_capture_frame_jpeg_now(char *filename):

Same as above, but using JPEG image format.

7.7 void raydium_capture_filename_auto(char *dest,char *format):

Internal Use. Generates filenames for new screenshots.

7.8 void raydium_capture_frame_auto(void):

Capture the current frame giving the resulting file and automatic name.

7.9 void raydium_capture_frame_jpeg_auto(void):

Same as above, but using JPEG image format.


8 Background:

8.1 void raydium_background_color_change (GLfloat r, GLfloat g, GLfloat b, GLfloat a):

Will change raydium_background_color array and apply this modification.
(will update fog color, obviously).


9 Frame clearing:

9.1 void raydium_clear_frame (void):

You need to call this function every frame to clear all hardware buffers.

9.2 void raydium_clear_color_update (void):

Will apply background color modification. Probably useless for you.


10 Lights:

10.1 Introduction to Raydium light system:

When we starts Raydium development, the main idea was to use native OpenGL
lights, and not lightmaps or another method.

This method (native lights) provides 8 simultaneous movable lights,
and is quite effective with recent OpenGL hardware.

You can modify intensity, position, color, you can turn on any light at
any time, make them blinking... Mixing all theses features can result
many effects, as realtime sunset, flashing lights for cars, explosions, ...

Usage is very easy: no need to create lights, just turn them on.

See also: LightMaps

10.2 void raydium_light_enable (void):

Obvious.

10.3 void raydium_light_disable (void):

Obvious.

10.4 signed char raydium_light_texture(int texture, signed char enable):

Texture l will not use lighting if enable is set to 0. Call this
function before loading any object using this texture, because
of display lists. Same way, it's not possible to change back this value
after the first object drawing without disabling display lists.

10.5 signed char raydium_light_texture_name(char *name, signed char enable):

Same as above, but using texture name.

10.6 GLuint raydium_light_to_GL_light (GLuint l):

Probably useless for end user. (internal uses)

10.7 void raydium_light_on (GLuint l):

Turns l light on ( 0 <= l <= RAYDIUM_MAX_LIGHTS )

10.8 void raydium_light_off (GLuint l):

Turns l light off

10.9 void raydium_light_switch (GLuint l):

Will swith l light state (from "on" to "off", for example).

10.10 void raydium_light_update_position (GLuint l):

Updates raydium_light_position[l] array changes to hardware.
This function is now used internaly by Raydium,
so you have no reasons to call it by yourself.

10.11 void raydium_light_update_position_all (void):

See above.

10.12 void raydium_light_update_intensity (GLuint l):

See above.

10.13 void raydium_light_update_all (GLuint l):

See above.

10.14 void raydium_light_move (GLuint l, GLfloat * vect):

Moves light to position vect for light l (vect is GLfloat[4]: x,y,z,dummy).

Just move your lights before camera placement, or your changes
will be applied to the next frame only.

10.15 void raydium_light_reset (GLuint l):

This function will restore all defaults for l light.

10.16 void raydium_light_blink_internal_update (GLuint l):

Useless for end-user.

10.17 void raydium_light_blink_start (GLuint l, int fpc):

Makes l light blinking at fpc (frames per cycle) rate.
This function will use timecalls soon ("fpc" -> "hertz")

10.18 void raydium_light_callback (void):

Useless for end-user.


11 Keyboard & keys:

11.1 void raydium_key_normal_callback (GLuint key, int x, int y):

Internal callback.

11.2 void raydium_key_special_callback (GLuint key, int x, int y):

Internal callback.

11.3 void raydium_key_special_up_callback (GLuint key, int x, int y):

Internal callback.

11.4 int raydium_key_pressed (GLuint key):

Will return state of key in the raydium_keys[] array.
This function is usefull to test keyboard from PHP, since RayPHP doest not
support array for now.


12 Mouse:

12.1 Introduction:

Mouse API is almost explainded at the top of this guide, but here it
is some other usefull functions (macros, in fact).

12.2 raydium_mouse_hide() (macro):

Hides mouse cursor.

12.3 raydium_mouse_show() (macro):

Shows mouse cursor.

12.4 void raydium_mouse_move(int x, int y):

Moves cursor to (x,y) position (in pixel).
Example if you want to move cursor at window's center:
raydium_mouse_move(raydium_window_tx/2, raydium_window_ty/2);


12.5 signed char raydium_mouse_isvisible(void):

Returns true or false (0 or 1), if the mouse is visible or not.
See raydium_mouse_show() and raydium_mouse_hide() above.

12.6 void raydium_mouse_init (void):

Internal use.

12.7 void raydium_mouse_click_callback (int but, int state, int x, int y):

Internal callback.

12.8 void raydium_mouse_move_callback (int x, int y):

Internal callback.

12.9 int raydium_mouse_button_pressed (int button):

returns button state. (See first part of this document)

12.10 Mouse Wheel:

To get the mouse wheel status you have to check directly the variable
raydium_mouse_click.
-Value 4 means "mouse wheel up".
-Value 5 means "mouse wheel down".
Usage example:
if (raydium_mouse_click==4)
zoom*=1.1f;
if (raydium_mouse_click==5)
zoom*=0.9f;

This piece of code will change the value of zoom according mouse wheel.

12.11 void raydium_mouse_grab_delta(int *x, int *y):

This function will "grab" the mouse and return mouse moves since last call.
Output parameters x and y will gives you the delta.

You can yse this function for any "FPS like" mouse look controls, or any other
situation where you need to known how far the user moves the mouse since
the last frame.

This function now use a box model, so its compliant with all window sizes,
even odd ones.


13 Textures:

13.1 Introduction:

For now, Raydium only handles TGA uncompressed texture.
As explainded in the first part of this guide, Raydium provides three
texture filters (none, bilinear, trilinear using MipMaps ).

Texture sizes must be a power of two, 8 (alpha mask), 24 (RGB) or 32 (RGBA) bits.

Raydium supports simple color materials, using a "rgb(r,g,b)" string
as texture name, where r, g and b are 0 <= x <= 1 (floats).
With 3 negative values, you will generate a "phantom texture". Phantom textures
are only drawn into the z-buffer (and not color buffer).
Texture clamping and advanced multitexturing effects are supported by Raydium,
but not fully documented here for now.
A few quick tips:
- "BOX" filename prefix (ex: BOX_foo.tga) is used as a clamp-to-edge attribute.
- "HDR" prefix is used to set a texture as a "light emitter" (sky, lamp, ...)
- "ENV" prefix is used for environment (sphere) mapping.
- "ATM" prefix is used for "Alpha-Tested Magnification" vector textures.
- ";" operator is used for basic multitexturing in TRI files.
- "|" operator for UV coords with multitextured lines in TRI files.
- "#" operator is used for environnement mapped multitexturing in TRI files.

A few things about the last operator, "#":
Effective environment mapping (one pass, two texture units) is available using
a special filename separator for texture field in TRI files : #
See this example:
0.232258 0.225387 -0.149804 0.012198 -0.274925 0.961388 0.731411 0.980236 fiesta_diffuse.tga#ENV_map.tga
Environment texture name must start with "ENV" to allow spherical mapping, wich
is needed for such effect. See also RAYDIUM_RENDER_REFLECTION_FACT in
file common.h if you want reflection to be more or less visible.

This separator can also be used for shaders, to load multiple textures in the
hardware (up to RAYDIUM_RENDER_MAX_TEXUNITS on the same line of the tri file).

For more informations about other operators and prefixes, you may have a look
at the Wiki or at engine's source code.

13.2 signed char raydium_texture_size_is_correct (GLuint size):

Returns true if size is a correct texture size, depending of
hardware capacities and "power of 2" constraint.

13.3 GLuint raydium_texture_load_internal(char *filename, char *as, signed char faked, int faked_tx, int faked_ty, int faked_bpp, int or_live_id_fake):

Internal use.

13.4 GLuint raydium_texture_load (char *filename):

Loads "filename" texture into hardware memory. Function results
texture index, but in most cases, you can identify later a texture
by his name, without providing his index, so you can probably ignore
this value.

0 is returned if texture loading have failed.

13.5 GLuint raydium_texture_load_erase (char *filename, GLuint to_replace):

Same as above, but to_replace texture (index) is erased with filename.

13.6 void raydium_texture_free(int number):

experimental function to free textures

13.7 void raydium_texture_free_name(char *name):

experimental function to free textures by its name

13.8 int raydium_texture_is_slot_used(int slot):

Returns true (1) if the texture slot is used for a texture, and
therefore, valid.

13.9 int raydium_texture_get_next_free_slot_internal(void):

Internal use. Will search a new free texture slot.

13.10 signed char raydium_texture_current_set (GLuint current):

Switch active texture to "current" index. Mostly used for runtime object
creation:
"set current texture, add vertices, set another texture,
add vertices, ... and save all to an objet"
(see below for vertices management).

13.11 signed char raydium_texture_current_set_name (char *name):

Same as above, but using texture name. This function will load name
if not alread done.

13.12 GLuint raydium_texture_find_by_name (char *name):

Returns index for texture "name", and load it if not already done.

13.13 GLint raydium_texture_exists(char *name):

Same as above, but don't load texture if name isn't already loaded and
then returns -1. Returns texture id otherwise.

13.14 void raydium_texture_npot_enable(void):

You can allow the load of Non-power-of-two textures with this function.

13.15 void raydium_texture_npot_disable(void):

Function to disabled the previous behaviour. By default Raydium already
has this behaviour disabled.

13.16 void raydium_texture_filter_change (GLuint filter):


Change texture filter. The new filter will apply on all "next" textures,
but will not change already loaded ones (this was the case in old Raydium
releases), since it may generate strange bugs with dynamic (aka "faked")
textures, and it was very slow.

// will switch to bilinear filter for next textures
raydium_texture_filter_change(RAYDIUM_TEXTURE_FILTER_BILINEAR)


13.17 void raydium_texture_compression(signed char enable):

This function allows Raydium to compress textures if hardware supports this
feature. You can also use the "--compress" command line switch.
The default is 0 ("no").


14 Rendering:

14.1 Introduction:

render.c contains Raydium rendering core, so only "public" and
interesting function will be documented.

A few variable may be very useful here. First, you can see how many frames
were rendered during last second, reading raydium_render_fps (interger,
read only). This variable is refreshed every second. If you need a
instantaneous measure, see below.

You may also read raydium_frame_time (float, read only) since it gives you
the elasped time during the last frame ! (in seconds). This a very easy way
to make framerate independent things. See this example, featuring two different
uses of this variable:
void display(void)
{
static float posx=0;
float speed=10; // our object should move of 10 units per second
static float time_elasped_in_seconds=0;
...
posx = posx + (speed * raydium_frame_time);
time_elasped_in_seconds+=raydium_frame_time;
...
}


Note that you can have instantaneous framerate with, for instance:
float fps=(1.f)/raydium_frame_time;


As a note, I must said that it' obvious for me that many parts of render.c
have to be rewritten (tips: slow, buggy, old, ... :)

14.2 void raydium_render_lightmap_color(GLfloat *color):

You may force a new lightmap rendering color "filter" anytime with this
function, allowing advanced lighting effects.
HUGE WARNING: You must turn off display lists if you change this value after
first object's render.
See raydium_rendering_displaylists_disable() if needed.

14.3 void raydium_render_lightmap_color_4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a):

Same as above, using 4 values.

14.4 int raydium_rendering_prepare_texture_unit (GLenum tu, GLuint tex):

This function will "prepare" hardawre texture unit tu to render tex texture.
There almost no reason to call this function by yourself.

14.5 void raydium_rendering_internal_prepare_texture_render (GLuint tex):

Same as above, but for texture unit #0 only.

14.6 void raydium_rendering_internal_restore_render_state (void):

Internal. Deprecated.

14.7 void raydium_rendering_from_to_simple(GLuint from, GLuint to):

Same as raydium_rendering_from_to(), but only with vertices (no
UV, no normals, no textures, no colors, ...).
Mostly used for internal shadow maps creation.

14.8 void raydium_rendering_from_to (GLuint from, GLuint to):

Renders vertices from from to to.
Using object management functions is a better idea.

14.9 void raydium_rendering (void):

Renders all vertices (probably useless, now).

14.10 void raydium_rendering_finish (void):

You must call this function at the end of each frame. This will flush all
commands to hardware, fire a lot off callbacks, and prepare next frame.

14.11 void raydium_rendering_wireframe (void):

Switch to wireframe rendering.

14.12 void raydium_rendering_normal (void):

Switch back to standard rendering.

14.13 void raydium_rendering_rgb_force (GLfloat r, GLfloat g, GLfloat b):

Force all RGB colored vertices to take (r,g,b) color. One example of this
use is for making "team colored" cars : Do not apply textures to some faces
while modelling, and force to team color each time you render a car.

14.14 void raydium_rendering_rgb_normal (void):

Disable "rgb force" state. See above.

14.15 void raydium_rendering_displaylists_disable(void):

Disable display lists usage.
Some old video cards and broken drivers may get better performances WITHOUT
display lists (on large objects, mainly).

14.16 void raydium_rendering_displaylists_enable(void):

Enable display lists usage. default state.

14.17 void raydium_render_fps_limit(float maxfps):

This function changes the maximum number of frames per second.
Sometimes is wanted to reduce the consumption of cpu cycles by our application.
In this situations we can use a method for delay each frame of the game
until a desired framerate. In that way the residual frames won't be processed
and a "lot" of cpu cycles will be saved.
Also can be used to increase the stability in certains systems.
Set maxfps to 0 if you want to disable this limit (this is the default).


15 Particle engine:

15.1 Introduction:

This is the second version of Raydium's particle engine. This engine is build
on top of a dedicated file format (.prt and .sprt files), describing most
(up to all, in facts) properties of generators.
It probably better to start by an example (fountain.prt) :
// Simple blue fountain (change 'vector' if needed)
ttl_generator=5;
ttl_particles=1.5;
ttl_particles_random=0;
 
particles_per_second=200;
 
texture="flare_nb.tga";
 
size=0.1;
size_inc_per_sec=0.1;
 
gravity={0,0,-5};
vector={0,0,4};
vector_random={0.2,0.2,0.2};
 
// RGBA
color_start={0.6,0.6,1,0.5};
color_start_random={0,0,0.2,0};
color_end={1,1,1,0.1};
 
// end of file. 
 


.prt files are readed using parsing functions (see appropriate chapter, if
needed), and the list of all available properties can be found in particle2.c
source file. A full toturial is also available on Raydium's Wiki.

Once the particle file is written, you only need to load the file using the
suitable function (see below). Some anchor are available to link generators to
physic entities, if needed, as callbacks for a few events (one, for now).

.sprt files are used to create a "snapshot" of particles, used for example by
3D captures, and are not meant to be edited by hand.

15.2 void raydium_particle_name_auto (char *prefix, char *dest):

Will generate a unique string using prefix. The string is created using
space provided by dest.
You can use this function when building a new generator.

15.3 void raydium_particle_init (void):

Internal use.

15.4 signed char raydium_particle_generator_isvalid (int g):

Internal use, but you can call this function if you want to verify if a
generator's id is valid (in bounds, and loaded).

15.5 int raydium_particle_generator_find (char *name):

Lookups a generator using is name. Returns -1 if name is not found.

15.6 int raydium_particle_find_free (void):

Finds a free particle slot.

15.7 void raydium_particle_generator_delete (int gen):

Deletes a generator.

15.8 void raydium_particle_generator_delete_name (char *gen):

Same as above, but using generator's name.

15.9 void raydium_particle_generator_enable (int gen, signed char enabled):

Activate a disabled generator (see below).

15.10 void raydium_particle_generator_enable_name (char *gen, signed char enable):

Disable a generator (TTL is still decremented).

15.11 void raydium_particle_preload (char *filename):

Loads .prt file and associated textures into suitable caches.
Call this function if you want to avoid (small) jerks caused by "live"
loading a generator.

15.12 void raydium_particle_generator_load_internal (int generator, FILE * fp, char *filename):

Internal use.

15.13 int raydium_particle_generator_load (char *filename, char *name):

Loads generator from filename as name. This name will be used for
future references to this generator, as the returned interger id.

15.14 void raydium_particle_generator_update (int g, GLfloat step):

Internal use.

15.15 void raydium_particle_update (int part, GLfloat step):

Internal use.

15.16 void raydium_particle_callback (void):

Internal use.

15.17 int raydium_particle_state_dump(char *filename):

Dumped current particles to filename (.sprt [static particles]).

15.18 int raydium_particle_state_restore(char *filename):

Append .sprt filename to current scene.

15.19 void raydium_particle_draw (raydium_particle_Particle * p, GLfloat ux, GLfloat uy, GLfloat uz, GLfloat rx, GLfloat ry, GLfloat rz):

Internal use.

15.20 void raydium_particle_draw_all (void):

Internal use.

15.21 void raydium_particle_generator_move (int gen, GLfloat * pos):

Moves gen generator to pos position (3 * GLfloat array).

15.22 void raydium_particle_generator_move_name (char *gen, GLfloat * pos):

Same as above, but using generator's name.

15.23 void raydium_particle_generator_move_name_3f (char *gen, GLfloat x, GLfloat y, GLfloat z):

Same as above, using 3 different GLfloat values.

15.24 void raydium_particle_generator_particles_OnDelete (int gen, void *OnDelete?):

Sets a callback for gen, fired when any particle of this generator is
deleted, providing a easy way to create "cascading" generators.
The callback must respect the following prototype:
void cb(raydium_particle_Particle *)

Do not free the provided particle.

15.25 void raydium_particle_generator_particles_OnDelete_name (char *gen, void *OnDelete?):

Same as above, but using generator's name.

15.26 void raydium_particle_scale_all(GLfloat scale):

Will scale all particles with scale factor. Use with caution.
Default is obviously 1.


16 Callbacks:

16.1 Introduction:

This file contains many initializations, a few internal callbacks, but
will provides a very important function for end-user, wich will
gives user display function to Raydium: see below

16.2 void raydium_callback_image (void):

Internal use.

16.3 void raydium_callback_set (void):

Internal use.

16.4 void raydium_callback (void (*loop)):

This function will loop over the provided display function, indefinitely.
"loop" must be:
void loop(void)


16.5 void raydium_callback_display_set(void (*fdisplay)):

This function will install display callback but don't enter in an infinite loop.
fdisplay is user display function.
"fdisplay" must be:
void fdisplay(void)


16.6 void raydium_loop(void):

Run raydium once. This function needs to be called periodically.
This function return after loop completion.
It is usefull to integrate raydium loop in another program.


17 Normals:

17.1 Introduction:

This file provides some usefull functions for normal generation and smoothing.
You can find some more informations about normals at the top of this guide.
It now provide a few functions about tangent vectors smoothing.

17.2 void raydium_normal_generate_lastest_triangle (int default_visu):

Generate normals for the last created triangle (see raydium_vertex_index)
if default_visu is true ( != 0 ), this function will restore "visu"
normals too.

17.3 void raydium_normal_generate_lastest_tangent(void):

Generate tangents for the last created triangle. Internal use.

17.4 void raydium_normal_restore_all (void):

This function restore visu normals with standard ones (raydium_vertex_normal_*)

17.5 void raydium_normal_regenerate_all (void):

This function will regenerate standard and visu normals for the whole
scene (ground, objects, ...).

17.6 void raydium_normal_internal_smooth_generic(char *type,GLuint from, GLuint to,GLfloat *in_x, GLfloat *in_y, GLfloat *in_z,GLfloat *out_x, GLfloat *out_y, GLfloat *out_z):

Internal. Generic smoothing function.

17.7 void raydium_normal_smooth_all (void):

This function will smooth the whole scene, using adjacent vertices.
Note this function can take a lot of time.

17.8 void raydium_normal_smooth_from_to(GLuint from, GLuint to):

Same as above, but only from from vertex to to vertex (excluded).
In other words: will smooth [from;to[

17.9 void raydium_normal_tangent_smooth_all (void):

Same as raydium_normal_smooth_all(), but for tangent vectors.

17.10 void raydium_normal_tangent_smooth_from_to(GLuint from, GLuint to):

Same as raydium_normal_smooth_from_to(), but for tangent vectors.


18 vertices:

18.1 Introduction:

You can create objets at runtime, if needed, using the following functions.
Each of theses functions adds only one vertex so, obviously, you need to
call three time the same function to add one triangle.

18.2 void raydium_vertex_add (GLfloat x, GLfloat y, GLfloat z):

Adds a vertex at (x,y,z).

18.3 void raydium_vertex_uv_add (GLfloat x, GLfloat y, GLfloat z, GLfloat u, GLfloat v):

Same as above, but providing texture mapping informations with u and v.

18.4 void raydium_vertex_uv_normals_add (GLfloat x, GLfloat y, GLfloat z, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat u, GLfloat v):

Same as above, giving vertex's normal with (nx,ny,nz).


19 Land:

19.1 Introduction:

Historically, this file was quite complex, since Raydium was using
his own physic. Now, this file is almost empty, since ODE integration
now provides new landscape functions.


20 Sky and environement boxes:

20.1 Introduction:

Skyboxes are mostly automated.

Currently, Raydium will use BOXfront.tga, BOXback.tga, BOXleft.tga,
BOXright.tga, BOXbottom.tga and BOXtop.tga as default skybox
and will draw a skybox only if fog is disabled (this is not for technical
reasons, but only for realism, just think about it ;)... but you can force
skybox with fog using raydium_sky_force if you really want).

See raydium_sky_box_name() if you want to change default skybox.

20.2 void raydium_sky_box_cache (void):

Internal use. Will init default skybox.

20.3 void raydium_sky_box_cache (void):

As skybox texture are sometimes large files, you can pre-load skybox
with this function. If you don't do it, Raydium will load textures
during the first frame of your application.
Calling this function will automatically define sky as a HDR emitter.
See HDR chapter for more information.

20.4 void raydium_sky_box_render (GLfloat x, GLfloat y, GLfloat z):

Internal use.

20.5 void raydium_sky_sphere_render(GLfloat x, GLfloat y, GLfloat z, int detail):

Internal use.
Calculates and draw the sphere. Also rotate it according the angles or orbit.

20.6 void raydium_sky_enable(void):

Allows to render the sky at background.

20.7 void raydium_sky_disable(void):

Disable the render of sky at background.

20.8 int raydium_sky_check(void):

Returns 1 if the sky is going to be drawn at background or 0 if not.

20.9 Atmosphere:

Atmosphere are series of effects that intend to make the sky and the atmosphere
of the game more realistic. As this is quite-beta state, only a orbital sky
effect is available right now.
To activate/deactivate this series of effects, you should use:
raydium_sky_atmosphere_enable and raydium_sky_atmosphere_disable
respectively.
If you need to check if the atmosphere is activated or not, use
raydium_sky_atmosphere_check. The rest of the functions are internal
and should not used by normal programs.

20.10 void raydium_sky_atmosphere_enable(void):

turn on the use of atmosphere effects.
This one and _disable function a program should use, the other
raydium_sky_atmosphere_ are internal ones.

20.11 void raydium_sky_atmosphere_disable(void):

turn off the use of atmosphere effects.

20.12 void raydium_sky_atmosphere_render(GLfloat x, GLfloat y, GLfloat z,int detail):

Internal use. This internal function draws the atmosphere effects. Right
now only draws a rotating sphere with a gradient of color (from black to white).
In a future, it will draw multiples layers of sky (with and without textures),
stars, satellites... Maybe rain and snow could be included here also.

20.13 signed char raydium_sky_atmosphere_check(void):

This functions only check if the atmosphere features are been used.
Returns 1 if they are used, else 0.

20.14 void raydium_sky_box_name(char *name):

This function allows to load custom name sky textures.
By default the names of the sky texture are:
BOXfront.tga, BOXback.tga, BOXleft.tga, BOXright.tga,
BOXbottom.tga and BOXtop.tga.

However with this function you can define your own skybox textures, with the
following name format:
BOX_<name>_front.tga, BOX_<name>_front.tga, ...

Example:
raydium_sky_box_name("mybox");
// Skybox textures will be BOX_mybox_top.tga, BOX_mybox_left.tga and so on ... 
 


This function can be called anytime, but will cancel raydium_sky_box_cache()
effect: new textures will be loaded during this function call, causing a
small freeze, and new textures will not have HDR tag.
Note that you can call raydium_sky_box_cache() again to restore HDR tags.


21 "Internal" informations access:

21.1 void raydium_internal_dump (void):

This function is now systematically called by Raydium at application's exit,
displaying some informations about loaded textures, objects, registered data,
network statistics.

21.2 void raydium_internal_dump_matrix (int n):

Dumps matrix to console.
n values are:
0 for GL_PROJECTION_MATRIX
1 for GL_MODELVIEW_MATRIX



22 Files (generic):

22.1 Introduction:

File support is now splitted in two parts: generic functions and TRI format
specific functions. This chapter talks about generic part, where you'll find
some libc replacements and wrappers, and functions dealing with
"private directory" of the current user.

22.2 void raydium_file_dirname(char *dest,char *from):

Reliable and portable version of libc's dirname function.
This function extracts directory from from filename, and writes it
to dest.
No memory allocation will be done by the function.

22.3 void raydium_file_basename(char *dest,char *from):

Another libc clone, for basename function. Extracts file name from a
path into dest string.

22.4 void raydium_file_ext(char *dest, char *from):

Return the extension of from filename (can be a complete path), without
the . (dot), or an empty string if extension is not found.

22.5 signed char raydium_file_isdir(char *path):

Return 1 if path is a (readable) directory, 0 otherwise.

22.6 signed char raydium_file_directory_writable(char *path):

Return 1 if path directory is writable, 0 otherwise.

22.7 signed char raydium_file_readable(char *filename):

Return 1 if filename exists and is readable, 0 otherwise.

22.8 void raydium_file_log_fopen_display(void):

Display (console) all filenames that were opened before the call.
--files command line option will call this function at the application's
exit, closed or not.

22.9 void raydium_file_cache_flush(void):

Flush files not found from log cache. Allow new attempt to open the file.

22.10 FILE *raydium_file_fopen(char *file, char *mode):

Raydium wrapper to libc's fopen function.
This function will:
- Update some stats
- Try to download the file from repositories if no local version is found, or
will try to update the file if asked (--repository-refresh or
repository-force). See R3S on Raydium's Wiki.
- You can disable R3S client (for a "local only" file) adding a 'l'
in mode ("rl" or "rbl" for example).
- Use Raydium paths (see suitable chapter)

22.11 unsigned long raydium_file_sum_simple(char *filename):

This function will generate a very simple checksum on filename.

22.12 unsigned long raydium_file_sum_simple_mode(char *filename,char *mode):

Same as above, but you can pass a fopen mode ("rt", or "rbl" for example).
See raydium_file_fopen() for more informations about mode.

22.13 char * raydium_file_home_path(char *file):

This function will return an absolute file path for file in the home
directory of the current user.
Returned value is a pointer to static memory. Do not free this memory and use
it before any other call to this function, since it will be overwritten.
Example:
for test.cfg, this function will return /home/me/.raydium/test.cfg
See also raydium_init_args_name() if you want to tune this result.

22.14 void raydium_file_home_path_cpy(char *file, char *dest):

Same as above, but you must provide memory with dest.

22.15 char *raydium_file_load(char *filename):

This function loads filename (as a binary file under win32, no matter
under Linux) in a string, and returns its address. You must free this
memory when finished.

22.16 int raydium_file_binary_fgets(char *dest, int max, FILE *stream):

Binary version of LIBC's fgets. Read a maximum of max bytes from
stream, including terminating 0 character, to dest buffer, and stops
at the first 0 found or at EOF.
No memory allocation is done, and string is always terminated by a 0.
Returns the length of the readed string (without terminating 0).

22.17 int raydium_file_utime(const char *filename, struct utimbuf *times):

Portable version of utime(), since win32 version of this function is unable
to deal with directories.
From man page: This function shall set the access and modification times of
the file filename.
Upon successful completion, 0 shall be returned. Otherwise, -1. Errno is set.

22.18 signed char raydium_file_rm_rf(char *path):

This a RECURSIVE rmdir function, deleting ALL FILES in path directory,
and the directory himself. Of course, this function is not interactive, and
will delete all in a blink of an eye, even if you ask "/" deletetion.
You should not use this function, in facts.
Note that the code is symlink aware and quite error proof. (sort of. perhaps.)


23 Files (TRI format):

23.1 Warning:

It's important to use only functions with raydium_file_* prefix.
All other functions may change or disappear. Upper level functions are
available (see object.c).

23.2 Introduction:

file.c use .tri mesh files (text), available in 4 versions:

1. version 1: providing normals and uv texture mapping informations.
2. version 0: providing uv texture mapping.
3. version -1: only providing vertices.
4. version 2: mesh animation support

Version 1 example file:
1
5.1 15.75 -3.82 0.0000 0.0000 -1.0000 0.5158 0.5489 rgb(0.5,0.5,0.5)
6.3 11.75 -3.82 0.0000 0.0000 -1.0000 0.5196 0.5365 rgb(0.5,0.5,0.5)
5.0 11.75 -3.82 0.0000 0.0000 -1.0000 0.5158 0.5365 rgb(0.5,0.5,0.5)
...


You can find the file version on first line, and then data.
Next lines: vertex position (x,y,z), normal (x,y,z), texture mapping (u,v)
and texture (string).

Version 2 files are a bit different, as showed below:
2
3 1743
0 39 stand
40 45 run
46 53 attack
1
5.1 15.75 -3.82 0.0000 0.0000 -1.0000 0.5158 0.5489 rgb(0.5,0.5,0.5)
6.3 11.75 -3.82 0.0000 0.0000 -1.0000 0.5196 0.5365 rgb(0.5,0.5,0.5)
5.0 11.75 -3.82 0.0000 0.0000 -1.0000 0.5158 0.5365 rgb(0.5,0.5,0.5)
...


You may have seen that headers are longer for v2 files. You'll find (just
after the version number) how many "anims" are hosted by this file, and how
many vertices are required for one frame. Then you'll find one line per
"anim", with starting frame, ending frame and anim's name.
Then starts a regular tri file ("sub-file", with its own version number)
with ALL concatened frames.

23.3 void dump_vertex_to (char *filename):

This function save all scene to filename (.tri file) in version 1.
Vertice may be sorted.
Please, try to do not use this function.

23.4 void dump_vertex_to_alpha (char *filename):

Now useless and deprecated.

23.5 int raydium_file_set_textures (char *name):

Internal use.
This function analyze texture filename, and search for extended multitexturing
informations (u,v and another texture).

23.6 int read_vertex_from (char *filename):

Loads filename. Again, avoid use of this function.
return 0 if filename access error/ 1 if load successfull


24 File path:

24.1 Introduction:

When raydium_file_fopen() is called, by Raydium or by an application,
the Path API is used to search the file.
When the file is open for writing, Raydium will check if the current working
directory is writable. If this is not the case, Raydium will try to write the
file in the user home directory (~/.appname/data/), and will create it if
needed.
For reading, Raydium will also use the current directory first, and then
will search in a list of directories of your choice (see example below).
The user home directory is registered by default in this list.

Now, the search patch system is able to work even if the '/' character is
present in the requested filename, so you can use subdirectories if needed.

Each path can have a priority (lower is better).
Application local directory have highest structural priority.
Path add by user have default 2 priority.
Packages have a priority of 5. Packages files are searched just after local directory.
~/.appname/data have lowest priority of 7

Raydium now features a data package system, so you can store some files in
a regular ZIP file (with subdirectories if you want) and then register this
package in your application. Raydium will then automatically search files
in the ZIP.

24.2 Example of directory registering::

raydium_path_ext("./media/textures/","tga");
raydium_path_ext("./media/fonts/","tga");
raydium_path_ext("./media/shaders/","vert");
raydium_path_ext("./media/shaders/","frag");
raydium_path_ext("./media/meshes/","tri");
raydium_path_ext("./media/themes/","gui");
raydium_path_ext("./media/particles/","prt");
raydium_path_ext("./media/cars/","car");
raydium_path_ext("./media/cams/","cam");
raydium_path_add("./media/"); // "unsorted" files 
 


24.3 int raydium_path_find_free(void):

Internal (search a free path slot).

24.4 signed char raydium_path_ext(char *dir, char *ext):

Register dir directory for files with ext extension.
Return 0 when it fails.

24.5 signed char raydium_path_ext_priority(char *dir,char *ext,int priority):

Register dir directory for files with ext extension.
Can specify path priority (1 is highest priority).
Return 0 when if fails.

24.6 signed char raydium_path_add(char *dir):

Register dir directory.
Return 0 when it fails.

24.7 signed char raydium_path_find(char *pathfolder):

Returns 1 if the indicated folder is already in the path.

24.8 signed char raydium_path_add_priority(char *dir, int priority):

Register dir directory.
Can specify priority (1 is highest priority).
Return 0 when it fails.

24.9 signed char raydium_path_write(char *dir):

Change the writing directory to dir directory. You should probably also
register this new directory, using raydium_path_add().

24.10 signed char raydium_path_string_from(char *str):

Reset all registrations (only current directory stays) and replace it with the
provided formated string. Here it is an example for such string:

/home/xfennec/.myapp/data:./media/textures/X.tga:./media/fonts/X.tga:
./media/shaders/X.vert:./media/shaders/X.frag:./media/meshes/X.tri:
./media/themes/X.gui:./media/particles/X.prt:./media/cars/X.car:
./media/cams/X.cam:./media

(do not include line feeds and replace 'X' by '*')

This string is based on the example at the top of this chapter.

24.11 int raydium_path_string_to(char *out):

Dumps all registrations to out string.

24.12 void raydium_path_resolv(char *in, char *out, char mode):

Internal (find the best absolute path for the requested file).

24.13 void raydium_path_dump(void):

Dumps read and write paths to console.

24.14 void raydium_path_reset(void):

Reset all registrations.
You should probably better use raydium_path_string_from().

24.15 void raydium_path_write_local_deny(signed char deny):

By default, Raydium always tries to write in the local directory (binary's
directory, in other words), and if it's not possible, did it in the registered
writing directory. Using this function (with deny=1) will force Raydium to use
the second option each time. Then Raydium will never write to local directory.

24.16 void raydium_path_init(void):

Internal.

24.17 int raydium_path_package_find(char *name):

Return path index associated with package name name.

24.18 int raydium_path_package_find_free(void):

Return free package slot.
Return -1 if RAYDIUM_MAX_PACKAGES_FILES already registered.

24.19 signed char raydium_path_package_register(char *file):

Call this function to register a new ZIP package (note that you can change
the file extension if you want). All files in the archive will be available
to the application with no other change !

This feature is R3S compliant, so the ZIP file may be downloaded automatically.

There's no persistence, you should register your packages at every run. A cache
system makes the proccess very quick, as file access. Any change made to the
registered ZIP file discards the cache automatically.

Package have a default 'Middle' priority of 5 -> File are first searched
in local directory, then in path added explicitly by user and then in package file.


24.20 signed char raydium_path_package_internal_add(char * file):

Internal. Add a package to list of registered package.

24.21 void raydium_path_package_mode(char * name,unsigned char mode):

Define package mode: RAYDIUM_PACKAGE_READONLY / RAYDIUM_PACKAGE_READWRITE
With RAYDIUM_PACKAGE_READWRITE all opened files are automaticaly added/refreshed
in package at application exit.
Package mode is written in package file.
To modify package mode use console within the application.

24.22 signed char raydium_path_package_cache_clear(void):

This function will clear the packages cache, and exit the application (for
some reasons, including laziness).
There's no reason to call this function, cache is managed by Raydium itself.
But you can use it to clear all old useless cache entries and get a bit more
free disk space, why not.


25 Camera:

25.1 Introduction:

Raydium provides camera management functions, allowing the coder to
move camera with very simple functions, even for complex moves.
You have to place your camera once per frame (not more, not less).

"look_at" style functions can be affected by raydium_camera_look_at_roll
global variable, if needed.

A few words about camera path: Take a look to a .cam file if you want to
understand this simple file format, but you probably only need the cam.c
application, dedicated to camera path creation.

Some camera functions are provided by physics module, see suitable chapter.

25.2 void raydium_camera_vectors (GLfloat * res3):

This function will return two vectors (2 * 3 * GLfloat), giving the camera
orientation (front vector and up vector). At this day, the up vector is
always the same as the world up vector, even if the camera is rotated
or upside down (and yes, this MUST be corrected :).

Designed for internal uses, before all.

25.3 void raydium_camera_internal_prepare(void):

Internal use. (pre)

25.4 void raydium_camera_internal (GLfloat x, GLfloat y, GLfloat z):

Internal use. (post)

25.5 void raydium_camera_place (GLfloat x, GLfloat y, GLfloat z, GLfloat lacet, GLfloat tangage, GLfloat roulis):

Sets the camera at (x,y,z) position, and using (lacet,tangage,roulis)
as rotation angles.

25.6 float *raydium_camera_get_data(void):

Function to get the data of the camera in an array of 6 floats.
The first 3 values are the position like x,y,z in universal coordinates.
The next 3 are the rotation angles like r,s,t in degrees and universal orientation.
example:
float *camdata;
...
camdata=raydium_camera_get_data();
raydium_log("pos: %f %f %f rotation: %f %f %f",camdata[0],camdata[1],
camdata[2],camdata[3],camdata[4],camdata[5]);
...

Returned data is related to the current frame.

25.7 void raydium_camera_look_at (GLfloat x, GLfloat y, GLfloat z, GLfloat x_to, GLfloat y_to, GLfloat z_to):

Sets the camera at (x,y,z) position, and looks at (x_to,y_to,z_to).

25.8 void raydium_camera_replace (void):

You'll need to reset camera position and orientation after each object drawing.
If this is unclear to you, read the "example" section, below.

You will need to make your own 3D transformations (GLRotate, GLTranslate,
...) to draw your objects, or you can use the following function.

25.9 void raydium_camera_replace_go (GLfloat * pos, GLfloat * R):

This function will replace the camera, as raydium_camera_replace(),
but will place "3D drawing cursor" at position pos (3 GLfloat) with
rotation R (4 GLfloat quaternion).

No eulers (rotx, roty, rotz) version of this function is provided for now..
Do you really need it ?

25.10 Example of camera use:

1. place camera
2. move "drawing cursor" to object's place
3. draw object
4. reset camera to initial place (the one given at step 1)
5. move "drawing cursor" to another object's place
6. draw another object
7. [...]

Steps 4 and 5 can be done with raydium_camera_replace_go().

25.11 void raydium_camera_rumble(GLfloat amplitude, GLfloat ampl_evo, GLfloat secs):

Camera (any type) will rumble for secs seconds, with amplitude (radians).
This amplitude will be incremented of ampl_evo every second (negative
values are allowed for ampl_evo).
An amplitude is always positive.

25.12 void raydium_camera_smooth (GLfloat px, GLfloat py, GLfloat pz, GLfloat lx, GLfloat ly, GLfloat lz, GLfloat zoom, GLfloat roll, GLfloat step):

Smooth style clone of raydium_camera_look_at.
Roll is given by roll and not global variable raydium_camera_look_at_roll
as for regular look_at function.
zoom is the requested FOV.
Play with step to modify smoothing level of the movement. A good way to use
this function is the following usage :
raydium_camera_smooth(cam[0],cam[1],cam[2],pos[1],-pos[2],pos[0],70,0,raydium_frame_time*3);


25.13 void raydium_camera_path_init (int p):

Internal use.

25.14 void raydium_camera_path_init_all (void):

Internal use.

25.15 int raydium_camera_path_find (char *name):

Lookups path's id using filename name.
This function will not try to load a camera path if it's not found, and
will return -1.

25.16 int raydium_camera_path_load (char *filename):

Obvious : use this function to load a camera path.

25.17 void raydium_camera_path_draw (int p):

Draws p camera path, as red lines. This must be done at each frame.

25.18 void raydium_camera_path_draw_name (char *path):

Same as above, but using camera path's name.

25.19 signed char raydium_camera_smooth_path (char *path, GLfloat step, GLfloat * x, GLfloat * y, GLfloat * z, GLfloat * zoom, GLfloat * roll):

Returns the (x,y,z) point of the camera path for step step, using
provided zoom (FOV) and roll angle.
It's important to note that step is a float.
Mostly for internal use.

25.20 void raydium_camera_path_reset(void):

Next smooth call will be instantaneous.

25.21 void raydium_camera_smooth_path_to_pos (char *path, GLfloat lx, GLfloat ly, GLfloat lz, GLfloat path_step, GLfloat smooth_step):

"Camera on path looking at a point".
Simple raydium_camera_smooth version: give a path name, a "look_at"
point (lx,ly,lz), a current step, anda smooth_step time
factor (see raydium_camera_smooth example above).

25.22 void raydium_camera_smooth_pos_to_path (GLfloat lx, GLfloat ly, GLfloat lz, char *path, GLfloat path_step, GLfloat smooth_step):

"Camera on point looking at a path".
Same style as previous function.

25.23 void raydium_camera_smooth_path_to_path (char *path_from, GLfloat path_step_from, char *path_to, GLfloat path_step_to, GLfloat smooth_step):

"Camera on a path looking at another path".
Same style as previous functions.

25.24 void raydium_viewport_init(void):

Init of raydium_viewport array to support up to
RAYDIUM_VIEWPORT_MAX viewport

25.25 void raydium_viewport_create (char * name,int tx,int ty):

Create a texture for saving viewport display
Texture size tx and ty must be related with final displayed
viewport size.

25.26 void raydium_viewport_enable(char * name):

Direct all render operations to dedicated viewport.
Advanced camera feature as sound/rumble are desactivated during viewport render.

25.27 void raydium_viewport_save(void):

Copy viewport rendering to texture buffer.
Render operations return to normal state, with normal camera behavior.

25.28 void raydium_viewport_draw(char * name, GLfloat tx,GLfloat ty,GLfloat sx,GLfloat sy):

Draw contents of name viewport to screen
tx,ty are lower left corner in screen percents.
sx,sy are size in screen percents.

25.29 void raydium_camera_freemove(int move):

This function is a fast & easy way to create a working camera that can move
with keys and can be rotated with the mouse, like a usual camera in a
First Person Shooter(FPS) game.
Its sources could be also interesting as an example of implementation of this
kind of camera, since this function can be a bit limited if you want to do
complex things.
You can modify the global variables raydium_camera_freemove_sensibility
and raydium_camera_freemove_speed, mouse sensibility (3 default) and
movement speed (0.1 default) respectively.
If move is RAYDIUM_CAMERA_FREEMOVE_FIXED, camera is only placed and fixed.
Else if move is RAYDIUM_CAMERA_FREEMOVE_NORMAL camera position and orientation are updated with Mouse/Keyboard.

25.30 void raydium_camera_orbitmove(float x_to, float y_to, float z_to):

EXPERIMENTAL: This functions allows to rotate (in fact orbit) around a
certain point (x_to,y_to,z_to). The distance of the point to the camera
can be changed with the up/down keys and with the mouse wheel.



26 Objects:

26.1 Introduction:

With the following functions, you can easily draw and manage
mesh objects (.tri file).

26.2 GLint raydium_object_find (char *name):

Lookups an object by its name. This function will return -1 if the
object's not found, and will not try to load the .tri file.

26.3 signed char raydium_object_isvalid(int obj):

Internal use, but you can call this function if you want to verify if an
object id is valid (in bounds).

26.4 GLint raydium_object_find_load (char *name):

Same as above (raydium_object_load), but will try to load object.

26.5 void raydium_object_reset (GLuint o):

Internal use. Do not call.

26.6 int raydium_object_load (char *filename):

Load filename as a .tri file, and returns corresponding id, or
-1 in case of error.

26.7 void raydium_object_draw (GLuint o):

Draws o (index) object, using current matrixes.

26.8 void raydium_object_draw_name (char *name):

Same as above, but you only have to provide object's name (".tri file").
If this object was not already loaded, this function will do it for you.

26.9 void raydium_object_translate(GLuint obj,GLfloat tx,GLfloat ty,GLfloat tz):

Modify object center

26.10 void raydium_object_deform (GLuint obj, GLfloat ampl):

Early devel state. Useless as is.

26.11 void raydium_object_deform_name (char *name, GLfloat ampl):

Early devel state. Useless as is.

26.12 GLfloat raydium_object_find_dist_max (GLuint obj):

This function will return will return the distance form (0,0,0)
to the farest point of obj object.

26.13 void raydium_object_find_axes_max (GLuint obj, GLfloat * tx, GLfloat * ty, GLfloat * tz):

This function returns the (maximum) size of the bounding box
of obj (relative to (0,0,0)).

26.14 void raydium_object_find_minmax(GLuint obj, GLfloat *min, GLfloat *max):

Returns min and max values for obj. No memory allocation is done, you must
provide two GLfloat[3] array.

26.15 void raydium_object_find_center_factors(GLuint obj, GLfloat *tx, GLfloat *ty, GLfloat *tz):

Returns "centering" factors for obj. A centered object will return (0,0,0).

26.16 signed char raydium_object_tangent_smooth(GLuint obj):

This function is a small helper for raydium_normal_tangent_smooth_from_to(),
which will smooth all tangent informations for the object, since some shaders
needs it (Normal Mapping for example).

See suitable chapters for more information.

26.17 signed char raydium_object_tangent_smooth_name(char *obj):

Same as above, using object's name.

26.18 void raydium_object_callback(void):

Internal (frame callback).

26.19 Animations:

Raydium now supports mesh animation, thru MD2 (Quake 2) files. Raydium file
format was extended to version 2. If you want to create an animated mesh
for Raydium from a MD2 file, you may use Blender with "import-md2-0.14.py"
script ( by Bob Holcomb, http://67.22.114.230:8082/programming/blender/index.html )
and export it back to a tri file using provided "triEXP-MD2-*.py" script.
All other tasks (loading, transformations, ...) are done the same way as
regular static mesh.

For Raydium, an animation is a set of "anims", and each "anim" is a set
of "frames". Each "anim" gets its own name (see header of a version 2 file
for more informations), and since an animated object may be use for many
players, Raydium provides an "instances" based system: setting things like
anim and frame for an object is done only for one instance of this object.
Instances are always available, no need to create or declare them.
That's all you need to use animation simple API.

26.20 GLint raydium_object_anim_find(int object, char *name):

Lookups an animation by its name. This function will return -1 if the
animation's not found. Mostly for internal use.

26.21 void raydium_object_anim_generate_internal(int object, int instance):

Internal. Transformed mesh generation.

26.22 void raydium_object_anim_frame(int object, int instance, GLfloat frame):

Sets current frame for one instance of object. frame is
automatically bounded and looped.
Warning, change anim before anim's frame.

26.23 void raydium_object_anim_frame_name(char *object, int instance, GLfloat frame):

Same as above, but using object's name.

26.24 void raydium_object_anim(int object, int instance, int anim):

Sets current anim for one instance of object.
Again, change anim before anim's frame.

26.25 void raydium_object_anim_name(char *object, int instance, char *anim):

Same as above, but using object's name and anim's name.

26.26 void raydium_object_anim_instance(int object, int instance):

With this function, you must set what instance will be drawn when
raydium_object_draw() will be called with object argument.

Default is set to instance 0.

26.27 void raydium_object_anim_instance_name(char *object, int instance):

Same as above, but using object's name.

26.28 void raydium_object_anim_automatic(int object, int anim, GLfloat factor):

With this function, you can set an automatic frame increment for a specific
anim of an object. This increment is based on frame time and factor.

26.29 void raydium_object_anim_automatic_name(char *object, char *anim, GLfloat factor):

Same as above, but using object's name and anim's name.

26.30 "Punctually" anims:

When using animations, you're switching for an "anim" to another, and an
"anim" will loop forever. "Punctually" support will allow you to set a
default "anim" for an object and to do switch punctually to another "anim",
and automatically return back to default value when this "anim" is finished,
usefull for animations like jumps, kick, ...

26.31 void raydium_object_anim_default(int object, int anim):

This function will set default anim for object.

26.32 void raydium_object_anim_punctually(int object, int anim, int instance):

This function will trigger a punctually anim for object's instance.

26.33 void raydium_object_anim_punctually_name(char *object, char *anim, int instance):

Same as above, but with object's name.

26.34 signed char raydium_object_anim_ispunctually(int object, int instance):

Will return true (1) if object is currently running a punctually animation,
or false (0) otherwise.

26.35 signed char raydium_object_anim_ispunctually_name(char *object, int instance):

Same as above, but with object's name.


27 Initialization:

27.1 Introduction:

This file is mainly designed for internal uses, but there's anyway
some interesting functions.

27.2 char *raydium_version(void):

Return Raydium Engine version as a static string. Format is "x.yyy".
You can also find defines for this, named RAYDIUM_MAJOR (x)
and RAYDIUM_MINOR (yyy).

27.3 void raydium_init_lights (void):

Internal use. Must be moved to light.c.

27.4 void raydium_init_objects (void):

Internal use. Must be moved to object.c.

27.5 void raydium_init_key (void):

Internal use. Must be moved to key.c.

27.6 void raydium_init_reset (void):

This function is supposed to reset the whole Raydium engine:
textures, vertices, lights, objects, ...
Never tested yet, and probaly fails for many reasons when called more than
one time.

27.7 void raydium_init_engine (void):

Internal use. Never call this function by yourself, it may cause
huge memory leaks.

27.8 int raydium_init_load(char *filename):

This function is used to load a configuration file, filename, and then it
will do automatically all initialization of the application (window size,
title, lights, skybox, ...)

The filename config file must follow the "variable=value;" pattern, one
variable per line. It allows comments (with double slash). See chapter about
text file parsing for more information about syntax.

If the file does not exists (local or R3S servers), Raydium will create a
default one.

A list of all settings will follow here, soon.

It returns 1 if the load process ends correctly, or 0 is something was wrong.


28 Command Line Interface:

28.1 Introduction:

Here, you'll find a few functions to deal with command line
interface of Raydium.

You can use --help command line switch to see a list of all supported switches
for the engine. This help command will not show application specific switches that
you may add.

28.2 int raydium_init_cli_option(char *option, char *value):

This function will search command line option.
If this option is found, the functions stores any argument to value and
returns 1.
The function will return 0 if option is not found.

Example (search for: --ground)
char model[RAYDIUM_MAX_NAME_LEN];
if(raydium_init_cli_option("ground",model))
{
setground(model);
}


28.3 int raydium_init_cli_option_default(char *option, char *value, char *default_value):

Same as above, but allows you to provide a default value (default) if
the option is not found on command line.

28.4 void raydium_init_internal_homedir_find(char *):

Internal use.

28.5 void raydium_init_args(int argc, char * *argv):

You must use this function, wich send application arguments to Raydium
and external libs (GLUT, OpenAL, ...).
This must be done before any other call to Raydium.
Example:
int main(int argc, char **argv)
{
raydium_init_args(argc,argv);
[...]


28.6 void raydium_init_args_name(int argc, char * *argv, char *app_name):

Same as above, but with application short name. This string is used to
build things like runtime configuration directory name (~/.raydium/ by default).
Use this wrapper if you don't want to share your configuration with Raydium.


29 Signals:

29.1 Quickview:

There almost nothing to say about signals management, except that Raydium
will try to catch SIGINT signal (sended by CTRL+C sequence, for example).
There's nothing else for now, but we plan a user callback for this signal.


30 Sound and music:

30.1 Introduction:

The Raydium sound API is pretty easy to use and there's only need to use a
few functions to make your program ouput sounds or music.

On top of this, there are a bunch of functions to modify the sound behavior.

Raydium uses OpenAL and OggVorbis? for its sounds and musics, for a basic
use of our sound API you only need to know one thing: OpenAL uses buffers
for its sounds and you need to be able to address the sounds separately.
For this we use ALuint in our code. Each buffer is associated to a source,
we have an array of all available sources and then, you only need to have
a simple int that acts as an index in this array. See below for more
informations.

Music is readed thru libogg, streamed from disk. If you want to play an
OGG audio track, the only thing you've to do is to call the suitable function.
You can use raydium_sound_music_eof_callback if needed. This event is
fired when sound track ends, allowing you to switch to another file.
Prototype for this callback is int callback(char *new_track), allowing
you to do something like strcpy(new_track,"foobar.ogg"); return 1;.
Return 0 if you do not want to switch to another audio file (this will stops
music playback).
Another callback is available, raydium_sound_music_changed_callback, fired
just after a music track switch, allowing you to get new informations from the
new stream, such as artist, album and title. See raydium_sound_load_music()
for more informations about this.

This document is not an alternative to OpenAL papers, and only provides
informations about Raydium's interface to OpenAL.
See specifications here: http://www.openal.org/documentation.html

30.2 void raydium_sound_verify (char *caller):

This functions checks if any error occured during last OpenAL operation.
You don't have to call this function by yourself, since every function of
this API will do it.

30.3 int raydium_sound_Array3IsValid(ALfloat *a):

Since OpenAL is very sensitive to malformed values, this function is used
internally to check consistency of provided ALfloat arrays.

30.4 void raydium_sound_InitSource (int src):

Internal use.

30.5 int raydium_sound_LoadWav (const char *fname):

This function tries to load the fname wav file into a buffer, if
successful, it returns the source id, else 0.

30.6 int raydium_sound_SourceVerify (int src):

Internal id checks.

30.7 int raydium_sound_SetSourceLoop (int src, signed char loop):

Modifies the loop property of the src source (loops if loop is non-zero,
default value for a source is "true").
Returns 0 if ok, -1 if error.

30.8 int raydium_sound_GetSourcePitch (int src, ALfloat * p):

Returns current pitch for src source.

30.9 int raydium_sound_SetSourcePitch (int src, ALfloat p):

Sets pitch for src source.
Current OpenAL spec is not clear about pitch's limits. Raydium will
clamp values to to ]0,2] interval.

30.10 int raydium_sound_GetSourceGain (int src, ALfloat * g):

Returns current gain ("volume") for src source.

30.11 int raydium_sound_SetSourceGain (int src, ALfloat g):

Sets gain ("volume") for src source.
Current OpenAL spec is not clear about pitch's limits. Raydium do not allows
negative values, but no upper limit is set.
Warning: some OpenAL implementations will provide strange gain curves. More
work is needed on this issue.

30.12 int raydium_sound_SetSourceRefDist(int src, ALfloat distance):

Sets reference distance for source src. The reference distance is
the distance where the sound will be half-volume.

30.13 int raydium_sound_SetSourcePos (int src, ALfloat Pos[]):

Sets 3D position of src source.
Pos is a 3 * ALfloat array.

30.14 int raydium_sound_SetSourcePosCamera(int src):

Sets 3D position of src source on the current camera position.

30.15 int raydium_sound_GetSourcePos (int src, ALfloat * Pos[]):

Returns current 3D position of src source.
Pos is a 3 * ALfloat array.

30.16 int raydium_sound_SetSourceDir (int src, ALfloat Dir[]):

Sets 3D direction of src source.
Dir is a 3 * ALfloat array.

30.17 int raydium_sound_GetSourceDir (int src, ALfloat * Dir[]):

Returns current 3D direction of src source.
Dir is a 3 * ALfloat array.

30.18 int raydium_sound_SetSourceVel (int src, ALfloat Vel[]):

Sets 3D velocity of src source.
Vel is a 3 * ALfloat array.

30.19 int raydium_sound_GetSourceVel (int src, ALfloat * Vel[]):

Returns current 3D velocity of src source.
Vel is a 3 * ALfloat array.

30.20 void raydium_sound_SetListenerPos (ALfloat Pos[]):

Sets 3D position of listener.
This is done automatically by Raydium, each frame, using camera informations
Pos is a 3 * ALfloat array.

30.21 void raydium_sound_GetListenerPos (ALfloat * Pos[]):

Returns current 3D position of listener.
Pos is a 3 * ALfloat array.

30.22 void raydium_sound_SetListenerOr (ALfloat Or[]):

Sets 3D orientation of listener.
This is done automatically by Raydium, each frame, using camera informations
Or is a 3 * ALfloat array.

30.23 void raydium_sound_GetListenerOr (ALfloat * Or[]):

Returns current 3D orientation of listener.
Or is a 3 * ALfloat array.

30.24 void raydium_sound_SetListenerVel (ALfloat Vel[]):

Sets 3D velocity of Listener.
Vel is a 3 * ALfloat array.

30.25 void raydium_sound_GetListenerVel (ALfloat * Vel[]):

Returns current 3D velocity of Listener.
Vel is a 3 * ALfloat array.

30.26 void raydium_sound_init (void):

Internal use.

30.27 int raydium_sound_SourcePlay (int src):

Plays the src source.
If src was already in "play" state, the buffer is rewinded.
Returns 0 if ok, -1 if error.

30.28 int raydium_sound_SourceStop (int src):

Stops the src source.
Returns 0 if ok, -1 if error.

30.29 int raydium_sound_SourcePause (int src):

Will pause the src source.
Returns 0 if ok, -1 if error.

30.30 int raydium_sound_SourceUnpause (int src):

src will restart playback after being paused.
Returns 0 if ok, -1 if error.

30.31 signed char raydium_sound_IsPlaying(int src):

Returns true (1) if src is playing, false (0) if stopped or invalid.

30.32 void raydium_sound_close (void):

Internal use.

30.33 int raydium_sound_load_music (char *fname):

Opens fname OGG music file and prepairs Raydium for playing it.
The music will be automatically played after a call to this function.
This function will use R3S (data repositories) if needed.
To switch to another audio track, simply call again this function.
Send NULL or an empty string to cancel music playback.
Returns 0 if ok, -1 if error

See also raydium_sound_music_eof_callback at the top of this chapter.

You can get OGG informations from raydium_sound_music_info, using
its members:
char artist[RAYDIUM_MAX_NAME_LEN];
char title [RAYDIUM_MAX_NAME_LEN];
char album [RAYDIUM_MAX_NAME_LEN];


30.34 void raydium_sound_music_info_init(void):

Internal use. Will reset infos.

30.35 void raydium_sound_music_info_refresh(void):

Internal use. Will flush infos from disk to raydium_sound_music_info.

30.36 void raydium_sound_music_callback (void):

Internal use.

30.37 void raydium_sound_callback (void):

Internal use.

30.38 void raydium_sound_source_fade(int src, ALfloat len):

This function will fade down source src over len seconds.
Since gain is not linear, you may have to play a bit with len to
find the correct value for you.
Use source 0 for music source.

30.39 Sound API Example:

int sound;
sound=raydium_sound_LoadWav("explo.wav");
raydium_sound_SetSourceLoop(sound,0);
[...]
if(explosion) raydium_sound_SourcePlay(sound);


30.40 void raydium_sound_source_fade_to(int src, ALfloat len, char *to):

Same as above, but plays to file at the end of the fade.
Warning: Works only for "music" source (src = 0).


31 Timecalls:

31.1 Concept:

As you may already know, in a real time application (as a game), you need
to control in-game time evolution.
For example, you cannot increment a car position by 1 at each frame since
it will generate an irregular scrolling (a frame is never rendered within
the same time as the previous or the next one).

Raydium supports timecalls, wich are a great solution for this problem.
Usage is very simple: write a simple function, and ask Raydium to call it
at the desired rate.

31.2 Constraints:

There is an important risk with timecalls: infinite loops.
If a callback is long, it may take more CPU time than it should, as in this
very simple example:

foo() is a function, taking 200 ms for his own execution. If you ask for
a 6 Hz execution, Raydium will execute foo() six times on the first frame,
taking 1200 ms. On the next frame, Raydium will need to execute foo() 7
times (the asked 6 times, and one more for the 200 ms lost during the last
frame), taking 1400 ms, so 8 times will be needed for the next frame, then 9, ...

So you need to create callbacks as short as possible, since long callbacks
may cause a game freeze on slower machines than yours. (1 FPS syndrom)

31.3 Hardware devices and methods:

Raydium must use a very accurate system timer, and will try many methods:
/dev/rtc , gettimeofday() (Linux only) and
QueryPerformanceCounter? for win32.

gettimeofday() will use a CPU counter and is extremely accurate.
It's far the best method. (0.001 ms accuracy is possible)

/dev/rtc is quite good, and Raydium will try to configure RTC at
RAYDIUM_TIMECALL_FREQ_PREFERED rate (8192 Hz by default), but may
require a "/proc/sys/dev/rtc/max-user-freq" modification:
echo 8192 > /proc/sys/dev/rtc/max-user-freq

You may want to look at common.c for interesting defines about timecalls.

31.4 void raydium_timecall_raydium (GLfloat step):

Internal Raydium callback.

31.5 float raydium_timecall_internal_w32_detect_modulo(int div):

Internal, WIN32 only: Returns timer resolution for div divisor.

31.6 int raydium_timecall_internal_w32_divmodulo_find(void):

Internal, WIN32 only: Detects the best timer divisor for the current CPU.

31.7 unsigned long raydium_timecall_devrtc_clock (void):

Internal, Linux only: Reads and return RTC clock.

31.8 unsigned long raydium_timecall_clock (void):

Returns current "time".
The variable raydium_timecall_clocks_per_sec contains the number
of clock "ticks" per second, and may help you here.

31.9 signed char raydium_timecall_devrtc_rate_change (unsigned long new_rate):

Internal, Linux only: Modifies RTC clock rate.

31.10 void raydium_timecall_devrtc_close (void):

Internal, Linux only: Will close RTC clock.

31.11 unsigned long raydium_timecall_devrtc_init (void):

Internal, Linux only: Will open RTC clock.

31.12 int raydium_timecall_detect_frequency (void):

Internal: This function will find the best timer available for current
platform, and adjust properties to your hardware (rate, divisor, ...).

31.13 void raydium_timecall_init (void):

Internal use.

31.14 int raydium_timecall_add (void *funct, GLint hz):

There is two sort of timecalls with Raydium:

1. Standard ones:
raydium_timecall_add(function,800);

void function(void) will be called 800 times per second.

2. Elastic timed ones:
raydium_timecall_add(function,-80);

void function(float step) will be called for each frame, with a
"step factor" as argument. In the above example, a 160 Hz game will call
function with step = 0.5, but step = 2.0 for a 40 Hz game.

A standard timecall will use void(void) function and a positive hertz
argument, as an elasitc one will use void(float) and negative hertz argument.

31.15 void raydium_timecall_freq_change (int callback, GLint hz):

This function changes the callback frequency. See above for possibles
values of hz (negative and positive values).

31.16 void raydium_timecall_callback (void):

Internal use (frame fired callback).


32 Network:

32.1 Bases of Raydium's networking API:

Raydium supports networking via UDP/IP, providing high level functions
for multiplayer game development.
Raydium servers are limited to 256 clients for now.

You will find in network.c a set of "low level" functions and vars dedicated to
networked games: players names, event callbacks, UDP sockets,
broadcasts, ...
See a few chapters below for higher level functions.

All this is ready to use. As it's not done in the introduction of this
guide, We will explain here some variables defined in common.h.

#define RAYDIUM_NETWORK_PORT          29104
#define RAYDIUM_NETWORK_PACKET_SIZE   230
#define RAYDIUM_NETWORK_TIMEOUT       5
#define RAYDIUM_NETWORK_PACKET_OFFSET 4
#define RAYDIUM_NETWORK_MAX_CLIENTS   8
#define RAYDIUM_NETWORK_MODE_NONE     0
#define RAYDIUM_NETWORK_MODE_CLIENT   1
#define RAYDIUM_NETWORK_MODE_SERVER   2 
 


Here, we can find network port declaration (Raydium will use only one
port, allowing easy port forwarding management, if needed), default timeout
(unit: second), and the three mode possible for a Raydium application.

But there is also two other very important defines: packet size
(unit: byte) and max number of clients.. This is important because
Raydium uses UDP sockets, and UDP sockets required fixed
length packets, and as you need to set packet size as small as possible
(for obvious speed reasons), you must calculate you maximum
information packet size (players position, for example), multiply
it by RAYDIUM_NETWORK_MAX_CLIENTS,and add RAYDIUM_NETWORK_PACKET_OFFSET
wich represent the required header of the packet.

It's more easy than it seems, look:

My game will support 8 players.
I will send players state with 3 floats (x,y,z).
My packet size must be: 8*3*sizeof(float)+RAYDIUM_NETWORK_PACKET_OFFSET = 100 bytes.

Please, do not change packet offset size, since Raydium will use it
for packet header.

#define RAYDIUM_NETWORK_DATA_OK     1
#define RAYDIUM_NETWORK_DATA_NONE   0
#define RAYDIUM_NETWORK_DATA_ERROR -1 
 


This three defines are used as network functions result:

if(raydium_network_read_flushed(&id,&type,buff)==RAYDIUM_NETWORK_DATA_OK)
{
...


#define RAYDIUM_NETWORK_PACKET_BASE 20 
 


In most network functions, you will find a "type" argument, used to
determine packet goal. This type is 8 bits long (256 possible values),
but Raydium is already using some of them. So you can use
RAYDIUM_NETWORK_PACKET_BASE as a base for your own types:

#define NORMAL_DATA RAYDIUM_NETWORK_PACKET_BASE
#define BALL_TAKEN (NORMAL_DATA+1)
#define SCORE_INFO (NORMAL_DATA+2)
#define HORN (NORMAL_DATA+3)
...


Variables:


Your own player id (0<= id < RAYDIUM_NETWORK_MAX_CLIENTS),
read only: int raydium_network_uid;
Special value "-1" means that you're not connected (see below).

Current network mode (none, client, server),
read only: signed char raydium_network_mode;

Boolean used to determine client state (connected or not), read only:
signed char raydium_network_client[RAYDIUM_NETWORK_MAX_CLIENTS];

example:
if(raydium_network_client[4])
draw_player(4);


Can be used by a server to send data to his clients. Read only:
struct sockaddr raydium_network_client_addr[RAYDIUM_NETWORK_MAX_CLIENTS];

Players names, read only:
char raydium_network_name[RAYDIUM_NETWORK_MAX_CLIENTS][RAYDIUM_MAX_NAME_LEN];

OnConnect? and OnDisconnect? events (server only):
void * raydium_network_on_connect;
void * raydium_network_on_disconnect;


You can place your owns callbacks (void(int)) on these events, as in
this example:

void new_client(int client)
{
raydium_log("New player: %s", raydium_network_nameclient);
}
 
...
 
int main(int argc, char **argv)
{
...
raydium_network_on_connect=new_client;
...


32.2 Reliablility versus Speed:

As explained above, Raydium is using UDP network packets, and as
you may know, UDP is not a reliable protocol, aiming speed before all.
This system is interesting for sending non-sensible data, as player positions,
for example.
But Raydium can handle more important data, using some of methods of TCP
protocol, as Timeouts, ACK, resending, ...
This TCP style packets are available thru "Netcalls".

32.3 High level API: "Netcalls" and "Propags":

Netcalls provides you a good way to handle network exchanges using
callbacks functions, like a simple RPC system.
The idea is simple, built over the notion of "type". See suitable functions for
more information about this system.

Another available mechanism is called Propags, and allows you to "share"
variables over the network (scores, game state, ...) in a very few steps.
You only need to "create" a type, and link a variable to it (any C type or
structure is allowed). After each modification of this (local copy of the)
variable, just call raydium_network_propag_refresh* and that's it. If
any other client (or the server) is applying a modification to this "type",
your local copy is automatically updated.

32.4 int raydium_network_propag_find (int type):

Lookups a "propag" by his type. Returns -1 is no propag is found.

32.5 void raydium_network_propag_recv (int type, char *buff):

Internal callback for "propag" receiving.

32.6 void raydium_network_propag_refresh_id (int i):

Will refresh a propag by his id.

32.7 void raydium_network_propag_refresh (int type):

Will refresh a propag by his type.

32.8 void raydium_network_propag_refresh_all (void):

Will refresh all propags

32.9 int raydium_network_propag_add (int type, void *data, int size):

This function will "register" a new propag. You need to provide the address
of your variable/structure (data), ans its size. A dedicated type
is also required (see at the top of this chapter).

32.10 void raydium_network_queue_element_init (raydium_network_Tcp * e):

Internal use. (TCP style packets)

32.11 unsigned short raydium_network_queue_tcpid_gen (void):

Internal use. (TCP style packets)

32.12 void raydium_network_queue_tcpid_known_add (int tcpid, int player):

Internal use. (TCP style packets)

32.13 signed char raydium_network_queue_tcpid_known (unsigned short tcpid, unsigned short player):

Internal use. (TCP style packets)

32.14 signed char raydium_network_queue_is_tcpid (int type):

Internal use. (TCP style packets)

32.15 void raydium_network_queue_element_add (char *packet, struct sockaddr *to):

Internal use. (TCP style packets)

32.16 unsigned long *raydium_network_internal_find_delay_addr (int player):

Internal use. (TCP style packets)

32.17 void raydium_network_queue_check_time (void):

Internal use. (TCP style packets)

32.18 void raydium_network_queue_ack_send (unsigned short tcpid, struct sockaddr *to):

Internal use. (TCP style packets)

32.19 void raydium_network_queue_ack_recv (int type, char *buff):

Internal use. (TCP style packets)

32.20 void raydium_network_player_name (char *str):

This function will returns the current player name.
Raydium will ask the OS for "current logged user", but player name may
be provided thru --name command line argument.

32.21 signed char raydium_network_set_socket_block (int block):

This function will sets block (true or false) status to the network stack.
A blocking socket will wait indefinitely an incoming packet. A non blocking one
will return "no data" instead.
You've almost no reason to call this function by yourself.

32.22 int raydium_network_socket_close(int fd):

Portable socket closing function. See "man 2 close" or closesocket (win32)
docs.

32.23 signed char raydium_network_socket_is_readable(int fd):

Will return true (1) if there is some data ready on fd socket,
false (0) otherwise.

32.24 signed char raydium_network_netcall_add (void *ptr, int type, signed char tcp):

This function will register a new Network Callback ("netcall").
With Raydium, you can read the main data stream with
raydium_network_read_flushed(), and configure netcalls on random
events (using packet type).

Netcalls signature is: void(int type, char *buff)

As you may configure the same callback function for multiples packet types,
this type is passed to your function, with the temporary buff buffer.
You can extract from field from packet if needed.

If you sets the tcp flag to true (1), your packet will use "TCP style"
network protocol (see a the top of this chapter).

32.25 signed char raydium_network_netcall_exec (int type, char *buff):

Internal callback for "netcall" receiving.

32.26 signed char raydium_network_timeout_check (void):

Internal use.

32.27 void raydium_network_init_sub(void):

Internal use.

32.28 signed char raydium_network_init (void):

Nothing interesting unless you're creating a console server (using the
RAYDIUM_NETWORK_ONLY directive), since in this case you must do all
inits by yourself...
example :
.#define RAYDIUM_NETWORK_ONLY
.#include "raydium/index.c"
 
...
 
int main(int argc, char **argv)
{
setbuf(stdout,NULL);
signal(SIGINT,quit);
raydium_php_init(); // only if you need PHP support
raydium_network_init();
raydium_network_server_create();
...


32.29 void raydium_network_write (struct sockaddr *to, int from, signed char type, char *buff):

Obviously, this function will send data.
If you're a client, you don't need to determine to field, as the only
destination is the server, so you can use NULL, for example. If you're
a server, you can use raydium_network_client_addr[] array.

As a client, from argument is generally your own uid (raydium_network_uid),
but you can use any other player number if needed.
As a server, from field is useless, since you are the only machine able
to send data to clients.

As you may expect, type field is used to determine packet's type.
You can use any (8 bits) value greater or equal to RAYDIUM_NETWORK_PACKET_BASE.

Finally, buff is a pointer to data's buffer. This buffer
must be RAYDIUM_NETWORK_PACKET_SIZE long, and can be cleared
or re-used after this call.

32.30 void raydium_network_broadcast (signed char type, char *buff):

Sends data over network.
Obviously, from network point of vue, only a server can broadcast
(to his clients).

When a client needs to broadcast (from the game point of vue) some
informations (his own position, for example), he must send this information
to server, and the server will broadcast it.

This function uses the same arguments as previous one, except to and
from, not needed here.

32.31 signed char raydium_network_read (int *id, signed char *type, char *buff):

Reads next packet from network (FIFO) stack.
This function uses the same arguments as previous ones, and returns
data availability: RAYDIUM_NETWORK_DATA_OK, RAYDIUM_NETWORK_DATA_NONE
or RAYDIUM_NETWORK_DATA_ERROR.

32.32 signed char raydium_network_read_flushed (int *id, signed char *type, char *buff):

Reads last packet from network stack.
All previous packets will be ignored, only the newest packet will
be read (if any).

As you may miss some important informations, you can use netcalls
(see above) if you want to capture packets with a particular
type, even with flushed reading.

32.33 void raydium_network_read_faked(void):

Reads from network, but do not care of received data. This is useful for
listen to internal packets (server "beacon" broadcasts, for example).
Reading is done thru raydium_network_read_flushed.
Mostly for internal use.

32.34 signed char raydium_network_server_broadcast(char *name, char *app_or_mod, int version):

This function will start to broadcast a server to the LAN.
You must provide a party name, the application or mod name (app_or_mod)
and a "protocol" version of you choice.
The server is going to broadcast a "beacon" packet to the LAN
every RAYDIUM_NETWORK_BEACON_DELAY.
Any client in "discovery mode" with the same app_or_mod and version
will see this beacon.

32.35 void raydium_network_server_broadcast_info(char *info):

Update "information" field of this server (current track or map, for example).
Size cannot exceed RAYDIUM_NETWORK_BEACON_INFO_MAX_LEN.

32.36 void raydium_network_server_broadcast_check(void):

Internal use.

32.37 signed char raydium_network_server_create (void):

Will transform you application into a server, accepting new clients
instantaneously.
See also the RAYDIUM_NETWORK_ONLY directive if you want to create console
servers.

32.38 signed char raydium_network_client_connect_to (char *server):

This function will try to connect your application to server (hostname or
ip address).
WARNING: For now, this call could be endless ! (server failure while connecting).
This function will succed returning 1 or 0 otherwise.
You are connected instantaneously, and you must start sending data
before server timeout (defined by RAYDIUM_NETWORK_TIMEOUT).
You player number can be found with raydium_network_uid variable,
as said before.

32.39 signed char raydium_network_client_discover(char *game,int version):

This function will set client in RAYDIUM_NETWORK_MODE_DISCOVER mode.
While using this mode, a client will search every LAN server with the
same game (or mod name) and version as itself.
Then, you can access to this server list using following functions.

32.40 int raydium_network_discover_numservers(void):

While the client is in RAYDIUM_NETWORK_MODE_DISCOVER mode, you
can fetch all "detected" servers in the LAN.
This function will return :
- -1 : "not in discovery mode". See raydium_network_client_discover().
- 0 : no server detected (yet ... try during next frame)
- more : total number of compatible servers (same game/application
and protocol version)

32.41 signed char raydium_network_discover_getserver(int num, char *name, char *ip, char *info, int *player_count, int *player_max):

Use this function with the help of raydium_network_discover_numservers(),
with something like :
int i;
char name[RAYDIUM_MAX_NAME_LEN];
char ip[RAYDIUM_MAX_NAME_LEN];
char info[RAYDIUM_MAX_NAME_LEN];
int player_count;
int player_max;
...
for(i=0;i<raydium_network_discover_numservers();i++)
{
raydium_network_discover_getserver(i,name,ip,info,&player_count,&player_max);
raydium_log("server %02i: %s (%s)",i,name,ip);
}

No memory allocation is done for name and ip. It's your job.

This function will return :
- -1 : "not in discovery mode". See raydium_network_client_discover().
- 0 : invalid num.
- 1 : OK.

32.42 void raydium_network_client_disconnect(void):

This function will disconnect client from server, if connected.

32.43 signed char raydium_server_accept_new (struct sockaddr *from, char *name):

Internal server callback for new clients.

32.44 void raydium_network_close (void):

Obvious. Raydium will do it for you, anyway.

32.45 void raydium_network_internal_server_delays_dump (void):

Dumps "TCP Style" timeouts for all clients to console.

32.46 void raydium_network_internal_dump (void):

Dumps various stats about network stack to console.

32.47 signed char raydium_network_internet_test(void):

This function will test if direct internet connection is available,
using Raydium webiste. This function supports proxies.

32.48 signed char raydium_network_linux_find_broadcast_interfaces(void):

Internal use. Linux only.


33 Sprites (viewer axis aligned 2D billboards):

33.1 Introduction:

Raydium provides its own sprite system.
Each sprite needs a .sprite file. This file is as this:
collision={0.8,0.7,0.8};
size=1;

coords={0.0,0.25,0.0,0.25};
group=1;
texture="sprite1-test.tga";

coords={0,0.25,0.5,0.75};
group=2;
texture="sprite1-test.tga";

...

The collision variable defines the size of a RayODE box element.

size is the size of the displayed sprite. It won't affect the ODE object,
just the graphical stuff.

Then you'll have to define each frame of the sprite. Each frame must be
defined by coords (interval 0 to 1) in a texture file.

It's important to have in mind that the sprite can have "groups".
Those groups are used to team up some related sprites. For example we can
have 3 sprites of a forward movement, those could be in one specific group.
In that way you can change from one group to another with a Raydium function easily.

Even more, the frames of a sprite group will be animated automatically
and when the animation comes to the end of the group then you can chose
what will be the next action:
1) You can stop animation, you can restart the group animation or you can
jump to a new group.
2) you can indicate a "jump" to another group with something like:
group={7,11}; That would jump to the group 11
group={5,-1}; -1 means STOP THE ANIMATION
group={3,-2}; -2 means LOOP IN THE SAME GROUP


Raydium provides a sprite viewer (sprite_viewer.c) that will download
a sample sprite file, very useful to understand how sprite file are built.

33.2 int raydium_sprite_check_available(void):

Internal use.

33.3 void raydium_sprite_billboard(float x, float y, float z,float ux, float uy, float uz, float rx, float ry, float rz, int textureid, float s0, float s1, float t0, float t1,float size):

Internal use.

33.4 unknown item:

This function allows you to load an sprite. It will returns the id(int)
of the new sprite.

33.5 char *raydium_sprite_get_name_from_object(int obj):

You can get the name of an sprite with this function.

33.6 int raydium_sprite_object_get(int spriteid):

Function to get the ODE object linked to the sprite.

33.7 void sprite_render_frame(float x, float y, float z, int spriteid,int frame,float scalex,float scaley):

Internal use.

33.8 void raydium_sprite_move(int sprite,float x, float y, float z):

With this function you can move (in univsrese coordinates) an sprite
giving the 3 coordinates.

33.9 void raydium_sprite_move_relative(int sprite, float deltax, float deltay, float deltaz):

Same than previous but it uses relative coordinates. Usefull for ingame
displacements.

33.10 void raydium_sprite_display(int id):

This function will display the given sprite. Usually should be called in
the display callback.

33.11 void raydium_sprite_group_change(int sprite,int group):

Function to change the animation group of a certain sprite.

33.12 void raydium_sprite_free(int sprite):

Deletes an sprite.

33.13 void raydium_sprite_free_name(char *name):

Function to delete all the sprites using a certain filename.

33.14 float *raydium_sprite_get_pos(int number):

Returns a 3float array with the position (universe coordinates) of a
frame

33.15 int raydium_sprite_get_id_from_element(int element):

Returns the id of an sprite from the element id given.

33.16 int raydium_sprite_set_type(int id,int value):

Internal use.

33.17 int raydium_sprite_set_name(int id,char *cadena):

With this function you can change the name of an sprite

33.18 int raydium_sprite_find(char *name):

This function will return the sprite id(int) of an sprite according its
name

33.19 int raydium_sprite_is_stopped(int id):

This functions returns 1 if the animation of the sprite id has been
stoppped and 0 if it's playing.

33.20 void raydium_sprite_dump_info(int id):

Dump of jumps for a certain sprite.

33.21 float raydium_sprite_change_sprite_time(int id,float time):

Function to change the time betwen frames in the animation of an id sprite.

33.22 float raydium_sprite_change_sprite_time_relative(int id,float time):

Same than previous but you can add a quantity of time to the previous
stored time, ie relative.

33.23 int raydium_sprite_get_current_group(int id):

Function to get the current group of an sprite.

33.24 int raydium_sprite_get_current_frame(int id):

Function to get the current frame of an sprite.


34 OSD (On Screen Display):

34.1 Introduction:

Raydium provides some high level function for "On Screen Display",
as string drawing (2D and 3D), application's logo, mouse cursor, and other
various 2D displaying tools.

In most cases, these functions must be called after any other object
drawing function, to avoid overlapping problems.

Most functions will use a percentage system, and origin is at lower-left corner.

34.2 void raydium_osd_color_change (GLfloat r, GLfloat g, GLfloat b):

This function will change the font color for the next raydium_osd_printf*
calls.
As usual: 0 <= (r,g and b) <= 1.

34.3 void raydium_osd_alpha_change (GLfloat a):

Same as above, but will change font transparency.

34.4 void raydium_osd_color_rgba (GLfloat r, GLfloat g, GLfloat b, GLfloat a):

This is a mix of raydium_osd_color_change and raydium_osd_alpha_change.

34.5 void raydium_osd_color_ega (char hexa):

This function will change font color with the corresponding
hexadecimal code (as a char: '0' to 'F') in the standard EGA palette.

Here is this palette:
Hexa Color
0 Black
1 Blue
2 Green
3 Cyan
4 Red
5 Purple
6 Brown
7 White
8 Grey
9 Light Blue
A Light Green
B Light Cyan
C Light Red
D Light Purple
E Light Yellow
F Light White


34.6 void raydium_osd_start (void):

Mostly for internal uses. (will configure screen for OSD operations)

34.7 void raydium_osd_stop (void):

Mostly for internal uses. (see above)

34.8 void raydium_osd_draw (int tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2):

Will draw tex texture using (x1,y1) and (x2,y2) points.

34.9 void raydium_osd_draw_name (char *tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2):

Same as above, but using texture filename.

34.10 void raydium_osd_draw_quad(int tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, GLfloat angle):

Will draw tex texture using (x1,y1) and (x2,y2) points
with angle rotation.

34.11 void raydium_osd_draw_quad_name(char *tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, GLfloat angle):

Same as above, but using texture filename.

34.12 void raydium_osd_printf (GLfloat x, GLfloat y, GLfloat size, GLfloat spacer, char *texture, char *format, ...):

This function is an OpenGL equivalent to the standard "printf" C function.

- (x,y) is the position of the text's beginning, as a screen
percentage, with origin at lower left.

- size is the font size, using an arbitrary unit. This size is always
proportionnal to frame size (font size will grow up with screen size,
in other words).

- spacer is the factor of spacing between 2 consecutive letters. With
standard fonts, 0.5 is a correct value (relatively condensed text).

- texture is obviously the texture filename to use (font*.tga are
often provided with Raydium distribution, and by R3S).

- format is the standard printf format string, followed by
corresponding arguments: "^9Player ^Fname is: %10s", player_name
This format can use '^' char to change color text, followed by a color,
indicated by a hexadecimal letter (EGA palette). See raydium_osd_color_ega
function, above.

Here you are a simple example:

strcpy(version,"^Ctest 0.1^F");
raydium_osd_printf(2,98,16,0.5,"font2.tga","- %3i FPS - tech demo %s for Raydium %s, CQFD Corp.",
raydium_render_fps,version,raydium_version);


34.13 void raydium_osd_printf_3D (GLfloat x, GLfloat y, GLfloat z, GLfloat size, GLfloat spacer, char *texture, char *format, ...):

Same as above, but you can place your text in your application 3D space,
using x, y and z values.

34.14 void raydium_osd_logo (char *texture):

Will draw a logo for the current frame with texture filename.
For now, you've no control over rotation speed of the logo.

34.15 void raydium_osd_cursor_set (char *texture, GLfloat xsize, GLfloat ysize):

This function will set mouse cursor with texture filename and
with (xsize,ysize) size (percent of screen size).
You should use a RGBA texture for better results.
example:
raydium_osd_cursor_set("BOXcursor.tga",4,4);


You can set texture to NULL or empty string to cancel OSD cursor texture.

34.16 void raydium_osd_cursor_offset(GLfloat xoffset, GLfloat yoffset):

This function allows to offset the cursor. Used with non-regular cursor
textures. The units are percentage of the screen.

34.17 void raydium_osd_cursor_draw (void):

Internal use.

34.18 void raydium_osd_internal_vertex (GLfloat x, GLfloat y, GLfloat top):

Internal use.

34.19 void raydium_osd_network_stat_draw (GLfloat px, GLfloat py, GLfloat size):

Will draw network stats (if available) in a box.
raydium_osd_network_stat_draw(5,30,20);


34.20 void raydium_osd_mask (GLfloat * color4):

Will draw a uniform mask using color4 (RGBA color) for this frame.

34.21 void raydium_osd_mask_texture(int texture,GLfloat alpha):

Will draw a textured mask, with alpha opacity (1 is full opacity).

34.22 void raydium_osd_mask_texture_name(char *texture,GLfloat alpha):

Same as above, but resolving texture by name.

34.23 void raydium_osd_mask_texture_clip(int texture,GLfloat alpha, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2):

Same as raydium_osd_mask_texture, but (x1,y1),(x2,y2) will be used as
texture coords, in a [0,100] range.

34.24 void raydium_osd_mask_texture_clip_name(char *texture,GLfloat alpha, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2):

Same as above, but resolving texture by name.

34.25 void raydium_osd_fade_callback (void):

Internal use.

34.26 void raydium_osd_fade_init (void):

Internal use.

34.27 void raydium_osd_fade_from (GLfloat * from4, GLfloat * to4, GLfloat time_len, void *OnFadeEnd?):

This function will configure a fading mask from from4 color to to4.
This fade will last time_len seconds, and will call OnFadeEnd? callback
when finished.
This callback signature must be void callback(void).

A standard fade-to-black-and-restore example:
// back to normal rendering
void restorefade(void)
{
GLfloat from[4]={0,0,0,2};
GLfloat to[4]={0,0,0,0};
raydium_osd_fade_from(from,to,1,NULL);
// do things (like moving camera to another place, for example).
}
 
...
 
// If space key : fade to black
if(raydium_key_last==1032)
{
GLfloat from[4]={0,0,0,0};
GLfloat to[4]={0,0,0,1};
raydium_osd_fade_from(from,to,0.3,restorefade);
}



35 In-game console:

35.1 Introduction:

This chapter introduce Raydium console, allowing applications to take
user keyboard input (game commands, chat, ...) and to send informations
to this console.
The end user can call the console using "the key below esc".

By default, if PHP support is enabled, all user commands will be redirected
to PHP engine. Each command will get his own context, don't expect to create
anything else than "single line PHP scripts" with the console. See PHP chapter
for more informations.
The console allows the user to prefix command with the following characters:

- /: Non PHP command. The command will be sent to application (see
raydium_console_gets_callback, below.

- >: Will launch argument as a PHP script (identical to include("..."))

- !: Will launch argument as a sequence script

Command history is saved to raydium_history file when application exits.

You can use a void prompt(char *) callback to get user commands. Your
callback must be registered thru raydium_console_gets_callback:
raydium_console_gets_callback=prompt;


This console provides auto-completion of register functions and variables.
See the suitable chapter for more information.

35.2 void raydium_console_init (void):

Internal use.

35.3 void raydium_console_history_save (void):

Internal use (will flush console history to disk).
You can call it by yourself if needed.

35.4 int raydium_console_gets (char *where):

DISABLED.
Use raydium_console_gets_callback function pointer instead.

35.5 void raydium_console_history_previous (void):

Internal use.

35.6 void raydium_console_history_next (void):

Internal use.

35.7 void raydium_console_history_add (char *str):

Internal use.

35.8 void raydium_console_exec_script (char *file):

Internal use.

35.9 void raydium_console_exec_last_command (void):

Internal use.

35.10 void raydium_console_line_add (char *format, ...):

Mostly reserved for internal use, but unless raydium_log, this function will
add the provided data only to ingame console, and not to "native" console.

35.11 int raydium_console_history_read(char * *hist):

This function will build an history list.
See this example :
char *hist[RAYDIUM_CONSOLE_MAX_LINES];
int i,n;
n=raydium_console_history_read(hist);
for(i=0;i<n;i++)
printf("> %s\n",hist[i]);

Warning: Be sure that there's no new history line between the call and
the end of hist usage (Or copy hist to a safer place).

35.12 void raydium_console_event (void):

Internal use. Will switch console up and down.

35.13 void raydium_console_draw (void):

Internal use.

35.14 int raydium_console_internal_isalphanumuscore (char c):

Internal use.

35.15 void raydium_console_complete (char *str):

Internal use.


36 Joysticks, pads and force feedback:

36.1 Introduction:

Raydium supports Joysticks, joypads, steering wheels, force feedback devices,
keyboard emulation.

Please note that this API may change in the future, mainly about force feedback,
that only (barely) works with Linux currently. Some support for "user control
setup" will be added, too.

Interesting variables:
signed char raydium_joy_button[RAYDIUM_BUTTONS_MAX_BUTTONS];
signed char raydium_joy_click;
GLfloat raydium_joy_x;
GLfloat raydium_joy_y;
GLfloat raydium_joy_z;
int raydium_joy;
 
char raydium_joy_n_axes;
char raydium_joy_n_buttons;
GLfloat raydium_joy_axis[RAYDIUM_JOY_MAX_AXIS]; // "raw" axes data 
 

Buttons are booleans, joy x,y and z are -1 <= (x,y,z) <= 1 and 0 means "center".

36.2 void raydium_joy_key_emul (void):

Emulate joy with keyboard (directional pad), so you can always use
raydium_joy_x and y variables, even if no joystick was detected.
This function has no effect if a joy is detected.

36.3 void raydium_joy_ff_autocenter (int perc):

Set Force Feedback autocenter factor.

36.4 void raydium_joy_ff_tremble_set (GLfloat period, GLfloat force):

Send tremble effect to Force Feedback device for a determined period,
at a particular force. (no units yet).


37 Graphic User Interfaces:

37.1 Introduction:

Raydium provides a support for simple GUI definitions thru a set of
functions (RayPHP interface is available).
Raydium's GUI are themable, using ".gui" theme text files. A default "full"
theme is provided as "theme-raydium2.gui" (and suitable ".tga" file) on the
data repository.
Complete informations about theme building are readable in this file.

37.2 Vocabulary:

This API will allow declaration of:
- "widgets" (label, button, edit box, track bar, check box, combo box, zone)
- "windows" (containers for widgets)

"Focus" is supported for windows and widgets. The final user will not have
any control on windows focus. "Tab" key is used for widget focus cycling.

Widgets and windows are identified by a name or by a unique numeric id.

37.3 Building:

The idea is simple: build a window (position and size), and create
widgets over this window.
All widgets are created using the current sizes (x,y and font). See
suitable function).
Buttons provides a simple callback, and all other widgets (but label)
provides an unified "read" function. Window deletion is also possible.

You must set current theme before any of this operations (see below).
A void(void) callback is available if you want to draw something over
the GUI, named raydium_gui_AfterGuiDrawCallback.

37.4 void raydium_gui_window_init(int window):

Internal use. Will reset window.

37.5 void raydium_gui_init(void):

Internal use. Will init all GUI API. Called once by Raydium.

37.6 void raydium_gui_theme_init(void):

Internal use. Will init theme.

37.7 int raydium_gui_theme_load(char *filename):

This function will load and set current theme (".gui" files). You must load
a theme by yourself, since Raydium will never do it for you.
This function must be called before GUI building.

37.8 signed char raydium_gui_window_isvalid(int i):

Mostly internal. Will check if i window is valid.

37.9 int raydium_gui_window_find(char *name):

Will search name window's numeric id.

37.10 void raydium_gui_window_OnDelete(int window, void *OnDelete?):

This function sets OnDelete? callback for window deletion.
This callback must follow void f(void) prototype. The call is done before
window deletion.

37.11 void raydium_gui_window_OnDelete_name(char *window, void *OnDelete?):

Same as above, but using window name.

37.12 signed char raydium_gui_widget_isvalid(int i, int window):

Mostly internal. Will check if i widget of window is valid.

37.13 int raydium_gui_widget_find(char *name, int window):

Will search name widget numeric id (for window).

37.14 void raydium_gui_widget_next(void):

Mostly internal. Cycle focus.

37.15 void raydium_gui_widget_draw_internal(GLfloat *uv, GLfloat *xy):

Internal use. Generic drawing function.

37.16 void raydium_gui_button_draw(int w, int window):

Internal use.

37.17 void raydium_gui_track_draw(int w, int window):

Internal use.

37.18 void raydium_gui_label_draw(int w, int window):

Internal use.

37.19 void raydium_gui_edit_draw(int w, int window):

Internal use.

37.20 void raydium_gui_check_draw(int w, int window):

Internal use.

37.21 void raydium_gui_combo_draw(int w, int window):

Internal use.

37.22 void raydium_gui_zone_draw(int w, int window):

Internal use.

37.23 void raydium_gui_window_draw(int window):

Internal use.

37.24 void raydium_gui_draw(void):

Internal use. GUI drawing callback.

37.25 int raydium_gui_button_read(int window, int widget, char *str):

Internal use. Button read accessor (dummy).

37.26 int raydium_gui_button_write(int window, int widget, char *str):

Internal use. Button write accessor.

37.27 int raydium_gui_label_read(int window, int widget, char *str):

Internal use. Label read accessor (dummy).

37.28 int raydium_gui_label_write(int window, int widget, char *str):

Internal use. Label write accessor.

37.29 int raydium_gui_track_read(int window, int widget, char *str):

Internal use. Track read accessor.

37.30 int raydium_gui_track_write(int window, int widget, int value):

Internal use. Track write accessor.

37.31 int raydium_gui_edit_read(int window, int widget, char *str):

Internal use. Edit read accessor.

37.32 int raydium_gui_edit_write(int window, int widget, char *str):

Internal use. Edit write accessor.

37.33 int raydium_gui_check_read(int window, int widget, char *str):

Internal use. Check read accessor.

37.34 int raydium_gui_check_write(int window, int widget, int value):

Internal use. Check write accessor.

37.35 int raydium_gui_combo_read(int window, int widget, char *str):

Internal use. Combo read accessor.

37.36 int raydium_gui_combo_write(int window, int widget, int value):

Internal use. Combo write accessor.

37.37 int raydium_gui_zone_read(int window, int widget, char *str):

Internal use. Zone read accessor.

37.38 void raydium_gui_show(void):

Will show current built GUI.

37.39 void raydium_gui_hide(void):

Will hide current built GUI. This is the default state.

37.40 signed char raydium_gui_isvisible(void):

Will return current visibility of GUI.

37.41 void raydium_gui_window_delete(int window):

Will delete window. No further access to widgets is possible.

37.42 void raydium_gui_window_delete_name(char *window):

Same as above, but using window's name.

37.43 void raydium_gui_widget_sizes(GLfloat sizex, GLfloat sizey, GLfloat font_size):

Each widget is created using 3 size: X size, Y size and font size. This
function will allow you to set all sizes for a widget or a group of widget.
Unit: percents (screen)

37.44 int raydium_gui_window_create(char *name, GLfloat px, GLfloat py, GLfloat sizex, GLfloat sizey):

Obviously, this function will create a new window. This window will take focus
and overlap any previous window.
px and py for X and Y position on the screen, and sizex and sizey
for sizes, obviously.
Unit: percents (screen)

37.45 int raydium_gui_internal_object_create(char *name, int window, signed char type, GLfloat px, GLfloat py, GLfloat sizex, GLfloat sizey, GLfloat font_size):

Internal use.
Small (and ugly) tip: you can build many widgets with the same name, prefixing
the name with '*'.

37.46 int raydium_gui_button_create(char *name, int window, GLfloat px, GLfloat py, char *caption, void *OnClick?):

This function will create a new button, with name and with window for
parent.
You need to provide a caption ("title") and a OnClick? callback function.
This callback must follow this prototype:
void btnButtonClick(raydium_gui_Object *w)

You can find raydium_gui_Object structure declaration in raydium/gui.h,
if needed.

Unit for position (px and py): percents (window)

37.47 int raydium_gui_button_create_simple(char *name, int window, GLfloat px, GLfloat py, char *caption):

Same as above, but no OnClick? callback function is asked. This type of button
is "readable" thru raydium_gui_button_clicked().

37.48 int raydium_gui_label_create(char *name, int window, GLfloat px, GLfloat py, char *caption, GLfloat r, GLfloat g, GLfloat b):

This function will create a new label, with name and with window for
parent.
You need to provide a caption ("title") and an RGB color (0..1 interval)

Unit for position (px and py): percents (window)

37.49 int raydium_gui_track_create(char *name, int window, GLfloat px, GLfloat py, int min, int max, int current):

This function will create a new trackbar, with name and with window for
parent.
You need to provide a min interger value, a max and current value.

Unit for position (px and py): percents (window)

37.50 int raydium_gui_edit_create(char *name, int window, GLfloat px, GLfloat py, char *default_text):

This function will create a new edit box, with name and with window
for parent.
You may provide a default text (or an empty string), if needed. Unless all
others Raydium's data, max string length is RAYDIUM_GUI_DATASIZE and
not RAYDIUM_MAX_NAME_LEN, since this component may handle bigger strings.
See raydium/gui.h for more informations.

Unit for position (px and py): percents (window)

37.51 int raydium_gui_check_create(char *name, int window, GLfloat px, GLfloat py, char *caption, signed char checked):

This function will create a new check box, with name and with window
for parent.
You need to provide a caption ("title") and a boolean state (checked or not).

Unit for position (px and py): percents (window)

37.52 int raydium_gui_combo_create(char *name, int window, GLfloat px, GLfloat py, char *items, int current):

This function will create a new edit box, with name and with window
for parent.
items is a string, using '\n' as a separator. It's allowed to create an
empty item.
current is the default selected item in items. (first = 0)
Unless all others Raydium's data, max string length is RAYDIUM_GUI_DATASIZE
and not RAYDIUM_MAX_NAME_LEN, since this component may handle bigger
strings. See raydium/gui.h for more informations.

Unit for position (px and py): percents (window)

37.53 int raydium_gui_zone_create(char *name, int window, GLfloat px, GLfloat py, GLfloat sx, GLfloat sy, int tag, void *OnClick?):

This function will create a "zone" with name and with window for
parent. A zone will act like a button, but will highlight a rectangular area
of the window.

This widget will return its tag when you'll read it, and will
update raydium_gui_button_clicked() value when clicked.

Unit for position/size (px, py, sx and sy): percents (window)

37.54 int raydium_gui_read(int window, int widget, char *str):

Use this function to get widget's state (for window).
This function will always return this information thru two variable:
an integer (returned value) and a string (str).
This information is specific to widget's type (checked or not for a
checkbox, current choice for a combo, current string for an edit box, ...)
Please, note str must be allocated before function call. This is also
the case for PHP scripts :
$str=str_pad("",256); // "pre-alloc"
$val=raydium_gui_read_name("main","track",$str);
echo "value=$val, string='$str'";


37.55 int raydium_gui_read_name(char *window, char *widget, char *str):

Same as above, but window and widget are resolved thru names, and
not numeric id.

37.56 int raydium_gui_read_widget(raydium_gui_Object *w, char *str):

Same as raydium_gui_read(), but using a raydium_gui_Object pointer.
Useful for button callbacks, for example.

37.57 signed char raydium_gui_write(int window, int widget, char *str, int value):

With this function, you can change the value of a widget on a window.
- With buttons, you must use str to change caption.
- With labels, you must use str to change caption.
- With tracks, you must use value to change the current value.
- With edits, you must use str to change text.
- With cheks, you must use value: 1 means "checked", 0 "unchecked".
- With combos, you must use value as an ID to change wich entry is selected.

Returns 1 when all is OK, 0 when it fails and -1 when nothing was changed.

37.58 int raydium_gui_write_name(char *window, char *widget, char *str, int value):

Same as above, but window and widget are resolved thru names, and
not numeric id.

37.59 int raydium_gui_button_clicked(void):

This function will return the id of the last clicked button,
or -1 if none were clicked.
The id is built like this : window * 1000 + widget_id
Usefull for PHP scripts, since it's not possible to create callback for
buttons with RayPHP.

37.60 int raydium_gui_list_id(char *item, char *list):

This function will return item's id in list. Returns -1 if not found.
Useful for combo index, for example.

37.61 void raydium_gui_widget_focus(int widget, int window):

Sets focus on widget for window.

37.62 void raydium_gui_widget_focus_name(char *widget, char *window):

Same as above, but using widget and window names


38 Data registration:

38.1 Introduction:

Raydium supports scripting, for example using PHP in the current implementation.
All raydium_register_* functions are provided as a "bridge" between
your applications and PHP scripts, allowing you to "export" native variables
and functions to PHP scripts.
For more informations, see PHP chapters.

38.2 int raydium_register_find_name (char *name):

Lookups a variable by name. Search is not possible (yet) for
registered functions.
Mostly used internally.

38.3 signed char raydium_register_name_isvalid (char *name):

Tests name, and returns his viability as a boolean.
Accepted intervals for variables and functions: [a-z], [A-Z] and '_'
Numerics are not allowed.

38.4 int raydium_register_variable (void *addr, int type, char *name):

Will register a new variable. You must provide variable's address (addr),
type and name.
Current available types are: RAYDIUM_REGISTER_INT, RAYDIUM_REGISTER_FLOAT,
and RAYDIUM_REGISTER_STR.

38.5 int raydium_register_variable_const_f(float val, char *name):

Will register a new float constant.

38.6 int raydium_register_variable_const_i(int val, char *name):

Will register a new int constant.

38.7 void raydium_register_variable_unregister_last (void):

Variable are registered on a stack. As you may want to create "temporary"
variables (usefull for building script's arguments, for example), this function
allows you to unregister last registered variable. Multiple calls are possible.

38.8 int raydium_register_modifiy (char *var, char *args):

Deprecated.

38.9 void raydium_register_function (void *addr, char *name):

Will register a function. You only need to provide an address (addr)
and a name.

38.10 void raydium_register_dump (void):

Will dump to console all registered variables and functions.


39 PHP scripting engine:

39.1 Introduction:

Most of this module is dedicated to RayPHP internal uses, where Raydium deals
with Zend engine.

The raydium_php_exec() function is the interesting part of this module,
allowing you to call external PHP script in your application.

You may have a look the "Data Registration" chapter to know how "share"
data between your application and your PHP scripts.

39.2 int raydium_php_exec (char *name):

This function will call name PHP script. All registered variables and
functions are exported to the script, and variable can be changed from the
script itself if needed.

This function will not use R3S to download a missing PHP script, for
obvious security reasons. But you may use PHP "allow_url_fopen" feature to
download things from your PHP scripts, if needed.

In PHP scripts, be sure to pre-alloc strings when calling Raydium functions
supposed to write to arguments. See this example:
$str=str_pad("",256); // "pre-alloc"
raydium_gui_read_name("main","track",$str);
echo "$str";




40 Profiling (sort of ...):

40.1 Introduction:

You will find here a few functions for a very simple profiling.
For anything else than a quick time measure, use real profiling tools.
Note: Use only one "profiler" at a time.

40.2 void raydium_profile_start(void):

Starts measure.

40.3 void raydium_profile_end(char *tag):

Stops measure and displays result using tag string.


41 RayPHP (internals):

41.1 Introduction:

Raydium also use RayPHP (Raydium/PHP interface) for its own needs.
For PHP part of these functions, see "rayphp/" directory.
So far, RayPHP is dedicated to R3S (Raydium Server Side Scripts) access.
All this is mostly usefull for internal uses, since Raydium provides fopen
wrappers, thru raydium_file_fopen.

R3S is able to work with HTTP and FTP, and supports proxy using raydium.db
configuration database. Example :
Generic-Proxy;http://proxy:3128/

The trailing / (slash) must be present.

41.2 void raydium_php_rayphp_path_change(char *path):

By default, Raydium search for a "rayphp/" subdirectory in the application
directory. It's possible to change this using a --rayphp command line
switch, or using this function. You must call the function as soon as possible,
before window creation, but after raydium_init_args*().
You should probably avoid this function, since it disables the regular 'rayphp'
scripts automatic search.

41.3 int raydium_rayphp_repository_file_get (char *path):

Will contact R3S servers for downloading path file.

41.4 int raydium_rayphp_repository_file_put (char *path, int depends):

Will contact R3S servers for uploading path file. Set depends to
true (1) if you also want to upload dependencies, false (0) otherwise.

41.5 int raydium_rayphp_repository_file_list(char *filter):

Will contact R3S servers to get file list, using filter (shell-like
syntax). Default filter is *.

41.6 signed char raydium_rayphp_http_test(void):

Test if Internet connection is available using Raydium website.
(0 means 'not available', 1 means 'OK')

41.7 signed char raydium_rayphp_zip_extract(char *file, char *to):

Will extract file zip to the to directory. (must have write
access to this directory, of course)
The file path is used as-is. No R3S download, no search path, ...
Returns 1 when OK, 0 when fails.
Use PHP ZipArchive? class.

41.8 signed char raydium_rayphp_zip_add(char * zip_file, char * full_file_name,char * file_name):

Add file_name to zip_file package file, file is read according to full_file_name path.
Returns 1 when OK, 0 when fails.

41.9 signed char raydium_rayphp_repository_defaults(char *def):

Gives the default repositories for this application.

This function will create two files, repositories.list and
repositories.upload in game user home directory, if these files
don't alreay exist, and will fill the files with def.
This argument is an URL, or a list of URLs (use \n separator). See R3S doc.


42 Text file parsing:

42.1 Introduction:

Raydium provides a set of functions dedicated to text files parsing. These
files must follow a simple syntax:
// strings
variable_s="string value";
 
// float (or integer, i.e.)
variable_f=10.5;
 
// float array
variable_a={1,2,10.5};
 
// raw data
variable_r=[
xxxxxxxx
#  oo  #
#      #
#  oo  #
xxxxxxxx
];

Semi-colon are purely esthetic, and you can put comments almost where you want.

42.2 void raydium_parser_trim_right(char *org):

Strip whitespace (or other characters) from the and end of a string.
Note: unless raydium_parser_trim(), semicolon is not removed.

42.3 void raydium_parser_trim(char *org):

Strip whitespace (or other characters) from the beginning and end of a string.
So far, ' ', '\n' and ';' are deleted.

42.4 signed char raydium_parser_isdata(char *str):

Returns true (1) if str contains data, false (0) otherwise (comments and
blank lines).

42.5 signed char raydium_parser_cut(char *str, char *part1, char *part2, char separator):

This function will cut str in two parts (part1 and part2) on
separator. No memory allocation will be done by this functions.
First occurence of separator is used (left cut).
Return true (i+1) if str was cut, where i is the separator position.
Return false (0) otherwise (and then part1 is a copy of str).

42.6 int raydium_parser_replace(char *str, char what, char with):

Will replace all occurences of character what with with.
Returns the number of replaced characters.
Warning, the string is actually modified: don't apply this on static strings,
consts, function arguments that shouldn't be modified, ...

42.7 int raydium_parser_remove(char *str, char what):

Remove all occurences of character what in the str string.
Returns the number of removed characters.
String is modified, see the warning above.

42.8 int raydium_parser_read(char *var, char *val_s, GLfloat *val_f, int *size, FILE *fp):

Reads a new data line in fp.
var will contain variable name. You'll find associated value in val_s
if it's a string, or val_f if it's a float (or a float array). In this last
case, size will return the number of elements if the array.
Watch out for buffer overflows with float arrays !
Returns RAYDIUM_PARSER_TYPE_STRING if the line read is an string like:
variable="string between double quotes";
Returns RAYDIUM_PARSER_TYPE_FLOAT if the line read is an float array like:
variable={1.0,2.0,3.0,4.0};
Returns RAYDIUM_PARSER_TYPE_RAWDATA for things like:
variable=[
xxxxxxxx
#  oo  #
#      #
#  oo  #
xxxxxxxx
];

Returns RAYDIUM_PARSER_TYPE_EOF at the end of file.

FILE *fp;
int ret;
char var[RAYDIUM_MAX_NAME_LEN];
char val_s[RAYDIUM_MAX_NAME_LEN];
GLfloat val_f[MY_ARRAY_SIZE];
int size;
 
fp=raydium_file_fopen("foobar.txt","rt");
 
while( (ret=raydium_parser_read(var,val_s,val_f,&size,fp))!=RAYDIUM_PARSER_TYPE_EOF)
{
if(!strcasecmp(var,"foobar_variable"))
{
if(ret!=RAYDIUM_PARSER_TYPE_FLOAT || size!=2)
{
raydium_log("error: foobar_variable is not float array");
continue;
}
memcpy(...);
}
 
...
 
}


42.9 signed char raydium_parser_db_get(char *key, char *value, char *def):

This function will copy the value of key from Raydium's database to
value. If key is not found, def is used as a default value.

If you do not want to use a default value, give NULL to def,
and the function will return 0 when key was not found.

No memory allocation is done for you.

42.10 signed char raydium_parser_db_set(char *key, char *value):

Sets key in the Raydium's database to value.
This function will return 0 if failed.


43 Live textures and videos API:

43.1 Introduction:

Live API features two distinct parts:

1 - It provides an easy way to create and manage dynamic textures, since you
just have to give a pointer to your image data, and call suitable function
each time this image is changing.

2 - This API also supports video4linux (aka V4L), as an extension of
the Live API. The main goal is to link a video4linux device (webcam,
tv card, ...) to a texture. A callback is also available if you want to
get (and transform) data of every capture.

You'll find detailed informations for each domain below.

43.2 Color conversion:

Live API used to work with RGB and RGBA color formats. Since some V4L
devices use other patterns, Live API needs conversion functions.
You've no need to do color conversion by yourself, consider all this
as internal functions.

43.3 void v4l_copy_420_block (int yTL, int yTR, int yBL, int yBR, int u, int v, int rowPixels, unsigned char *rgb, int bits):

YUV420P block copy.
This code is not native.

43.4 int v4l_yuv420p2rgb (unsigned char *rgb_out, unsigned char *yuv_in, int width, int height, int bits):

YUV420P to RGB conversion.
This code is not native.

43.5 Live Video API:

This part of the Live API id dedicated to video devices. For now, the
support is limited to Linux thru V4L API. Every V4L compatible device
should work with Live Video, but for any advanced setup of your video
device (tuner configuration, source, FPS, ...), you must use an external
tool.
By default, Live API supports up to 4 simultaneous devices.

43.6 signed char raydium_live_video_isvalid(int i):

Internal use, but you can call this function if you want to verify if a
live video device id is valid (in bounds, open, and ready to capture).

43.7 int raydium_live_video_find_free(void):

Internal use.
Finds a free live video device slot.

43.8 int raydium_live_video_open(char *device, int sizex, int sizey):

This is where you should start. This function opens device (something
like "/dev/video0"), requesting sizex x sizey resolution.
If device is RAYDIUM_LIVE_DEVICE_AUTO, Raydium will use a default device,
hardcoded or given thru commande line (--video-device).
Same story for sizes, with RAYDIUM_LIVE_SIZE_AUTO.
This function will try to detect a compatible palette (grayscale, rgb,
yuv420p, with 4, 6, 8, 15, 16 and 24 bits per pixel) and capture
method (read() or mmap()).
Returns -1 in case or error, device id otherwise.

43.9 int raydium_live_video_open_auto(void):

Same as above, but with full autodetection.

43.10 int raydium_live_video_read(raydium_live_Device *dev):

Internal V4L read function.

43.11 void raydium_internal_live_video_callback(void):

internal frame callback.

43.12 Live API Core:

the main goal of the Live API is to allow you to create your own
dynamic textures. The first method is to provide your own picture data thru a
pointer, the second method is to use a Live Video device (see above) as
data source.

43.13 void raydium_internal_live_close(void):

Internal close function.

43.14 void raydium_live_init(void):

Internal init function.

43.15 signed char raydium_live_texture_isvalid(int i):

Internal use, but you can call this function if you want to verify if a
live texture id is valid (in bounds, open, and ready to capture).

43.16 int raydium_live_texture_find_free(void):

Internal use.
Finds a free live texture slot.

43.17 int raydium_live_texture_find(int original_texture):

Resolvs original_texture id (native Raydium texture id) to a
live texture id, if any.

43.18 int raydium_live_texture_create(char *as, unsigned char *data_source, int tx, int ty, int bpp):

Create a new Live Texture with as name. You must provide a data_source
with RGB or RGBA format, with tx and ty size.
Possible bpp values are 24 (RGB) and 32 (RGBA).
Returns the live texture id, or -1 when it fails.

43.19 int raydium_live_texture_video(int device_id, char *as):

This is another way to create a Live Texture, but using a Live Video device
for data source. Provide texture name (as) and Live device_id.

43.20 void raydium_live_texture_refresh(int livetex):

When your data source have changed, call this function to refresh new
data to hardware. Obviously, this function is useless for Live Video textures
since Raydium will automatically refresh data.

43.21 void raydium_live_texture_refresh_name(char *texture):

Same as above, but using texture name.

43.22 void raydium_live_texture_refresh_callback_set(int livetex, void *callback):

You can create a "OnRefresh?" callback for any Live Texture (livetex is an
id to this texture). This is mostly usefull for Live Video texture.
Your callback must follow this prototype :
int refresh_callback(unsigned char *data, int tx, int ty, int bpp)
You have full write access to data, allowing you to draw over
the provided picture (warning: for non video Live textures, data pointer
is not owned by Raydium and may be "read only")
You must return 1 to confirm data flushing, or 0 to cancel this refresh.

43.23 void raydium_live_texture_refresh_callback_set_name(char *texture, void *callback):

Same as above, but using texture name.

43.24 void raydium_live_texture_mask(int livetex, GLfloat alpha):

This function will draw a fullscreen mask using livetex Live Texture id and
alpha opacity (0 means transparent, 1 means fully opaque, allowing any
intermediate value). Use this function at any place of your rendering
function AFTER camera call and obviously before raydium_rendering_finish.

43.25 void raydium_live_texture_mask_name(char *texture, GLfloat alpha):

Same as above, but using texture name.

43.26 void raydium_live_texture_draw(int livetex, GLfloat alpha,GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2):

This function is a clone of raydium_osd_draw(), dedicated to live textures.
This function will draw the video livetex on the screen, from (x1,y1) to
(x2,y2).

43.27 void raydium_live_texture_draw_name(char *texture, GLfloat alpha,GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2):

Same as above, but using texture name.


44 Video playback:

44.1 Introduction:

Raydium supports simple video playback, using a simple dedicated video
codec (JPGS), useful for menus enhancements, "speaking" thumbnails, ...
This codec now supports audio syncing with OGG files.
You will find an small utility, mk_jpgs in Raydium source tree, didacted to
movie creation.
The Raydium official source tree also provides a small JPGS player,
named jpgs_play.c. You can compile it like any other Raydium application.

44.2 How to create a JPGS movie ?:

First, compile mk_jpgs: example: gcc mk_jpgs.c -o mk_jpgs or any other
standard build command.
Then, generate JPEG pictures (using a temporary directory, if possible), with
something like mplayer, for example:
mplayer movie.avi -vo jpeg:quality=50 -vf scale=256:256 -nosound -fps 1000,
where you may change quality factor and output size. Use "hardware friendly"
sizes (64, 128,256,...) !
You can now build JPGS file:
./mk_jpgs 25 256 256 video.jpgs (fps, size x, size y, output file)
If you want to extract the audio, use this:
mplayer -vc nul -vo null -ao pcm:file=audio.dump movie.avi
oggenc audio.dump

44.3 void raydium_video_init(void):

Internal use.

44.4 signed char raydium_video_isvalid(int i):

Internal use, but you can call this function if you want to check if a
video id is valid (in bounds and open).

44.5 int raydium_video_find_free(void):

Internal use.
Finds a free video slot.

44.6 int raydium_video_find(char *name):

Resolvs video name, returning video id.
Returns -1 when video is not found.

44.7 void raydium_video_jpeg_decompress(FILE *fp,unsigned char *to):

Internal.

44.8 int raydium_video_open(char *filename, char *as):

This function will open and prepare video filename, and will attach
this video to a "live texture" (see Live API chapter, if needed).
The playback starts automatically.
You can then display the video with OSD functions like, for
example, raydium_live_texture_mask_name() or using it within meshes.

44.9 int raydium_video_open_with_sound(char *filename, char *as, char *ogg):

Same as above, but it will also play the ogg file, synced with the
video stream.

44.10 void raydium_video_callback_video(int id):

Internal use.

44.11 float raydium_video_sound_callback(void):

Internal use. Callback for sound.c BufferData? function.

44.12 void raydium_video_callback(void):

Internal use. Frame callback.

44.13 void raydium_video_delete(int id):

Will delete video id. Warning: this function will not delete
associated Live texture, so you may open a new video with the same
texture name, but video size must be the same a the previous one.

44.14 void raydium_video_delete_name(char *name):

Same as above, using video name.

44.15 void raydium_video_loop(int id, signed char loop):

Sets loop attribute for the video id. By defaults, video loops. Call
this function with loop=0 to disable this behavior.

44.16 void raydium_video_loop_name(char *name, signed char loop):

Same as above, using video name.

44.17 signed char raydium_video_isplaying(int id):

Returns 1 is video id is playing, 0 if this video is stopped,
and -1 if function failed.

44.18 signed char raydium_video_isplaying_name(char *name):

Same as above, using video name.

44.19 void raydium_video_fps_change(int id, float fps):

This function will change the play rate of video id to fps frames
per second.

44.20 void raydium_video_fps_change_name(char *name, float fps):

Same as above, using video name.

44.21 float raydium_video_elapsed(int id):

Will return, in seconds, the elapsed time for the video id.

44.22 float raydium_video_elapsed_name(char *name):

Same as above, using video name.

44.23 float raydium_video_duration(int id):

Will return, in seconds, the total duration for the video id.

44.24 float raydium_video_duration_name(char *name):

Same as above, using video name.

44.25 signed char raydium_video_seek(int id, float time):

Will jump at time (in seconds) in the id video.

44.26 signed char raydium_video_seek_name(char *name, float time):

Same as above, using video name.

44.27 signed char raydium_video_seek_rel(int id, float time):

Will seek from time seconds in the video id from the current elasped
time. It's a relative jump, in other words.
You can use negative values for forward jumps.

44.28 signed char raydium_video_seek_rel_name(char *name, float time):

Same as above, using video name.


45 Integrated Physics (ODE):

45.1 Introduction:

Raydium allows you to build applications with full physics, using ODE (Open
Dynamics Engine). ODE is "an open source, high performance library for
simulating rigid body dynamics", and is fully integrated into Raydium, with
the usual abstraction. You can build cars, ragdolls, rockets, ... with
only few lines of code. Physics are linked to sound API, particles engine,
network layer, ... so you've almost nothing else to do but setting up objects.

Raydium's website provides tutorials for building physics ready applications.

45.2 Vocabulary:

Raydium physics use a simple vocabulary, with a few entities :
- Objects:
Objects are containers, with no direct visual appearance. An object contains
elements and joints (see below). By default, all elements in an object
doesn't collide each others. "Car", "Player", "Crane" are good object examples.

- Elements:
Elements are the main thing you will play with. An element is rendered using
an associated 3D mesh, is configured with a geometry, density, a size,
collides with others elements, ...
An element must be owned by an object.
For now, there is 3 element types (standard, satic, fixing). Static elements
are unmovable, they just collide with other elements, usefull for very
big elements, or externally controlled elements (motion capture, network,
haptic interface, ...), for example.
Raydium supports boxes and spheres.

- Joints:
Joints are dedicated to elements linking. A joint must be linked with two
elements or unwanted behaviors may happen.
For now, Raydium supports 4 joint types (hinge, hinge2, universal, fixed), and
you will find more informations with suitable functions documentation, below.
On a joint, you could setup limits (min and max for all axes) and a maximum
force before joint breaks, if needed.
It's now possible to attach a joint to static environnement using the
constant RAYDIUM_ODE_JOINT_FIXED (do not use this value with "_name" joint
functions, since they want a string, not a integer constant).

- Motors:
A motor is linked to joints, and may powering an unlimited amount of joints.
For now, 3 motor types are available: engine, angular and rocket.

Engine type works the same way as a car's engine: it will try to
make "something" turning, at the desired speed. You can link a
gearbox to this type (and only this one).

Angular type will try to rotate "something" to the desired angle,
usefull for car's front wheels, for example.

Rocket type is very simple: give a force and an orientation. Usefull for
creating copters, rockets, and for elements "pushing", for example.
Special rocket is avaiblable for FPS style player controls.
Warning, a rocket is linked to an element ! (not a joint)

- Explosions:
Explosions are not directly related to rigid body physics, but consider it
as a high level primitive.
With Raydium, you have two different ways to create an explosion.

First, you can create a "blowing explosion", generating a spherical blow. Any
element in this growing sphere will be ejected.
Use this for very consequent explosions only !

Next, you can create an instantaneous explosion, with a degressive blowing
effect. A force is applied to every body found inside the blowing radius,
proportional to distance from the explosion's center. Usefull for smaller
explosions.

- Launchers:
Launchers are not real entities, but "only" tools. Obviously, they are
allowing you to launch an element (you must provice force and orientation)
from another element (relatively). More informations about launchers below.


45.3 About RayODE names:

- Important: All ODE Objects, elements, motors,... must have unique name !
So, here is an example of what you SHOULD NOT DO:
int car1=raydium_ode_object_create("car");
int car2=raydium_ode_object_create("car");
int car3=raydium_ode_object_create("car");


Ant this is the right way:
int car1=raydium_ode_object_create("car1");
int car2=raydium_ode_object_create("car2");
int car3=raydium_ode_object_create("car3");


45.4 Callbacks:

For advanced uses, you may want to enter into some "internal" parts of
RayODE. Many callbacks are available for such needs.
To cancel any callback, set its value to NULL (default value).
Here is a quick list:

- raydium_ode_StepCallback
This callback is fired before every ODE callback. Since physcis callback
frequency may change (see raydium_ode_time_change) during slow motion
scenes, for example, this callback is quiet useful.
Callback prototype: void f(void);


- raydium_ode_ObjectNearCollide
When two objects are too near, before lauching "expensive" collision tests,
Raydium is firing this event.

Callback prototype: signed char f(int obj1, int obj2);
obj1 and obj2 are the two objets, and you must return true (1) if
you want to "validate" collision, or false (0) if you don't want that two
objects to collide.


- raydium_ode_CollideCallback
When two objects collides, Raydium will search all collisions between
every elements. For each contact, this callback is fired. For complex
objects, with a lot of elements, this callback may be fired a very large
number of times during one ODE step ! Do only simple things here.

Callback prototype: signed char f(int e1, int e2, dContact *c);
e1 and e2 are the two colliding elements, and you must return true (1)
if you want to "validate" this contact, or false (0) to cancel this contact
(and only this one !)

See ODE documentation, chapter 7.3.7, for more informations about dContact
structure.


- raydium_ode_ExplosionCallback
At every explosion, of any type, this event is fired. This is the best
place to play suitable sound, create particles and such things.

Callback prototype: void f(signed char type, dReal radius, dReal force_or_propag, dReal *pos);
You can find in callback params:
explosion type (see above), radius, force or propag (depending on
explosion type) and pos, an array of 3 dReal values for explosion position.
The value you will find in force_or_propag is something
like RAYDIUM_ODE_NETWORK_EXPLOSION_* (EXPL or BLOW).


- raydium_ode_BeforeElementDrawCallback
When raydium_ode_draw_all(RAYDIUM_ODE_DRAW_NORMAL) is called, for every
element to draw, this callback is before element drawing.

Callback prototype: signed char f(int elem);
elem is the element'id. Return true (1) if you want to draw this element,
or false (0) otherwise. This is also the best place to drawn team colors on
cars, for example (see raydium_rendering_rgb_force for this use).


- raydium_ode_AfterElementDrawCallback
Same as the previous callback, but after element drawing.

Callback prototype: void f(int elem);
With the previous example (team colors), this is the place to restore
default rendering state (see raydium_rendering_rgb_normal).

- raydium_ode_RayCallback
See ray related functions, below. This callback is used to filter
elements and create contacts during a ray launch.

45.5 Miscallenous:

By default, ODE is called 400 times per second, allowing very accurate
physics. You may change this using raydium_ode_set_physics_freq,
but most ERP and CFM values must be changed in your
applications. ODE use a lot of cache mechanisms, so 400 Hz is a reasonable value.

Please note RayODE interface is using dReal ODE type for variables.
For now, dReal is an alias to float type. But please use sizeof().

Raydium provides some other functions for advanced uses, and you can
access directly to ODE API for very experienced users.

See also the ODE documentation: http://opende.sourceforge.net/ode-latest-userguide.html

45.6 void raydium_ode_name_auto (char *prefix, char *dest):

This function will generate a single name, using prefix. The generated
name is stored at dest address. No memory allocation is done.
Example : raydium_ode_name_auto("prefix",str) may generate something
like prefix_ode_0.

45.7 void raydium_ode_init_object (int i):

Will initialize (or erase) object i. Mostly for internal uses.

45.8 void raydium_ode_init_element (int i):

Will initialize (or erase) element i. Mostly for internal uses.

45.9 void raydium_ode_init_joint (int i):

Will initialize (or erase) joint i. Mostly for internal uses.

45.10 void raydium_ode_init_motor (int i):

Will initialize (or erase) motor i. Mostly for internal uses.

45.11 void raydium_ode_init_explosion (int e):

Will initialize (or erase) spherical explosiion i. Mostly for internal uses.

45.12 void raydium_ode_init (void):

Will initialize all RayODE interface. Never call this function by yourself.

45.13 void raydium_ode_gravity(dReal *vect):

Change world gravity using vect, a 3 floats arrays.
Default value is {0,0,-1}.

45.14 void raydium_ode_gravity_3f(dReal gx, dReal gy, dReal gz):

Same as above, using 3 float values.

45.15 signed char raydium_ode_object_isvalid (int i):

Will return 0 (false) if object i is not valid (free slot or out of bounds)
or 1 (true) otherwise.

45.16 signed char raydium_ode_element_isvalid (int i):

Will return 0 (false) if element i is not valid (free slot or out of bounds)
or 1 (true) otherwise.

45.17 signed char raydium_ode_joint_isvalid (int i):

Will return 0 (false) if joint i is not valid (free slot or out of bounds)
or 1 (true) otherwise.

45.18 signed char raydium_ode_motor_isvalid (int i):

Will return 0 (false) if motor i is not valid (free slot or out of bounds)
or 1 (true) otherwise.

45.19 signed char raydium_ode_explosion_isvalid (int i):

Will return 0 (false) if explosion i is not valid (free slot or out of bounds)
or 1 (true) otherwise.

45.20 void raydium_ode_ground_dTriArrayCallback (dGeomID TriMesh?, dGeomID RefObject?, const int *TriIndices?, int TriCount?):

Internal. Unsupported.

45.21 int raydium_ode_ground_dTriCallback (dGeomID TriMesh?, dGeomID RefObject?, int TriangleIndex?):

Internal. Unsupported.

45.22 int raydium_ode_ground_set_name (char *name):

ground is a primitive for RayODE interface. You only have to set ground
mesh name (.tri file). You may call this function many times, if needed,
switching from one ground to another on the fly.
Warning: triangle normals are very important for ground models !

45.23 int raydium_ode_object_find (char *name):

Resolves object id from its name.

45.24 int raydium_ode_element_find (char *name):

Resolves element id from its name.

45.25 int raydium_ode_joint_find (char *name):

Resolves joint id from its name.

45.26 int raydium_ode_motor_find (char *name):

Resolves motor id from its name.

45.27 int raydium_ode_explosion_find (char *name):

Resolves explosion id from its name.

45.28 int raydium_ode_object_create (char *name):

Will build a new object with name. Returns new object id, or -1 when
it fails.

45.29 signed char raydium_ode_object_rename (int o, char *newname):

Will rename object o with a newname.

45.30 signed char raydium_ode_object_rename_name (char *o, char *newname):

Same as above, but from object's name (o).

45.31 signed char raydium_ode_object_colliding (int o, signed char colliding):

By default, all elements from an object are not colliding each others.
The only exception is for GLOBAL object.
If you want to change this behaviour for o object, sets colliding
to 1 (true). 0 (false) sets back to default behaviour (no internal collisions).

45.32 signed char raydium_ode_object_colliding_name (char *o, signed char colliding):

Same as above, but using object's name.

45.33 void raydium_ode_object_linearvelocity_set (int o, dReal * vect):

Sets linear velocity for all elements of object o. Velocity is sets thru
vect, a 3 x dReal array.
Use with caution, setting an arbitrary linear velocity may cause unwanted
behaviours.

45.34 void raydium_ode_object_linearvelocity_set_name (char *o, dReal * vect):

Same as above, but using object's name.

45.35 void raydium_ode_object_linearvelocity_set_name_3f (char *o, dReal vx, dReal vy, dReal vz):

Same as above, but using 3 dReal values.

45.36 void raydium_ode_object_addforce (int o, dReal *vect):

Add force vect to all elements of object o.
Force is sets thru vect, a 3 x dReal array.
Prefer this method to ..._linearvelocity_set... functions.

45.37 void raydium_ode_object_addforce_3f (int o, dReal vx, dReal vy, dReal vz):

Same as above, but using 3 dReal values.

45.38 void raydium_ode_object_addforce_name (char *o, dReal * vect):

Same as above, but using object's name.

45.39 void raydium_ode_object_addforce_name_3f (char *o, dReal vx, dReal vy, dReal vz):

Same as above, but using 3 dReal values.

45.40 void raydium_ode_element_addforce (int e, dReal *vect):

Adds force vect to element e.
Force is sets thru vect, a 3 x dReal array.

45.41 void raydium_ode_element_addforce_3f (int e, dReal fx, dReal fu, dReal fz):

Same as above, but using 3 dReal values.

45.42 void raydium_ode_element_addforce_name (char *e, dReal * vect):

Same as above, but using element's name and one vector.

45.43 void raydium_ode_element_addforce_name_3f (char *e, dReal vx, dReal vy, dReal vz):

Same as above, but using 3 dReal values.

45.44 dReal * raydium_ode_element_force_get(int e):

Return forces accumulated by a given body;

45.45 dReal * raydium_ode_element_force_get_name(char * elem):

Same as above with the name.

45.46 void raydium_ode_element_addtorque (int e, dReal * vect):

Adds torque vect to element e.
Torque is sets thru vect, a 3 x dReal array.

45.47 void raydium_ode_element_addtorque_3f(int e, dReal vx, dReal vy, dReal vz):

Same as above using 3 dReal values.

45.48 void raydium_ode_element_addtorque_name (char *e, dReal * vect):

Same as above, but using element's name.

45.49 void raydium_ode_element_addtorque_name_3f (char *e, dReal vx, dReal vy, dReal vz):

Same as above, but using 3 dReal values.

45.50 signed char raydium_ode_element_material (int e, dReal erp, dReal cfm):

When two elements collides, there's two important parameters used for
contact point generation : ERP and CFM.
ERP means "Error Reduction Parameter", and its value is between 0 and 1 and
CFM means "Constraint Force Mixing".
Changing ERP and CFM values will change the way this element collides with
other elements, providing a "material" notion.
Raydium provides a few default values, see RAYDIUM_ODE_MATERIAL_* defines
in raydium/ode.h file (hard, medium, soft, soft2, default, ...).

For more informations, see ODE documentation, chapters 3.7 and 3.8.

45.51 signed char raydium_ode_element_material_name (char *name, dReal erp, dReal cfm):

Same as above, but using element's name.

45.52 signed char raydium_ode_element_slip (int e, dReal slip):

Slip parameter is a complement of material values (ERP and CFM, see above).
Raydium provides a few default values, see RAYDIUM_ODE_SLIP_* defines
in raydium/ode.h file (ice, player, normal, default).

45.53 signed char raydium_ode_element_slip_name (char *e, dReal slip):

Same as above, but using element's name.

45.54 signed char raydium_ode_element_rotfriction (int e, dReal rotfriction):

rotfriction stands for "Rotation Friction", "Rolling Friction",
"Damping Effect", ...
With RayODE, by default, when a sphere element is rolling over a flat ground,
it will roll forever. Applying a rotfriction factor will solve this.
A value of 0 will disable rotation friction.
Example:
#define ROTFRICTION     0.0005
raydium_ode_element_rotfriction(elem,ROTFRICTION);


45.55 signed char raydium_ode_element_rotfriction_name (char *e, dReal rotfriction):

Same as above, but using element's name.

45.56 dReal *raydium_ode_element_linearvelocity_get (int e):

Returns a pointer to element's linear velocity. Linear velocity is an
array of 3 x dReal.
Example:
dReal *p;
p=raydium_ode_element_linearvelocity_get(elem);
raydium_log("%f %f %f",p[0],p[1],p[2]);

Returned data is available only for the current frame.

45.57 dReal *raydium_ode_element_linearvelocity_get_name(char *e):

Same as above using element name.

45.58 void raydium_ode_element_linearvelocity_set (int e, dReal *vel):

Set element's linear velocity. Linear velocity is an
array of 3 x dReal.

45.59 void raydium_ode_element_linearvelocity_set_name (char * e, dReal *vel):

Same as above usign element's name.

45.60 void raydium_ode_element_linearvelocity_set_3f (int e, dReal velx, dReal vely, dReal velz):

Same as above, using 3 dReal values.

45.61 void raydium_ode_element_linearvelocity_set_name_3f(char *e, dReal vx, dReal vy, dReal vz):

Same as above using element name.

45.62 void raydium_ode_element_angularvelocity_set (int e,dReal *avel):

Set element's angular velocity. Angular velocity is an
array of 3 x dReal.

45.63 void raydium_ode_element_angularvelocity_set_3f (int e,dReal avelx,dReal avely,dReal avelz):

Same as above, 3 dReal.

45.64 void raydium_ode_element_angularvelocity_set_name (char * e,dReal *avel):

Set element's angular velocity using it's name. Angular velocity is an
array of 3 x dReal.

45.65 void raydium_ode_element_angularvelocity_set_name_3f (char * e,dReal avelx,dReal avely,dReal avelz):

Same as above, 3 dReal.

45.66 dReal * raydium_ode_element_angularvelocity_get(int elem):

Return element angular velocity. Return is aun array of 3 real.

45.67 dReal * raydium_ode_element_angularvelocity_get_name(char *elem):

Same as above using element name.

45.68 void raydium_ode_element_OnBlow (int e, void *OnBlow?):

During an instantaneous explosion, all elements inside the blow's radius may
fire an OnBlow? callback (event), if set.
OnBlow? callback must follow this prototype :
void blow_touched(int elem, dReal force, dReal max_force)

elem is the element id.
force is the amount of force received from explosion.
max_force is the amount of force at the core of the explosion.

Sets OnBlow? to NULL if you want to disable this callback.

45.69 void raydium_ode_element_OnBlow_name (char *e, void *OnBlow?):

Same as above, but using element's name.

45.70 void raydium_ode_element_OnDelete (int e, void *OnDelete?):

OnDelete? callback is fired when someone or something tries to delete an element.
This callback can cancel deletion, if needed.

OnBlow? callback must follow this prototype :
int element_delete(int elem)
elem is the element id. Return 1 (true) to confirm deletion, of 0 to cancel.

Sets OnDelete? to NULL if you want to disable this callback.

45.71 void raydium_ode_element_OnDelete_name (char *e, void *OnDelete?):

Same as above, but using element's name.

45.72 void raydium_ode_object_OnDelete (int o, void *OnDelete?):

OnDelete? callback is fired when someone or something tries to delete an object.
This callback can cancel deletion, if needed.

OnDelete? callback must follow this prototype :
int object_delete(int obj)
obj is the object id. Return 1 (true) to confirm deletion, of 0 to cancel.

Sets OnDelete? to NULL if you want to disable this callback.

45.73 void raydium_ode_object_OnDelete_name (char *o, void *OnDelete?):

Same as above, but using object's name.

45.74 void raydium_ode_element_gravity (int e, signed char enable):

By default, gravity applies to every element of the scene. If you want
to disable gravity for element e, set enable to 0 (false).
You can restore gravity with enable sets to 1 (true).

45.75 void raydium_ode_element_gravity_name (char *e, signed char enable):

Same as above, but using element's name.

45.76 void raydium_ode_element_ttl_set (int e, int ttl):

TTL means Time To Live. Setting a TTL on an element will automatically
delete this element when TTL expires.

- TTL unit: ttl is given in ODE steps (see example, below).
- TTL deletion may be canceled by OnDelete? callback (see above).
- TTL may be changed on the fly, at anytime.
- a ttl value of -1 will disable TTL.

example:
raydium_ode_element_ttl_set(elem,raydium_ode_physics_freq*5); // 5 seconds 
 


45.77 void raydium_ode_element_ttl_set_name (char *e, int ttl):

Same as above, but using element's name.

45.78 signed char raydium_ode_element_rel2world(int element,dReal *rel,dReal *world):

Utility function that take a point on a element (rel is a dReal[3]) and
return that point's position or velocity in world coordinates (world is
a dReal[3] too).

No memory allocation is done here.

This function can be used on normal and static elements.
Note: This is a "Raydium clone" of dBodyGetRelPointPos.

45.79 signed char raydium_ode_element_world2rel(int element,dReal *world,dReal *rel):

Inverse of raydium_ode_element_rel2world. Input (world) is in world
coordinates and ouput (rel) is in element's relative space.

No memory allocation is done here.

This function can be used on normal and static elements.
Note: This is a "Raydium clone" of dBodyGetPosRelPoint.

45.80 signed char raydium_ode_element_vect2world(int element,dReal *vect,dReal *world):

Given a vector expressed in the element coordinate system (dReal[3]),
rotate it to the world coordinate system (world, dReal[3]).

No memory allocation is done here.

This function can be used on normal and static elements.
Note: This is a "Raydium clone" of dBodyVectorToWorld.

45.81 signed char raydium_ode_element_aabb_get (int element, dReal * aabb):

AABB means Axis-Aligned Bounding Box. This function will return element's
bounding box on X, Y and Z axis.

aabb is a pointer to an array of 6 x dReal. The aabb array has
elements (minx, maxx, miny, maxy, minz, maxz).
No memory allocation is done.
Will return 0 (false) in case of failure.

45.82 signed char raydium_ode_element_aabb_get_name (char *element, dReal * aabb):

Same as above, but using element's name.

45.83 int raydium_ode_element_touched_get (int e):

Every element provide a "touched" flag. If element e is touching anything,
this function will return 1 (true).

45.84 int raydium_ode_element_touched_get_name (char *e):

Same as above, but using element's name.

45.85 signed char raydium_ode_element_player_set (int e, signed char isplayer):

RayODE provides a special behaviour for FPS style players, also
named "standing geoms". The idea is simple : a player element is always
upright, and you can set an arbitrary rotation angle around Z axis anytime.
Sets isplayer to 1 (true) to transform element e into a "player element".

45.86 signed char raydium_ode_element_player_set_name (char *name, signed char isplayer):

Same as above, but using element's name.

45.87 signed char raydium_ode_element_player_get (int e):

Returns if element e is a "player element" (1, true) or not (0, false).
See above for more informations about player elements.

45.88 signed char raydium_ode_element_player_get_name (char *name):

Same as above, but using element's name.

45.89 signed char raydium_ode_element_player_angle (int e, dReal angle):

Sets "standing geom" Z rotation angle (radian) for element e.
See above for more informations about player elements.

45.90 signed char raydium_ode_element_player_angle_name (char *e, dReal angle):

Same as above, but using element's name.

45.91 int raydium_ode_element_ground_texture_get (int e):

Unsupported. Do not use for now.

45.92 int raydium_ode_element_ground_texture_get_name (char *e):

Unsupported. Do not use for now.

45.93 int raydium_ode_element_object_get (int e):

Since every element is owned by an object, this function will return
the owner's object id.

45.94 int raydium_ode_element_object_get_name (char *e):

Same as above, but using element's name.

45.95 int raydium_ode_object_sphere_add (char *name, int group, dReal mass, dReal radius, signed char type, int tag, char *mesh):

This function will add an new "sphere" element to an object (group).
You must provide:
- name: single name for this new element.
- group: owner object id.
- mass: density of this new element. Mass will depend on radius.
- radius: radius of the element sphere geometry. Raydium is able to
detect this value with RAYDIUM_ODE_AUTODETECT. Things like
RAYDIUM_ODE_AUTODETECT*2 are ok, meaning "twice the detected radius".
- type: RAYDIUM_ODE_STANDARD or RAYDIUM_ODE_STATIC (collide only,
no physics).
- tag: use this integer value as you want. The important thing is that
this value is sent to network, and will be available on every connected peer.
This tag must be greater or equal to 0. Suitable functions are available
to read back this value later on an element.
- mesh: 3D model used for rendering this element. Use an empty string to
disable rendering (and not NULL !), and avoid RAYDIUM_ODE_AUTODETECT
int this case.

45.96 int raydium_ode_object_box_add (char *name, int group, dReal mass, dReal tx, dReal ty, dReal tz, signed char type, int tag, char *mesh):

This function will add an new "box" element to an object (group).
Arguments are the same as raydium_ode_object_sphere_add (see above) but
tx, ty and tz, used for box sizes. As for spheres, you can
use RAYDIUM_ODE_AUTODETECT. Give this value only for tx, this will
automatically apply to ty and tz.
Again, Things like RAYDIUM_ODE_AUTODETECT*2 are ok, meaning
"twice the detected size".

45.97 int raydium_ode_object_capsule_add(char *name, int group, dReal mass, dReal radius, dReal length, signed char type, int tag, char *mesh):

This function will add an new "capsule" (capped cylinder) element to an
object (group).
You must provide:
- name: single name for this new element.
- group: owner object id.
- mass: density of this new element. Mass will depend on radius and
length.
- radius: radius of the internal cylinder and caps. Like boxes and
spheres, you can use RAYDIUM_ODE_AUTODETECT, for radius.
Things like RAYDIUM_ODE_AUTODETECT*0.5 are valid, too.
- length: full length from one end to the other (longest side).
- type: RAYDIUM_ODE_STANDARD or RAYDIUM_ODE_STATIC (collide only,
no physics).
- tag: use this integer value as you want. The important thing is that
this value is sent to network, and will be available on every connected peer.
This tag must be greater or equal to 0. Suitable functions are available
to read back this value later on an element.
- mesh: 3D model used for rendering this element. Use an empty string to
disable rendering (and not NULL !), and avoid RAYDIUM_ODE_AUTODETECT
int this case.
IMPORTANT: The capsules are ALWAYS CREATED IN Z AXIS. Your meshes should
take this into account.So, the capsule meshes should have the length in Z
axis.

45.98 signed char raydium_ode_element_ray_attach(int element, dReal length, dReal dirx, dReal diry, dReal dirz):

This function will attach a new ray to element. This may be used as a
sensor, "hitscan" line, intersection test, ...
Then you can get from this ray things like distance between the start
of the ray (element's center) and the first "touched" element. You will also
find wich element was touched, and where. The same applies for the last touched
element.
Do not try to retrieve informations until next frame.

You must provide ray's length (the ray won't detect "things" over that point),
and direction vector (relative to element).

You can set up to RAYDIUM_ODE_MAX_RAYS rays per element.

Warning, ray are linked to GLOBAL object, so they will detect EVERY element,
even if owned by the same object ! (only element is never reported).

If you want to filter wich elements are used to generate rays'informations,
you can use raydium_ode_RayCallback. This callback is following the
same prototype as raydium_ode_CollideCallback (see at the top of
this chapter). In this callback, you can use 3 different return values:
- RAYDIUM_ODE_RAY_CONTACT_IGNORE if you don't want this "contact" for
ray informations,
- RAYDIUM_ODE_RAY_CONTACT_REPORT if you want to report the contact: it will
update informations for raydium_ode_element_ray_get().
- RAYDIUM_ODE_RAY_CONTACT_CREATE will report the contact, and collide !

Return 0 if you don't want this "contact" for ray informations,
or 1 if you want normal behaviour. The first element in this callback is always
the one with the ray.

This functions returns the ray id for this element of -1 when it fails.

45.99 signed char raydium_ode_element_ray_attach_name(char *element, dReal length, dReal dirx, dReal diry, dReal dirz):

Same as above, but using element's name.

45.100 signed char raydium_ode_element_ray_delete(int element, int ray_id):

Delete ray ray_id from element. No more ray "reports" will be available
after this call.

45.101 signed char raydium_ode_element_ray_delete_name(char *element, int ray_id):

Same as above, but using element's name.

45.102 signed char raydium_ode_element_ray_get(int element, int ray_id, raydium_ode_Ray *result):

This function allows you to retrieve informations about ray.

Here you are a sample of raydium_ode_Ray structure with
interesting fields:
typedef struct raydium_ode_Ray
{
signed char state; // is this ray active ?
dReal   rel_dir[3];
dReal   rel_pos[3];
// farest contact
dReal   max_dist;
int     max_elem;   // touched element, -1 if no element was touched
dReal   max_pos[3];
// nearest contact
dReal   min_dist;
int     min_elem;   // touched element, -1 if no element was touched
dReal   min_pos[3];
} raydium_ode_Ray;


Obviously, this function won't allocate any memory, you must provide a
valid pointer to a raydium_ode_Ray struct.

45.103 signed char raydium_ode_element_ray_get_name(char *element, int ray_id, raydium_ode_Ray *result):

Same as above, but using element's name.

45.104 signed char raydium_ode_element_ray_set_length(int element, int ray_id, dReal length):

Change ray length to choose range detection length.

45.105 signed char raydium_ode_element_ray_set_length_name(char *element, int ray_id, dReal length):

Same as above, but using element's name.

45.106 signed char raydium_ode_element_ray_pos(int element, int ray_id, dReal *pos):

Moves ray_id ray of element to relative pos.

45.107 signed char raydium_ode_element_ray_pos_name(char *element, int ray_id, dReal *pos):

Same as above, but using element's name.

45.108 signed char raydium_ode_element_ray_pos_name_3f(char *element, int ray_id, dReal px, dReal py, dReal pz):

Same as above, but using 3 float values.

45.109 int raydium_ode_element_fix (char *name, int *elem, int nelems, signed char keepgeoms):

Experimental code.

The idea here is to create a bounding single element for a group of elements.
You must provide:
- name: the new bounding element's name.
- elems: an array of all elements to fix (id array).
- nelems: the number of elements in elems array.
- keepgeoms: set to 0.

You can only fix standard elements (no statics) and all elements must be
owned by the same object.

45.110 void raydium_ode_element_unfix (int e):

Experimental code. Unimplemented, yet.
Symmetric function, see raydium_ode_element_fix.

45.111 void raydium_ode_element_mass(int elem, dReal mass):

Change mass the the elem element. Obviously, you can't change the
mass of static element.

45.112 void raydium_ode_element_mass_name(char *elem, dReal mass):

Same as above, but using element's name.

45.113 void raydium_ode_element_mass_set(int elem,dReal mass):

Alias for raydium_ode_element_mass().

45.114 void raydium_ode_element_mass_set_name(char *elem, dReal mass):

Alias for raydium_ode_element_mass_name().

45.115 dReal raydium_ode_element_mass_get(int elem):

Return mass of the elem element.
Return only the mass of the element not the inertia matrix.

45.116 dReal raydium_ode_element_mass_get_name(char * elem):

Same as above using element name.

45.117 void raydium_ode_element_move (int elem, dReal * pos):

This function will move element elem to pos.
pos is a dReal array of 3 values (x,y,z).
Warning: arbitrary moves may lead to unwanted behaviours.

45.118 void raydium_ode_element_move_name (char *name, dReal * pos):

Same as above, but using element's name.

45.119 void raydium_ode_element_move_3f(int elem, dReal x,dReal y, dReal z):

Same as raydium_ode_element_move, but using 3 dReal values.

45.120 void raydium_ode_element_move_name_3f (char *name, dReal x, dReal y, dReal z):

Same as above, but using element's name.

45.121 void raydium_ode_element_rotate (int elem, dReal * rot):

This function will rotate element elem using rot.
rot is a dReal array of 3 values (rx,ry,rz), in radians.
Warning: arbitrary rotations may lead to unwanted behaviours.

45.122 void raydium_ode_element_rotate_3f (int elem, dReal rx, dReal ry, dReal rz):

Same as raydium_ode_element_rotate, but using 3 dReal values.

45.123 void raydium_ode_element_rotate_name (char *name, dReal * rot):

Same as raydium_ode_element_rotate, but using element's name.

45.124 void raydium_ode_element_rotateq (int elem, dReal * rot):

This function will rotate element elem using rot quaternion.
rot is a dReal array of 4 values.
Warning: arbitrary rotations may lead to unwanted behaviours.

45.125 void raydium_ode_element_rotateq_name (char *name, dReal * rot):

Same as raydium_ode_element_rotateq, but using element's name.

45.126 void raydium_ode_element_rotate_name_3f (char *name, dReal rx, dReal ry, dReal rz):

Same as raydium_ode_element_rotate_name, but using 3 dReal values.

45.127 void raydium_ode_object_rotate(int obj, dReal *rot):

This function will try to rotate object obj.
For now, rotation is done around the last element of the object.
rot is a dReal array of 3 values (rx,ry,rz), in radians.
Warning: arbitrary rotations may lead to unwanted behaviours.

45.128 void raydium_ode_object_rotate_name(char *obj, dReal *rot):

Same as above, but using object's name.

45.129 void raydium_ode_object_rotate_name_3f(char *obj, dReal rx, dReal ry, dReal rz):

Same as above, but using 3 dReal values.

45.130 void raydium_ode_object_move (int obj, dReal * pos):

This function will move object obj to pos.
Obviously, every element of object will be moved.
pos is a dReal array of 3 values (x,y,z).
Warning: arbitrary moves may lead to unwanted behaviours.

45.131 void raydium_ode_object_move_3f (int obj, dReal x, dReal y, dReal z):

Same as above, but using 3 dReal values.

45.132 void raydium_ode_object_move_name (char *name, dReal * pos):

Same as above, but using object's name.

45.133 void raydium_ode_object_move_name_3f (char *name, dReal x, dReal y, dReal z):

Same as above, but using 3 dReal values.

45.134 void raydium_ode_object_rotateq (int obj, dReal * rot):

This function will try to rotate object obj using rot quaternion.
For now, rotation is done around the last element of the object.
rot is a dReal array of 4 values.
Warning: arbitrary rotations may lead to unwanted behaviours.

45.135 void raydium_ode_object_rotateq_name (char *obj, dReal * rot):

Same as above, but using object's name.

45.136 void raydium_ode_element_rotate_direction (int elem, signed char Force0OrVel1?):

This function will rotate element elem from its force or velocity.
Sets Force0OrVel1? to 0 if you want to align element using its
force or 1 using its linear velocity.
Warning: arbitrary rotations may lead to unwanted behaviours.

45.137 void raydium_ode_element_rotate_direction_name (char *e, signed char Force0OrVel1?):

Same as above, but using element's name.

45.138 void raydium_ode_element_mesh_scale(int elem, float scale_factor):

Allows to rescale the mesh of element elem. This only applies to the mesh,
the physical properties are not modified (geometry size, mass, ...)
Shadows are rescaled, too.

45.139 void raydium_ode_element_mesh_scale_name(char *e, float scale_factor):

Same as above, but using element's name.

45.140 void raydium_ode_element_data_set (int e, void *data):

You may want to link some data to any element. If so, use this function
and provide a pointer to your data for element e.

45.141 void raydium_ode_element_data_set_name (char *e, void *data):

Same as above, but using element's name.

45.142 void *raydium_ode_element_data_get (int e):

This function will return a pointer to your linked data, if any (see above).

45.143 void *raydium_ode_element_data_get_name (char *e):

Same as above, but using element's name.

45.144 int raydium_ode_element_tag_get (int e):

When you create a new element, you must provide a "tag". This function
allows you to get back the tag's value, even on "distant" elements.

45.145 int raydium_ode_element_tag_get_name (char *e):

Same as above, but using element's name.

45.146 void raydium_ode_object_data_set (int o, void *data):

You may want to link some data to any object. If so, use this function
and provide a pointer to your data for element e.

45.147 void raydium_ode_object_data_set_name (char *o, void *data):

Same as above, but using object's name.

45.148 void *raydium_ode_object_data_get (int e):

This function will return a pointer to your linked data, if any (see above).

45.149 void *raydium_ode_object_data_get_name (char *e):

Same as above, but using object's name.

45.150 void raydium_ode_joint_suspension (int j, dReal erp, dReal cfm):

ERP means "Error Reduction Parameter", and its value is between 0 and 1 and
CFM means "Constraint Force Mixing".
Changing ERP and CFM values will change joint energy absorption and restitution.

For more informations, see ODE documentation, chapters 3.7 and 3.8.

Notice: Consider this function as advanced.

Warning: On a universal joint, this function will change ERP and CFM for
limits, and not for the joint itself ! (experimental feature)

45.151 void raydium_ode_joint_suspension_name (char *j, dReal erp, dReal cfm):

Same as above, but using element's name.

45.152 int raydium_ode_joint_attach_hinge2 (char *name, int elem1, int elem2, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z):

Will create a new joint between two elements (elem1 and elem2).
Hinge2? is a very specialized joint, perfect for car wheel's for example.

hinge2

"Axis 1 is specified relative to body 1 (this would be the steering
axis if body 1 is the chassis). Axis 2 is specified relative to body 2
(this would be the wheel axis if body 2 is the wheel)."

You must also provide joint's name.

Raydium provides RAYDIUM_ODE_JOINT_SUSP_DEFAULT_AXES define, useful for
most chassis-wheel joints, and RAYDIUM_ODE_JOINT_AXE_X, Y and Z for
other cases.

You cannot attach a static element.

45.153 int raydium_ode_joint_attach_hinge2_name (char *name, char *elem1, char *elem2, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z):

Same as above, but using elements's names.

45.154 int raydium_ode_joint_attach_universal (char *name, int elem1, int elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z):

Will create a new joint between two elements (elem1 and elem2).

universal

"Given axis 1 on body 1, and axis 2 on body 2 that is perpendicular to
axis 1, it keeps them perpendicular. In other words, rotation of the two
bodies about the direction perpendicular to the two axes will be equal."

"Axis 1 and axis 2 should be perpendicular to each other."

You must also provide joint's name, and joint position (posx, posy,
posz) in world coordinates.

Raydium provides RAYDIUM_ODE_JOINT_AXE_X, RAYDIUM_ODE_JOINT_AXE_Y
and RAYDIUM_ODE_JOINT_AXE_Z defines, that may help.

You cannot attach a static element.

45.155 int raydium_ode_joint_attach_universal_name (char *name, char *elem1, char *elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z):

Same as above, but using elements's names.

45.156 int raydium_ode_joint_attach_hinge (char *name, int elem1, int elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z):

Will create a new joint between two elements (elem1 and elem2).

hinge

You must provide joint's name, and joint position (posx, posy,
posz) in world coordinates.

Raydium provides RAYDIUM_ODE_JOINT_AXE_X, RAYDIUM_ODE_JOINT_AXE_Y
and RAYDIUM_ODE_JOINT_AXE_Z defines, that may help for setting axis.

You cannot attach a static element.

45.157 int raydium_ode_joint_attach_hinge_name (char *name, char *elem1, char *elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z):

Same as above, but using elements's names.

45.158 int raydium_ode_joint_attach_fixed (char *name, int elem1, int elem2):

Will create a new joint between two elements (elem1 and elem2).

Fixed joint is more a hack than a real joint. Use only when it's absolutely
necessary, and have a look to raydium_ode_element_fix.

You must provide joint's name
You cannot attach a static element.

45.159 int raydium_ode_joint_attach_fixed_name (char *name, char *elem1, char *elem2):

Same as above, but using elements's names.

45.160 void raydium_ode_joint_hinge_limits (int j, dReal lo, dReal hi):

Sets low (lo) and high (hi) limits for hinge joint j.

45.161 void raydium_ode_joint_hinge_limits_name (char *j, dReal lo, dReal hi):

Same as above, but using joint's name.

45.162 void raydium_ode_joint_universal_limits (int j, dReal lo1, dReal hi1, dReal lo2, dReal hi2):

Sets low and hight limits for axe 1 (lo1, hi1) and axe 2 (lo2,
hi2) for universal joint j. See raydium_ode_joint_attach_universal
for more informations about universal joint axes.

45.163 void raydium_ode_joint_universal_limits_name (char *j, dReal lo1, dReal hi1, dReal lo2, dReal hi2):

Same as above, but using joint's name.

45.164 void raydium_ode_joint_hinge2_block (int j, signed char block):

Sometime, you may need to block rotation for first axe of hinge2 joints, for
example with rear wheels of a car. If so, set block to 1 (true).
Setting block back to 0 (false) will restore standard rotation behaviour.

45.165 void raydium_ode_joint_hinge2_block_name (char *name, signed char block):

Same as above, but using joint's name.

45.166 void raydium_ode_joint_hinge2_limits (int j, dReal lo, dReal hi):

Sets low (lo) and high (hi) limits for hinge2 (aka suspet) joint j.

45.167 void raydium_ode_joint_hinge2_limits_name (char *j, dReal lo, dReal hi):

Same as above, but using joint's name.

45.168 void raydium_ode_joint_delete_callback (int j, void (*f) (int)):

Since joints may break (see raydium_ode_joint_break_force), it may be
useful to get a callback on joint deletion.
This callback must this prototype:
void joint_delete(int jid)
jid is the deleted joint id. You can't cancel joint deletion (yet).

45.169 void raydium_ode_joint_delete_callback_name (char *name, void (*f) (int)):

Same as above, but using joint's name.

45.170 void raydium_ode_joint_break_force (int j, dReal maxforce):

Setting a non-zero maxforce on a joint will transform this joint into
a "breakable joint". There's no unit for maxforce, you'll probably have
to find the suitable value empirically.

45.171 void raydium_ode_joint_break_force_name (char *name, dReal maxforce):

Same as above, but using joint's name.

45.172 void raydium_ode_joint_elements_get (int j, int *e1, int *e2):

Will return elements (e1 and e2) linked to joint j.

45.173 void raydium_ode_joint_elements_get_name (char *j, int *e1, int *e2):

Same as above, but using joint's name.

45.174 void raydium_ode_motor_update_joints_data_internal (int j):

Internal function.

45.175 void raydium_ode_motor_speed (int j, dReal force):

Sets motor j speed parameter. This is only suitable for "engine"
and "rocket" type motors. There's no special unit for force.

45.176 void raydium_ode_motor_speed_name (char *name, dReal force):

Same as above, but using motor's name.

45.177 void raydium_ode_motor_power_max (int j, dReal power):

Sets motor j max power parameter. This is only suitable for "engine"
and "angular" motors. There's no special unit for power.

45.178 void raydium_ode_motor_power_max_name (char *name, dReal power):

Same as above, but using motor's name.

45.179 void raydium_ode_motor_angle (int j, dReal angle):

Sets motor j angle parameter. This is only suitable for "angular" motors.
angle has the units of radians.

45.180 void raydium_ode_motor_angle_name (char *motor, dReal angle):

Same as above, but using motor's name.

45.181 void raydium_ode_motor_gears_set (int m, dReal * gears, int n_gears):

Sets a gearbox for motor m (only suitable for "engine" motors).
gears is an array of dReal values, with all gears factors).
n_gears is the array length (total number of gears for this gearbox).
example:
// rear,1,2,3,4,5
dReal gears[]={-0.4,0.4,0.6,0.8,0.9,1.0};
...
raydium_ode_motor_gears_set(main_engine,gears,6);

If you want to cancel a gearbox, set a gearbox with only one gear with 1.0
factor value.

Raydium gearboxes implementation is very naive, with 100% output.
For example, a 0.5 gear factor will divide maximum speed by two, but will
provide twice the normal torque.

45.182 void raydium_ode_motor_gears_set_name (char *m, dReal * gears, int n_gears):

Same as above, but using motor's name.

45.183 void raydium_ode_motor_gear_change (int m, int gear):

Switch motor m to gear.

45.184 void raydium_ode_motor_gear_change_name (char *m, int gear):

Same as above, but using motor's name.

45.185 dReal raydium_ode_motor_gear_ratio(int m):

Returns the current gear ratio for motor m.

45.186 dReal raydium_ode_motor_gear_ratio_name(char *m):

Same as above, but using motor's name.

45.187 dReal *raydium_ode_element_pos_get (int j):

This function will return element j's current position, as an array of
3 dReal values.
example:
dReal *pos;
dReal pos_copy;
...
pos=raydium_ode_element_pos_get(my_element);
raydium_log("%f %f %f",pos[0],pos[1],pos[2]);
memcpy(pos_copy,pos,sizeof(dReal)*3);
...

Returned data is available only for the current frame.

45.188 dReal *raydium_ode_element_pos_get_name (char *name):

Same as above, but using element's name.

45.189 signed char raydium_ode_element_rotq_get (int j, dReal * res):

This function will return element j's current rotation, as an array of
4 dReal values (quaternion), thru res.
No memory allocation will be done.

45.190 signed char raydium_ode_element_rotq_get_name (char *name, dReal * res):

Same as above, but using element's name.

45.191 signed char raydium_ode_element_rot_get (int e, dReal * rx, dReal * ry, dReal * rz):

This code is experimental. It should returns element e's current rotation
using 3 dReal angles, in radians. Do not apply back values to the
element since there're not "ODE formated".

45.192 signed char raydium_ode_element_rot_get_name (char *e, dReal * rx, dReal * ry, dReal * rz):

Same as above, but using element's name.

45.193 void raydium_ode_element_sound_update (int e, int source):

This function is a small bridge between RayODE and sound API, updating sound
source using element e's position.

45.194 void raydium_ode_element_sound_update_name (char *e, int source):

Same as above, but using element's name.

45.195 void raydium_ode_element_RelPointPos (int e, dReal px, dReal py, dReal pz, dReal * res):

Give a point (px, py and pz) on element e to this function,
and il will return this point in global coordinates (res).
Returned data is available only for the current frame.

45.196 void raydium_ode_element_RelPointPos_name (char *e, dReal px, dReal py, dReal pz, dReal * res):

Same as above, but using element's name.

45.197 int raydium_ode_motor_create (char *name, int obj, signed char type):

This function will create a new motor, using name (single), for
object obj, with type. As said before, available types are
RAYDIUM_ODE_MOTOR_ENGINE, RAYDIUM_ODE_MOTOR_ANGULAR and
RAYDIUM_ODE_MOTOR_ROCKET. See the first part of this chapter for more
informations about motor types.

45.198 void raydium_ode_motor_attach (int motor, int joint, int joint_axe):

This function will link motor to joint, on axe joint_axe (first axe
is axe 0 and so on ...). This is only suitable for engine and angular motors.

45.199 void raydium_ode_motor_attach_name (char *motor, char *joint, int joint_axe):

Same as above, but using motor's name and joint's name.

45.200 dReal raydium_ode_motor_speed_get (int m, int gears):

Will return current motor speed.
For engine style motors, if gears is sets to 1 (true), returned speed
will be relative to current motor's gear. Useless for other types.

45.201 dReal raydium_ode_motor_speed_get_name (char *name, int gears):

same as above, but using motor's name.

45.202 dReal raydium_ode_motor_angle_get(int m, int axe):

Will return current motor angle on axe axe. Avaible only for angular motor.

45.203 dReal raydium_ode_motor_angle_get_name(char *name, int axe):

same as above, but using motor's name.

45.204 void raydium_ode_motor_rocket_set (int m, int element, dReal x, dReal y, dReal z):

This function will configure rocket motor m on element at position
(x,y,z). Rocket motors are unusable until this function is called.

45.205 void raydium_ode_motor_rocket_set_name (char *motor, char *element, dReal x, dReal y, dReal z):

same as above, but using motor's name.

45.206 void raydium_ode_motor_rocket_orientation (int m, dReal rx, dReal ry, dReal rz):

This function will rotate rocket m using rx,ry and rz angles
in degrees. Base orientation is z up.

45.207 void raydium_ode_motor_rocket_orientation_name (char *name, dReal rx, dReal ry, dReal rz):

same as above, but using motor's name.

45.208 void raydium_ode_motor_rocket_playermovement (int m, signed char isplayermovement):

Will configure rocket m for player movements. This type of rocket will be
automatically disabled when linked element is not touched by
anything (ground in most cases).

45.209 void raydium_ode_motor_rocket_playermovement_name (char *m, signed char isplayermovement):

same as above, but using motor's name.

45.210 signed char raydium_ode_motor_delete (int e):

Will obviously delete motor e.

45.211 signed char raydium_ode_motor_delete_name (char *name):

same as above, but using motor's name.

45.212 signed char raydium_ode_joint_delete (int joint):

Will obviously delete joint.

45.213 signed char raydium_ode_joint_delete_name (char *name):

same as above, but using joint's name.

45.214 signed char raydium_ode_element_delete (int e, signed char deletejoints):

Will obviously delete element e. Deletion may me queued for some reason,
for a very short time (current collide loop). For now, you must set
deletejoints to 1 (true), since joints without 2 linked elements
are invalid.
Linked rocket engines will be deleted, too.

45.215 signed char raydium_ode_element_delete_name (char *name, signed char deletejoints):

Same as above, but using element's name.

45.216 signed char raydium_ode_object_delete (int obj):

Will obviously delete object obj. All elements, joints and motors will
be deleted with object.

45.217 signed char raydium_ode_object_delete_name (char *name):

Same as above, but using object's name.

45.218 signed char raydium_ode_explosion_delete (int e):

Will delete RAYDIUM_ODE_NETWORK_EXPLOSION_EXPL type explosion e.

45.219 signed char raydium_ode_element_moveto (int element, int object, signed char deletejoints):

This function will move element from his owner object to another object.
This "migration" will not be completed until element is not touching
anymore his previous owner.
For now, you must set deletejoints to 1 (true), deleting linked joints.

45.220 signed char raydium_ode_element_moveto_name (char *element, char *object, signed char deletejoints):

Same as above, but using element's name and object's name.

45.221 void raydium_ode_joint_break (int j):

Internal joint testing function.

45.222 signed char raydium_ode_launcher (int element, int from_element, dReal * rot, dReal force):

This function will launch an element from from_element.
You must provide rot, an array of 3 dReal angles in degreees, relative
to from_element current orientation.
You must also provide a force, with no particular unit.

45.223 signed char raydium_ode_launcher_name (char *element, char *from_element, dReal * rot, dReal force):

Same as above, using element and from_element names.

45.224 signed char raydium_ode_launcher_name_3f (char *element, char *from_element, dReal rx, dReal ry, dReal rz, dReal force):

Same as above, but using 3 dReal values for rotation.

45.225 signed char raydium_ode_launcher_simple (int element, int from_element, dReal * lrot, dReal force):

This function will act the same as previous ones, adding a few things:
- element will be aligned with from_element (position and rotation).
- element will be "migrated" to GLOBAL object during launch.

45.226 signed char raydium_ode_launcher_simple_name (char *element, char *from_element, dReal * rot, dReal force):

Same as above, using element and from_element names.

45.227 signed char raydium_ode_launcher_simple_name_3f (char *element, char *from_element, dReal rx, dReal ry, dReal rz, dReal force):

Same as above, but using 3 dReal values for rotation.

45.228 void raydium_ode_explosion_blow (dReal radius, dReal max_force, dReal * pos):

This function will create an instantaneous explosion, generating a degressive
blowing effect.
You must provide a radius (normal world units), a maximum force
(max_force), and a position (pos, 3 x dReal array).

45.229 void raydium_ode_explosion_blow_3f (dReal radius, dReal max_force, dReal px, dReal py, dReal pz):

Same as above, but using 3 dReal values for position.

45.230 void raydium_ode_explosion_blow_rand(dReal radius, dReal max_force, dReal rand_factor, dReal *pos):

Same as raydium_ode_explosion_blow_rand(), but introducing a random factor
on resulting torque for blowed objects, for a more realistic effect.

45.231 void raydium_ode_explosion_blow_rand_3f(dReal radius, dReal max_force, dReal rand_factor, dReal px, dReal py, dReal pz):

Same as above, but using 3 dReal values for position.

45.232 int raydium_ode_explosion_create (char *name, dReal final_radius, dReal propag, dReal * pos):

This function will create an spherical growing explosion. Any element in the
explosion will be ejected.
As said before: "Use this for very consequent explosions only !".
You must provide final_radius, propag (growing size) and a
position (pos, 3 x dReal array).
When an explosion reach its final radius, it will be deleted.

45.233 void raydium_ode_element_camera_inboard (int e, dReal px, dReal py, dReal pz, dReal lookx, dReal looky, dReal lookz):

RayODE to camera API bridge.
Sets the camera on element e at relative position (px,py,pz),
and looking at (lookx,looky,lookz) relative point.
Works with normal and static elements.

45.234 void raydium_ode_element_camera_inboard_name (char *name, dReal px, dReal py, dReal pz, dReal lookx, dReal looky, dReal lookz):

Same as above, but using element's name.

45.235 void raydium_ode_draw_all_post(void):

This function is called automatically when you render the frame with RayODE
using raydium_ode_draw_all(RAYDIUM_ODE_DRAW_NORMAL).
Currently, it will generate and apply HDR map, render particles and lensflares.

45.236 void raydium_ode_draw_all(signed char names):

This function will draw all RayODE scene. You must call this function
by yourself.
Set names to RAYDIUM_ODE_DRAW_NORMAL for normal rendering.
Other names values will:
- draw only elements, joints and motors names and elements bounding boxes
with RAYDIUM_ODE_DRAW_DEBUG
- draw only objets AABB (Axis-Aligned Bounding Box) with RAYDIUM_ODE_DRAW_AABB
- draw only element rays (if any) with RAYDIUM_ODE_DRAW_RAY
- do the same as regular rendering, but will not apply post-rendering to the
frame with the value RAYDIUM_ODE_DRAW_NORMAL_NO_POST (see previous function)
... so you may need multiple call to this function each frame.

45.237 void raydium_ode_near_callback (void *data, dGeomID o1, dGeomID o2):

Internal callback.

45.238 void raydium_ode_callback (void):

Internal frame callback.

45.239 void raydium_ode_time_change (GLfloat perc):

This function will change RayODE timecall frequency, allowing slow motion
effects, for example, where perc is the percentage of the normal time base.
Since this function obviously do not change physics accuracy, be careful
with perc > 100, wich will generate a big load for the CPU.
This function also change particles and mesh animations time.

45.240 void raydium_ode_element_particle (int elem, char *filename):

This function will "fix" a particle generator on element elem. You must
provide particle generator's filename.

45.241 void raydium_ode_element_particle_name (char *elem, char *filename):

Same as above, using element's name.

45.242 void raydium_ode_element_particle_offset (int elem, char *filename, dReal * offset):

Same as raydium_ode_element_particle, but with an offset, relative
to element. offset is an array of 3 dReal values.

45.243 void raydium_ode_element_particle_offset_name (char *elem, char *filename, dReal * offset):

Same as above, using element's name.

45.244 void raydium_ode_element_particle_offset_name_3f (char *elem, char *filename, dReal ox, dReal oy, dReal oz):

Same as above, but using 3 dReal values for offset.

45.245 void raydium_ode_element_particle_point (int elem, char *filename):

Same as raydium_ode_element_particle, but generator will not be linked
with element, only positioned at current element's position.

45.246 void raydium_ode_element_particle_point_name (char *elem, char *filename):

Same as above, using element's name.

45.247 void raydium_ode_internal_particle_genetator_deleted_callback(int gen):

Internal callback.

45.248 int raydium_ode_element_lensflare_offset(int elem, char *flare_name, char *filename, dReal *offset):

This function will attach a lensflare to element elem at desired offset.
Even if this function will load the lensflare by itslef, you should have a look
to raydium_lensflare_create() for more informations about lensflares.

45.249 int raydium_ode_element_lensflare_offset_name(char *elem, char *flare_name, char *filename, dReal *offset):

Same as above, using element's name.

45.250 int raydium_ode_element_lensflare_offset_name_3f(char *elem, char *flare_name, char *filename, dReal offx, dReal offy, dReal offz):

Same as above, but using 3 dReal values for offset.

45.251 void raydium_camera_smooth_path_to_element (char *path, int element, GLfloat path_step, GLfloat smooth_step):

This function is a clone of raydium_camera_smooth_path_to_pos dedicated to
RayODE, looking at element from path.
You may look at suitable chapter for more informations about path,
path_step and smooth_step.

45.252 void raydium_camera_smooth_path_to_element_name (char *path, char *element, GLfloat path_step, GLfloat smooth_step):

Same as above, using element's name.

45.253 void raydium_camera_smooth_element_to_path_name (char *element, char *path, GLfloat path_step, GLfloat smooth_step):

This function is a clone of raydium_camera_smooth_pos_to_path dedicated to
RayODE, looking at path, from element.
Here, you must provide element's name.
You may look at suitable chapter for more informations about path,
path_step and smooth_step.

45.254 void raydium_camera_smooth_element_to_path_offset (int element, GLfloat offset_x, GLfloat offset_y, GLfloat offset_z, char *path, GLfloat path_step, GLfloat smooth_step):

This function is a clone of raydium_camera_smooth_pos_to_path dedicated to
RayODE and providing an offset (for element), looking at path, from
element.
You may look at suitable chapter for more informations about path,
path_step and smooth_step.

45.255 void raydium_camera_smooth_element_to_path_offset_name (char *element, GLfloat offset_x, GLfloat offset_y, GLfloat offset_z, char *path, GLfloat path_step, GLfloat smooth_step):

Same as above, using element's name.

45.256 int raydium_ode_capture_3d(char *filename):

This function is provided "for fun" only. The main idea is to dump all scene
to a .tri file (filename). A .sprt file will also be created, wich is a
special file format with all particles found during the dump. You can reload
.sprt files with raydium_particle_state_restore.
Note from source code:
// This function is provided "for fun" only. Not all effects are dumped:
// Missing : shadows, forced colors, before/after callbacks,
// fixed elements, ...
// Some code is pasted from file.c (and this is BAD ! :) 
 


45.257 int raydium_ode_orphans_check(void):

Search orphans in all objects. An orphan is a geometry that exists into ODE
but is not managed by RayODE.
This function will print object with orphans and return total orphan count.

45.258 int raydium_ode_mouse_pick(dReal dist,dReal pos[3],dReal *depth):

Mouse picking function. Return raydium_element pointed by mouse on the screen.
dist is maximal detection distance (range).
pos Global 3D position of pointed point. depth distance from point of view.
Use raydium_ode_PickCallback (as signed char f(int,int,dContact*)) to filter
contacts points. Uses as other collide callback but is specific to Pick function.

45.259 void raydium_ode_set_physics_freq (GLfloat freq):

You can use raydium_ode_set_physics_freq to change the frequence of physical engine call. 400Hz is default.
This will change physical behaviour.

45.260 GLfloat raydium_ode_get_physics_freq(void):

Return the actual value of physical engine calling frequency.

45.261 void raydium_ode_set_timestep(GLfloat tstep):

Set physical engine time step (which is 0.006f by default).
This value is related to raydium_ode_physics_freq.

45.262 GLfloat raydium_ode_get_timestep(void):

Return physical engine iteration timestep.

45.263 void raydium_ode_capture_internal_create(int type, int id, dReal *sizes, char *mesh):

Internal. Add entity creation to the replay.

45.264 void raydium_ode_capture_internal_create_all(void):

Internal. Add all entities to the replay.

45.265 void raydium_ode_capture_internal_delete(int id):

Internal. Add entity deletion to the replay.

45.266 void raydium_ode_capture_record(char *rrp_filename):

Records to a RRP file all ODE events to create a replay.
Recording is done at RAYDIUM_ODE_RECORD_RATE_DEFAULT rate.
You can play another RRP file while recording.

WARNING: experimental feature ! API may change.

45.267 void raydium_ode_capture_record_rate(char *rrp_filename, int rate_hz):

Same as above, but allowing you to select the recording rate.
Valid range is [1,400] Hz.

45.268 void raydium_ode_capture_record_stop(void):

Stops the recording. Not needed to get a valid record.

45.269 void raydium_ode_capture_play_internal_index_build(void):

Internal. Builds index, needed for RRP playing.

45.270 void raydium_ode_record_play_ghost(signed char ghost):

Set ghost to true (1) if you want to avoid all collisions between "your"
elements and replay ones. Default is false (0).

45.271 void raydium_ode_capture_play(char *rrp_filename, signed char change_ground):

This function will play rrp_filename file, and default speed.
If change_ground is true (1), this function will set/change the
current RayODE ground (like raydium_ode_ground_set_name()) with the one
used in the replay file.
You can start recording during a replay, if you want.

45.272 void raydium_ode_capture_stop(void):

Stops the replay.

45.273 signed char raydium_ode_capture_seek(double time):

This function will seek into the replay to jump at time seconds.
The CPU cost of this function is proportional to the size of the jump
from the current position to time.
Returns false (0) on failure (ex:time out of range)

45.274 signed char raydium_ode_capture_seek_rel(double time):

Same as above, but using a relative time.
Example: raydium_ode_capture_seek_rel(-2.5) will rewind the replay of
two and half a second from the current time.

45.275 void raydium_ode_capture_speed(GLfloat factor):

Change the speed of the capture replay. The default factor is 1, and a value
of 2 will play the record twice the normal speed, for example.
You can use negative values to play the record backwards.
The value 0 will pause the replay.

45.276 void raydium_ode_capture_internal_read_event(signed char sense):

Internal. Reads "special" events at the current file position (sense=1 means
forward and sens=-1 means backward)

45.277 void raydium_ode_capture_internal_read_move(signed char pass):

Internal. Reads a "move" event at the current file position.

45.278 void raydium_ode_capture_play_callback(void):

Internal frame callback for capture playing.

45.279 void raydium_ode_autodisable_set(signed char autod):

RayODE can automatically disable resting elements.
This is useful for physical solver. It don't have to reserve space in
the solver matrix and compute solution for this element.

This can greatly speed up the program, but may cause some strange
behaviors, like elements resting in mid-air.

This feature is disabled by default.

45.280 signed char raydium_ode_autodisable_get(void):

Is RayODE autodisable feature is enabled ? This function will
return 1 (true) if yes, 0 (false) otherwise.

45.281 signed char raydium_ode_element_disable_get(int elem):

Return whatever or not an element is disabled.
In this case it is not treated by the solver.
Will return 1 if element is disabled, 0 if not.

45.282 signed char raydium_ode_element_disable_get_name (char *e):

Same as above using element name.

45.283 void raydium_ode_element_disable_set(int elem, signed char disable_state):

Allow user to disable or reactivate an element manually.
if disable_state is 1 element will be desactived,
0 will re-activate the element.

45.284 void raydium_ode_element_disable_set_name (char *e, signed char disable_state):

Same as above with element name.

45.285 void raydium_ode_contact_feedback_save(int custom_id):

During your raydium_ode_CollideCallback, you may want to save forces
and torques that will be generated by the contact you're creating.

This function allows you to do this, simply by providing a custom_id, a
unique identifier, in the range [0,RAYDIUM_ODE_CONTACTS_FEEDBACK_MAX].
Most of the time, this value is the "current" element id, like the wheel id
during a road/wheel contact, for instance. It's then very easy to get the saved
forces and torques during the next physics iteration using the same id (the
wheel id is the same from one iteration to another).

45.286 dJointFeedback *raydium_ode_contact_feedback_get(int custom_id):

This function will return a pointer to a dJointFeedback structure, where
you'll find the forces and torques saved with
raydium_ode_contact_feedback_save() during the previous physics iteration.
See above for more informations about custom_id.
typedef struct dJointFeedback {
dVector3 f1; // force that joint applies to body 1
dVector3 t1; // torque that joint applies to body 1
dVector3 f2; // force that joint applies to body 2
dVector3 t2; // torque that joint applies to body 2
} dJointFeedback;



46 RayODE network layer:

46.1 Introduction:

Physics engines are extremely powerful tools, but it turns to nightmares when
the application must be networked. RayODE API provides its own network layer,
using Raydium lower level network API. And the great thing is that you've
almost nothing to do !
Just choose the best "send" function and let Raydium do the rest.

RayODE Net will use udp streams, netcall (RPC), smart timeouts, predictions,
dead reckoning, and many others voodoo things. Just trust.

A few things about internals:
- NID: Network ID. Every networked element have a NID.
- Distant elements are localy created using static elements, owned by
an object called "DISTANT".
- raydium_ode_network_maxfreq defines the paquet sending frequency. By
default, this value is RAYDIUM_ODE_NETWORK_MAXFREQ, but you can use
--ode-rate command line switch.
- No rotation prediction is done.
- See config.h if you want to disable prediction (ODE_PREDICTION) or
to debug RayODE Net (DEBUG_ODENET, very verbose !).
- Explosions are also automatically managed by RayODE Net.
- Do NOT use Raydium lower level network API when using RayODE Net. Use
netcalls, propags and so on.

Nothing is said here about how to create a RayODE Net server. There's only
a few more things to do if you already have a standard server, but since it's
unsupported for now, you must have a look to existing RayODE Net servers.

46.2 int raydium_ode_network_MaxElementsPerPacket (void):

This function will return how many elements may be sent with
current packet size (see common.h).

46.3 int raydium_network_nid_element_find (int nid):

Internal. Find wich element have nid.

46.4 void raydium_ode_network_newdel_event (int type, char *buff):

Internal. NEWDEL netcall event.
NEWDEL is fired when a new element is created or deleted somewhere in the
network.

46.5 void raydium_ode_network_nidwho_event (int type, char *buff):

Internal. NIDWHO netcall event.
NIDWHO is sent when someone received some "update" informations about a
nid, but didn't received previous NEWDEL informations for this nid.
The nid owner will send a reply.

Most reasons for this are:
- We are a new client and we dont known anything about the whole scene.
- The NEWDEL packet was lost ("TCP style" packets may be lost too ...)

NIDWHO answer will be used by every peer to refresh its own copy of the
element informations (geometry type, mesh, size and tag).

46.6 void raydium_ode_network_explosion_event (int type, char *buff):

Internal explosion netcall event.(RAYDIUM_ODE_NETWORK_EXPLOSION_EXPL and
RAYDIUM_ODE_NETWORK_EXPLOSION_BLOW).

46.7 void raydium_ode_network_init (void):

Internal. Will initialize all RayODE Net layer and register netcalls.

46.8 signed char raydium_ode_network_TimeToSend (void):

Almost internal. Will return 1 (true) if it's time to send a new packet, using
raydium_ode_network_maxfreq value.

46.9 void raydium_ode_network_element_send (short nelems, int *e):

Will send all elements of e array to network. You must provide array lenght
using nelems.
No "time to send ?" test is done, you'll probably have to do it yourself.

46.10 void raydium_ode_network_element_send_all (void):

Will try to send all elements to network. Warning, packet size may be to
small to send all elements !.. See next functions, more suitable.

46.11 void raydium_ode_network_element_send_random (int nelems):

Will send randomly chosen elements to network. You must provide how many
elements you want with nelems, but RAYDIUM_ODE_NETWORK_OPTIMAL is
available.

46.12 void raydium_ode_network_element_send_iterative (int nelems):

Will send elements to network, iteratively chose. You must provide how many
elements you want with nelems, but RAYDIUM_ODE_NETWORK_OPTIMAL is
available.

46.13 void raydium_ode_network_nidwho (int nid):

Internal. Will ask for informations for nid (see above).
NID sending frequency is now limited, since a lot of overhead was generated
when new clients were joining a "big" network.

46.14 void raydium_ode_network_apply (raydium_ode_network_Event * ev):

Internal. This callback is fired when new data is received. A lot of things
are done here (timeouts, dead reckoning, ...)

46.15 void raydium_ode_network_read (void):

Internal. Reads new packets, if any.

46.16 void raydium_ode_network_element_new (int e):

Internal. Send a new element to network.

46.17 void raydium_ode_network_element_delete (int e):

Internal. Send "delete event" to network, since we're deleting one of "our" elements.

46.18 void raydium_ode_network_explosion_send (raydium_ode_network_Explosion * exp):

Internal. Send a new explosion event.

46.19 signed char raydium_ode_network_element_isdistant (int elem):

Will return true (1) if element elem is "distant", or false (0) if it's
one of "our" elements.

46.20 signed char raydium_ode_network_element_isdistant_name (char *elem):

Same as above, but using element's name.

46.21 signed char raydium_ode_network_element_distantowner(int elem):

Returns UID (peer "user" ID) for the distant element owner. See network.c
documentation for more informations about UID.

46.22 signed char raydium_ode_network_element_distantowner_name(char *elem):

Same as above, but using element's name.

46.23 void raydium_ode_network_element_trajectory_correct (int elem):

Internal. Applies dead reckoning values to element.

46.24 void raydium_ode_network_elment_next_local(void):

Call this function when you don't want that the next created element is sent
to network ("local only" element).


47 RegAPI:

47.1 Introduction:

RegAPI is an internal system that exports some Raydium's API functions to
scripting engine, creating bindings.
See RayPHP chapter for more informations anout scripting.

47.2 void raydium_register_api(void):

Internal. Will register Raydium API.


48 HTTP Web server and tools:

48.1 Introduction:

Raydium applications can embed a small HTTP server. This server is used to be
an entry point to application data. Only simple requests (GET) are supported,
with a limited set of file types. Right now, this server is able to send
static and dynamic data, and dynamic scripted page support is to come, using
Raydium's PHP parser.

The server is a modified version of IBM's nweb server, from
Nigel Griffiths (nag AT uk DOT ibm DOT com).

Raydium also provide a very small HTTP client, useful to get data (tracks,
maps, sprays, ...) from the game server.

To set up a web server in your application, you'll need to do a few things.
First, make sure that HTTP support is enabled (see raydium_web_init()) and
that your HTTP server is started (raydium_web_start()).

The HTTP server will use TCP port RAYDIUM_NETWORK_PORT (29104), therefore
a typical URL to reach the server is something like http://127.0.0.1:29104
where you'll find your index page. If the HTTP server (and your application)
is started (see above), you can point your browser to this URL right now.

The default index page can be changed thru raydium_web_body_default
variable :
char *index_text="\
<br/><center>This is a <b>test</b> server. You can know more about Raydium by\
<a href=\"http://maniadrive.raydium.org/\">by clicking here</a></center>";

...

int main(int argc, char **argv)
{
...
raydium_web_start("test server");
raydium_web_body_default=index_text;
}


You can also change default header and footer the same way, using
raydium_web_header and raydium_web_footer variables.

Then you may need to register "file" extensions (static data or dynamic
handler) using raydium_web_extension_add() function.

Please note that Raydium's not Apache ! You're supposed to serve light
pages, with almost no processing. The server is not even threaded, so you
may hit hardly framerate not following these recommendations, or if too
many HTTP requests are sent concurrently to the server.

48.2 void raydium_web_answer(char *message, int fd):

Internal use. Default HTTP handler (HTML message).

48.3 void raydium_web_request(int fd):

Internal use. Will decode HTTP client request.

48.4 void raydium_web_start(char *title):

Will start the Raydium embedded HTTP server. The TCP port 29104 must be free.
The title will be used in HTTP headers and in the default HTML header.

48.5 void raydium_web_callback(void):

Internal use. Will accept any pending connection.

48.6 void raydium_web_init(void):

You should not have to call this function by yourself, unless your application
is a game server. (see raydium_network_only_init() for more informations
about network only applications)

48.7 void raydium_web_extension_add(char *ext, char *mime, void *handler):

This function will register a new file extension to the web server.

Note that Raydium HTTP server have no idea of URL parameters and will consider
that everything after the root slash in the URL is the requested "filename".

So the ext could be of any size and will only try to match the end
of URLs ("tga" or ".tga" for instance).
As an example, an URL like http://myhost/toto.php?f=a.tga will match
the extension ".tga" (the filename will be toto.php?f=a.tga, here).
But this one will not: http://myhost/toto.php?f=a.tga&r=12

This behavior may change soon, so please contact us before doing anything
complex with extension.


You can also set a handler for your extension. A sample handler may
look like this:
signed char http_req(char *req, char *response, int max_size)
{
if(!strcmp("a.dyn",req))
{
sprintf(response,"This a sample for <b>a.dyn</b>");
return 1;
}
if(!strcmp("b.dyn",req))
{
sprintf(response,"This a sample for <b>b.dyn</b>");
return 1;
}
 
return 0;
}


In this handler, req is the requested "filename" (see above about
extensions) and response is a pre-allocated buffer (of max_size bytes,
usually 8 kB) where you must write your response data/text. The hanlder
must return 1 if everything is correct, and 0 to deny the request.

If you set handler to NULL, the HTTP server will sent the requested file
directly to the browser.


Then you can define a mime type, particularly if you set handler to
NULL, so the file is sent with a correct MIME type ("raw/unknown",
"text/plain", ...).
When using a handler, you should probably set mime to NULL, since it
will then use the default HTML Raydium handler. But you can even set mime
type when using your handlers, allowing you to create fully custom responses.

48.8 signed char raydium_web_client_get(char *filename):

This is a small HTTP 1.0 client, used to download data from a Raydium server.
For any other use, you should use PHP (See PHP and RayPHP chapters).

To use this function you must be connected to a game server (see
raydium_network_client_connect_to() for more informations), therefore
filename should be only a path or a filename, not an URL.

Warning: no proxy support is provided here.

This function is very useful for downloading data from the game server
you're currently connected to, like tracks, maps, skins, ...
This client is able to detect Raydium HTTP server messages, so it will not
download HTML content instead of data when a Raydium server returns an error.

It will not overwrite the local file if the downloaded one is the same.

No upload support is available yet.


49 Pseudo HDR:

49.1 Introduction:

Currently, HDR features of Raydium are highly experimental, because of
performance issues with some hardware.

The basic idea behind Raydium's HDR rendering is to use a few tricks to
allow such rendering even on low-end hardware.

Let's take a example scene:
base

During this regular rendering, Raydium will use the (boolean) "HDR tag" of
each texture to know if the texture is bright or not. This tag is toggled
using the raydium_hdr_texture() function. The result is a very contrasted
version of the rendered image, like this:
stencil

Raydium will then downscale this image, and apply a heavy blur effect:
blur

This blurred texture is uploaded back to the video card, upscaled, and added
to the already rendered color buffer:
final


49.2 void raydium_hdr_init(void):

Internal use.

49.3 void raydium_hdr_enable(void):

Enables HDR.

49.4 void raydium_hdr_disable(void):

Disables HDR.

49.5 void raydium_hdr_internal_window_malloc(void):

Internal use.

49.6 void raydium_hdr_block(signed char blocking):

Internal use. Not currenlty used, in facts.

49.7 void raydium_hdr_blur(unsigned char *in, unsigned char *out):

Internal use. Will blur in to out.

49.8 void raydium_hdr_map(void):

Internal use. Will create HDR texture.

49.9 void raydium_hdr_map_apply(void):

Internal use. Will apply HDR texture on the screen.

49.10 void raydium_hdr_settings_color_local(GLfloat r, GLfloat g, GLfloat b, GLfloat a):

You can define the color of the HDR effect. This is the "accurate" HDR color,
not the ambient HDR color. (see raydium_hdr_settings_color_ambient()).

Alpha channel (a is not currently used). Default is full white, but
it's quiet a good idea to match your background scene color.

49.11 void raydium_hdr_settings_color_ambient(GLfloat r, GLfloat g, GLfloat b, GLfloat a):

Same as raydium_hdr_settings_color_local(), but for the ambient HDR mask. This
mask is a zoomed copy of the local HDR mask, and should be a subtile, darker
color of raydium_hdr_settings_color_local().

You may have to play a bit with this color to find the correct one for your
scene, but it can enhance greatly the HDR rendering.

You can set r, g and b to 0 to disable the ambient HDR.

49.12 void raydium_hdr_settings_eye(float speed, float alpha_max):

Defines the eye settings, where speed will define how quickly the eye
will react to a bright scene.
Default is currently RAYDIUM_HDR_EYE_SPEED_DEFAULT (0.1).

The other setting, alpha_max, will define how visible the HDR effect will
be. The default is 1.0.

49.13 void raydium_hdr_settings(GLfloat *color_local, GLfloat *color_ambient, float eye_speed, float alpha_max):

See raydium_hdr_settings_color_local(), raydium_hdr_settings_color_ambient()
and raydium_hdr_settings_eye().

49.14 signed char raydium_hdr_texture(int texture, signed char hdr):


This function will set the HDR tag on texture. If hdr is set to
true (1), this texture will be used as "bright emitter" by the HDR rendering.

By default, all textures are loaded with a HDR tag of 0, except if texture
filename starts with HDR letters (example: HDR_lamp_buld.tga). Skybox
is also loaded with HDR tag sets to 1.

WARNING: Because of display lists, HDR tagging should be done before
drawing objects for the first time !

49.15 signed char raydium_hdr_texture_name(char *texture, signed char hdr):

Same as above, but using texture name.

49.16 void raydium_hdr_texture_reset(void):

Will reset all HDR tag for textures to 0.
See note about display lists in raydium_hdr_texture(), above.


50 Lens flare effects:

50.1 Introduction:

Lens flare effects can be used to emulate various reflection and scattering
visuals, for example and probably the most common type is the sunlight.
Lens flare effects inside the engine are designed to be highly customizable.
You should be able to create everything with them you can think of. Lamps,
starry skies, headlights for vehicles, explosions, UFO invasions and much more.

Lets show an example scene of a basic sunlight lens flare effect:
lensflare

Currently, lens flare effects support eight different effect layers, so called
FX groups. Each group has size, velocity, color and alpha attributes. You're
also able to use custom textures, see the raydium_lensflare_texture_name()
function for details.

The simplest way to create a lens flare effect is to load a lens flare effect
configuration file, usually .lf extension text files.
// Skeleton lens flare effect configuration file.
 
// Optional custom set of textures.
// When no texture name was assigned the default set of textures will be used.
// e. g. texture="hexagon" will load LF_hexagon_glow.tga instead of LFglow.tga.
texture=""
 
// Lens flare FX groups.
// To deactivate a FX group simply do not declare it or comment it out.
// Available FX groups: main, rays, streak, halo, orbs, glow, star, anam.
// fxgrp = { size, velocity, red, green, blue, alpha }
main   = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }
rays   = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }
streak = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }
halo   = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }
orbs   = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }
glow   = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }
star   = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }
anam   = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }

After creation of the lens flare you can change the position calling
raydium_lensflare_move() using the lens flare id returned by
raydium_lensflare_create().

If you want to use lens flare effects together with HDR, be sure to enable HDR
calling raydium_hdr_enable() before creating a lens flare effect, so the
textures will be automagically set to be HDR able.

This effect can be quiet heavy on the framerate, especially when using multiple
big blended layers. So please be careful, you have been warned. ;)

50.2 void raydium_lensflare_init(void):

Internal use.

50.3 void raydium_lensflare_enable(void):

Enables the lens flare effect system.

50.4 void raydium_lensflare_disable(void):

Disables the lens flare effect system.

50.5 signed char raydium_lensflare_isvalid(int lf):

Internal use, but you can call this function to verify if lf lens flare
has a valid id inside array range, see RAYDIUM_MAX_LENSFLARES.

50.6 void raydium_lensflare_reset(int lf):

Deactivates and resets lf lens flare to the initial state.

50.7 void raydium_lensflare_on(int lf):

Turns lf lens flare on.

50.8 void raydium_lensflare_off(int lf):

Turns lf lens flare off.

50.9 void raydium_lensflare_switch(int lf):

Toggles lf lens flare state.

50.10 void raydium_lensflare_texture_name(int lf, char *name):

This function allows to load custom name lens flare textures.
By default the names of the lens flare textures are:
LFglow.tga, LFstar.tga, LFstreak.tga, LFhalo.tga,
LFray.tga, LFanam.tga.

However with this function you can define your own set of lens flare textures,
with the following name format:
LF_<name>_glow.tga, LF_<name>_star.tga, ...

Example:
raydium_lensflare_texture_name(raydium_lensflare_find("myname"),"mytex");
// Lens flare textures will be LF_mytex_glow.tga, LF_mytex_star.tga, ... 
 


If you want to use lens flare effects together with HDR, be sure to enable HDR
calling raydium_hdr_enable() before using this function, so the textures
will be automagically set to be HDR able.

50.11 void raydium_lensflare_move(int lf, float *pos):

This function will move lf lens flare to position pos.
pos is a float array of three values (x,y,z).

50.12 void raydium_lensflare_move_3f(int lf, float x, float y, float z):

Same as above, but using three float values.

50.13 void raydium_lensflare_move_relative_3f(int lf, float x, float y, float z):

Same as above, but using relative coordinates. Useful for ingame displacements.

50.14 signed char raydium_lensflare_fx_isvalid(int fx):

Internal use, but you can call this function to verify if fx FX group
has a valid id inside array range, see RAYDIUM_LENSFLARE_MAX_FX.

50.15 void raydium_lensflare_fx_on(int lf, int fx):

Turns fx FX group on.

50.16 void raydium_lensflare_fx_off(int lf, int fx):

Turns fx FX group off.

50.17 void raydium_lensflare_fx_switch(int lf, int fx):

Toggles fx FX group state.

50.18 void raydium_lensflare_fx_size_change(int lf, int fx, float s):

Sets s size of fx FX group within lf lens flare effect.

50.19 void raydium_lensflare_fx_color_change(int lf, int fx, float r, float g, float b):

Sets color of fx FX group within lf lens flare effect.

50.20 void raydium_lensflare_fx_alpha_change(int lf, int fx, float a):

Sets alpha transparency of fx FX group within lf lens flare effect.

50.21 void raydium_lensflare_fx_color_rgba(int lf, int fx, float r, float g, float b, float a):

Sets color and alpha of fx FX group within lf lens flare effect.

50.22 void raydium_lensflare_fx_velocity_change(int lf, int fx, float v):

Sets v velocity of fx FX group within lf lens flare effect.

50.23 signed char raydium_lensflare_internal_load(int lf, char *filename):

Internal use, load lf lens flare values from filename configuration.

50.24 int raydium_lensflare_find(char *name):

Resolves lens flare id from its name.

50.25 int raydium_lensflare_create(char *name, char *filename):

Builds a new lens flare effect with name using the values from the
filename configuration and returns the new lens flare id or -1 on error.

You can also call this function several times with the same name to
overwrite the lens flare values with different filename configurations.

There are RAYDIUM_MAX_LENSFLARES slots available at the same time.

50.26 signed char raydium_lensflare_internal_point_is_occluded(float x, float y, float z):

Internal use.

50.27 void raydium_lensflare_fx_internal_draw(int lf, int fx, int id, int tex, float d, float cx, float cy, float vx, float vy, float g, float pt):

Internal use.

50.28 void raydium_lensflare_draw(int lf):

Internal use.

50.29 void raydium_lensflare_draw_all(void):

Internal use.


51 Atexit functions:

51.1 Introduction:

Raydium provides its own atexit function, since Win32 DLL requires a bit
of magic for such things. This support is mainly here for internal reasons,
you can continue to use regular atexit() in your applications.

51.2 int raydium_atexit(void (*func)(void)):

As the original atexit():
Register a function to be called at norma program termination.
Functions so registered are called in the reverse order of their
registration; no arguments are passed.
Returns 0 if successful.

51.3 void raydium_atexit_call(void):

Internal use. Will call all registered functions.

51.4 void raydium_atexit_init(void):

Internal use.


52 Shaders:

52.1 Introduction:

Raydium provides a support for OpenGL Shading Language (GLSL).
This documentation talks only about Raydium Shader API, and not about
the Shading Language itself. With Raydium, shaders works by two: you must
provide a vertex shader and a fragment shader each time. This is a very
usual way to do.

You must know that only one shader can be active at a time.
Once a shader is loaded, Raydium API allows you to attach this shader to
a texture, so you don't have to deal manually with activation/deactivation.

You can also change all "uniform" variables from shaders
using raydium_shader_var_...() functions.
Into this set, all functions that does not contain the _name
suffix are only able to deal with current shader !.

You can use the global variable raydium_shader_support to detect if
current hardware supports GLSL or not (1=OK 0=no shader support).

Raydium automatically feeds the "vec3 tangent" attribute if the shader
requests it (you only have to declare this attribute), with a
per vertex value. From this, it's easy to generate the binormal
vector in the shader, using a simple cross product:
vec3 binormal = cross(tangent, gl_Normal);


52.2 void raydium_shader_init(void):

Internal use. Init all shader subsystem.

52.3 signed char raydium_shader_isvalid(int shader):

Internal use. Returns true (1) if shader slot is in bounds and filled.

52.4 int raydium_shader_find(char *name):

Returns shader's ID using its name.

52.5 void raydium_shader_infolog(GLhandleARB shader):

Internal use.
Reports full driver error message when shader compilation or linking fails.

52.6 int raydium_shader_load(char *name, char *file_vert, char *file_frag):

Loads the vertex shader file_vert and the fragment shader file_frag.
The shader is stored with the provided name. This function returns the
shader ID or -1 in case of failure.

52.7 int raydium_shader_variable(int shader, char *name):

Returns an ID for the variable "name of the provided shader.

52.8 signed char raydium_shader_var_i(int var_id, int value):

This function will change the value of the variable var_id of
the current shader.
Value is an integer.

52.9 signed char raydium_shader_var_i_name(char *shader, char *variable, int value):

Same as above, but using shader's name and variable's name. This function is
able to change the variable's value even if the shader is not
the current one.

52.10 signed char raydium_shader_var_f(int var_id, float value):

This function will change the value of the variable var_id of
the current shader.
Value is a float.

52.11 signed char raydium_shader_var_f_name(char *shader, char *variable, float value):

Same as above, but using shader's name and variable's name. This function is
able to change the variable's value even if the shader is not
the current one.

52.12 signed char raydium_shader_var_2f(int var_id, float value1, float value2):

This function will change the value of the variable var_id of
the current shader.
Value is an "array" of 2 floats (vec2).

52.13 signed char raydium_shader_var_2f_name(char *shader, char *variable, float value1, float value2):

Same as above, but using shader's name and variable's name. This function is
able to change the variable's value even if the shader is not
the current one.

52.14 signed char raydium_shader_var_3f(int var_id, float value1, float value2, float value3):

This function will change the value of the variable var_id of
the current shader.
Value is an "array" of 3 floats (vec3).

52.15 signed char raydium_shader_var_3f_name(char *shader, char *variable, float value1, float value2, float value3):

Same as above, but using shader's name and variable's name. This function is
able to change the variable's value even if the shader is not
the current one.

52.16 signed char raydium_shader_var_4f(int var_id, float value1, float value2, float value3, float value4):

This function will change the value of the variable var_id of
the current shader.
Value is an "array" of 4 floats (vec4).

52.17 signed char raydium_shader_var_4f_name(char *shader, char *variable, float value1, float value2, float value3, float value4):

Same as above, but using shader's name and variable's name. This function is
able to change the variable's value even if the shader is not
the current one.

52.18 signed char raydium_shader_current(int shader):

This function will change the current active shader with shader.
To disable a shader and get back to regular OpenGL fixed function pipeline,
set shader value to -1.

52.19 signed char raydium_shader_current_name(char *shader):

Same as above, but using shader's name.

52.20 signed char raydium_shader_attach_texture(int shader, int texture):

During rendering, each time the texture will be used by any object,
the shader will be activated.

52.21 signed char raydium_shader_attach_texture_name(char *shader, char *texture):

Same as above, but using shader's name and texture's name.

52.22 void raydium_shader_internal_vertex_attributes(int i):

Internal. Per vertex "callback" from render.c for shader attributes.

52.23 signed char raydium_shader_var_fv(int var_id, int num, float value[]):

This function will change the array of num values of the variable var_id of
the current shader.
Value is a float array.
Num is an integer.

52.24 signed char raydium_shader_var_fv_name(char *shader, char *variable, int num, float value[]):

Same as above, but using shader's name and variable's name. This function is
able to change the variable's value even if the shader is not
the current one.


53 Shadows:

53.1 Introduction:

Raydium provides a simple support for shadowing, on top of the RayODE API.

This shadowing system will draw all RayODE elements to a shadow map, from
light point of vue. This map will then be projected to the RayODE ground.

This method have some drawbacks (shadows are projected all over
Z axis [floor-and-ceiling shadows], one frame lag, ...) but have the huge
advantage to be very fast, even on lew-end hardware, and requires no
particular tuning or setup.

Short story: see raydium_shadow_enable() (available in the console).

53.2 void raydium_shadow_init(void):

Internal use.

53.3 void raydium_shadow_mode(char mode):

Raydium now features more accurate shadowmaps, rendering shadows only
around the camera. See raydium_shadow_camerabox_size() if you want to
change the size of the bounding box.
This mode is now the default (RAYDIUM_SHADOW_MODE_CAMERABOX), but the old
behavior is available with RAYDIUM_SHADOW_MODE_FULLSCENE, and you can
switch from one mode to the other anytime.

53.4 void raydium_shadow_camerabox_size(GLfloat size):

Defines the size of the box around the camera where the shadows are generated
and rendered.
Of course, current shadow mode should be RAYDIUM_SHADOW_MODE_CAMERABOX.
Default value is RAYDIUM_SHADOW_BOX_SIZE (see shadow.h)

53.5 void raydium_shadow_enable(void):

Enable shadows. Shadows are disabled by default.

53.6 void raydium_shadow_disable(void):

Disable shadows.

53.7 signed char raydium_shadow_isenabled(void):

Will return true (1) if shadows are enabled, false (0) otherwise.

53.8 void raydium_shadow_light_main(GLuint l):

Defines wich light is use to generate shadows. Light #0 is the default.

53.9 void raydium_shadow_ground_change(int object):

Internal use. Defines which object is the ground (where shadows are projected).

53.10 void raydium_shadow_map_generate(void):

Internal use. Will generate shadow map texture.

53.11 void raydium_shadow_map_render(void):

Internal use. Will apply shadow map to the ground.

53.12 void raydium_shadow_object_draw(GLuint o):

Internal use. Draws an object to the shadow map.


54 MyGLUT?:

54.1 Details:

MyGLUT? is an alternative to "real" GLUT, providing a small subset of the
original API, up to Raydium needs, and tries to enhances some GLUT features,
such as window and keyboard management.

While staying portable on all Raydium targets, MyGLUT? is able to use some
platform-specific features, such as Xinerama for Linux.

MyGLUT? is heavily based on PW, the PLIB windowing library
( http://plib.sourceforge.net/ ). Huge thanks to Steve Baker for his great work.


55 Miscalleneous:

55.1 License:

Raydium engine and provided applications are released under both BSD license
and Lesser GPL library license.
See "license.txt" file in the source code directory.

55.2 About CQFD Corp Raydium Team:

Alphabetical order:
batcox, Blue Prawn, Cocorobix, FlexH, Jimbo, manproc, Mildred, neub, ouille,
RyLe?, vicente, whisky, willou, Xfennec, Yoltie, ... and many others !

55.3 Todo:

Wiki RoadMap and ToDo?: http://wiki.raydium.org/wiki/RoadMap
See also my todo: http://wiki.raydium.org/wiki/XfenneC

Please, if you start working on a feature, say it on the Wiki.

55.4 Links:

http://raydium.org (Raydium home)
svn://raydium.org/raydium/trunk (SVN trunk)
http://raydium.org/svn.php (SVN "live" changelog)
http://memak.raydium.org/ (MeMak forum: "a game using Raydium", french)
http://www.cqfd-corp.org/ (CQFD homesite)
mailto:xfennec -AT- cqfd-corp.org

55.5 Greets:

RyLe?: original implementation of sound.c (OpenAL core sound API)

BatcoX: export of RayODE functions into RayPHP (reg_api.c)
and additional PHP wrappers (wrappers.c)

Mildred: header and Makefile generator, dynamic version of
Raydium (.so and .a) for Linux.

vicente: sprite engine, autoconfig system, and a lot of other things.


Chapters:

1 Introduction to Raydium

2 Maths

3 Logging

4 Random

5 Fog

6 Window management

7 Capture (2D)

8 Background

9 Frame clearing

10 Lights

11 Keyboard & keys

12 Mouse

13 Textures

14 Rendering

15 Particle engine

16 Callbacks

17 Normals

18 vertices

19 Land

20 Sky and environement boxes

21 "Internal" informations access

22 Files (generic)

23 Files (TRI format)

24 File path

25 Camera

26 Objects

27 Initialization

28 Command Line Interface

29 Signals

30 Sound and music

31 Timecalls

32 Network

33 Sprites (viewer axis aligned 2D billboards)

34 OSD (On Screen Display)

35 In-game console

36 Joysticks, pads and force feedback

37 Graphic User Interfaces

38 Data registration

39 PHP scripting engine

40 Profiling (sort of ...)

41 RayPHP (internals)

42 Text file parsing

43 Live textures and videos API

44 Video playback

45 Integrated Physics (ODE)

46 RayODE network layer

47 RegAPI

48 HTTP Web server and tools

49 Pseudo HDR

50 Lens flare effects

51 Atexit functions

52 Shaders

53 Shadows

54 MyGLUT

55 Miscalleneous


Index:

raydium_atexit(void (*func)(void))
raydium_atexit_call(void)
raydium_atexit_init(void)
raydium_background_color_change (GLfloat r, GLfloat g, GLfloat b, GLfloat a)
raydium_callback (void (*loop))
raydium_callback_display_set(void (*fdisplay))
raydium_callback_image (void)
raydium_callback_set (void)
raydium_camera_freemove(int move)
raydium_camera_get_data(void)
raydium_camera_internal (GLfloat x, GLfloat y, GLfloat z)
raydium_camera_internal_prepare(void)
raydium_camera_look_at (GLfloat x, GLfloat y, GLfloat z, GLfloat x_to, GLfloat y_to, GLfloat z_to)
raydium_camera_orbitmove(float x_to, float y_to, float z_to)
raydium_camera_path_draw (int p)
raydium_camera_path_draw_name (char *path)
raydium_camera_path_find (char *name)
raydium_camera_path_init (int p)
raydium_camera_path_init_all (void)
raydium_camera_path_load (char *filename)
raydium_camera_path_reset(void)
raydium_camera_place (GLfloat x, GLfloat y, GLfloat z, GLfloat lacet, GLfloat tangage, GLfloat roulis)
raydium_camera_replace (void)
raydium_camera_replace_go (GLfloat * pos, GLfloat * R)
raydium_camera_rumble(GLfloat amplitude, GLfloat ampl_evo, GLfloat secs)
raydium_camera_smooth (GLfloat px, GLfloat py, GLfloat pz, GLfloat lx, GLfloat ly, GLfloat lz, GLfloat zoom, GLfloat roll, GLfloat step)
raydium_camera_smooth_element_to_path_name (char *element, char *path, GLfloat path_step, GLfloat smooth_step)
raydium_camera_smooth_element_to_path_offset (int element, GLfloat offset_x, GLfloat offset_y, GLfloat offset_z, char *path, GLfloat path_step, GLfloat smooth_step)
raydium_camera_smooth_element_to_path_offset_name (char *element, GLfloat offset_x, GLfloat offset_y, GLfloat offset_z, char *path, GLfloat path_step, GLfloat smooth_step)
raydium_camera_smooth_path (char *path, GLfloat step, GLfloat * x, GLfloat * y, GLfloat * z, GLfloat * zoom, GLfloat * roll)
raydium_camera_smooth_path_to_element (char *path, int element, GLfloat path_step, GLfloat smooth_step)
raydium_camera_smooth_path_to_element_name (char *path, char *element, GLfloat path_step, GLfloat smooth_step)
raydium_camera_smooth_path_to_path (char *path_from, GLfloat path_step_from, char *path_to, GLfloat path_step_to, GLfloat smooth_step)
raydium_camera_smooth_path_to_pos (char *path, GLfloat lx, GLfloat ly, GLfloat lz, GLfloat path_step, GLfloat smooth_step)
raydium_camera_smooth_pos_to_path (GLfloat lx, GLfloat ly, GLfloat lz, char *path, GLfloat path_step, GLfloat smooth_step)
raydium_camera_vectors (GLfloat * res3)
raydium_capture_filename_auto(char *dest,char *format)
raydium_capture_frame(char *filename)
raydium_capture_frame_auto(void)
raydium_capture_frame_jpeg(char *filename)
raydium_capture_frame_jpeg_auto(void)
raydium_capture_frame_jpeg_now(char *filename)
raydium_capture_frame_now(char *filename)
raydium_clear_color_update (void)
raydium_clear_frame (void)
raydium_console_complete (char *str)
raydium_console_draw (void)
raydium_console_event (void)
raydium_console_exec_last_command (void)
raydium_console_exec_script (char *file)
raydium_console_gets (char *where)
raydium_console_history_add (char *str)
raydium_console_history_next (void)
raydium_console_history_previous (void)
raydium_console_history_read(char * *hist)
raydium_console_history_save (void)
raydium_console_init (void)
raydium_console_internal_isalphanumuscore (char c)
raydium_console_line_add (char *format, ...)
raydium_file_basename(char *dest,char *from)
raydium_file_binary_fgets(char *dest, int max, FILE *stream)
raydium_file_cache_flush(void)
raydium_file_directory_writable(char *path)
raydium_file_dirname(char *dest,char *from)
raydium_file_ext(char *dest, char *from)
raydium_file_fopen(char *file, char *mode)
raydium_file_home_path(char *file)
raydium_file_home_path_cpy(char *file, char *dest)
raydium_file_isdir(char *path)
raydium_file_load(char *filename)
raydium_file_log_fopen_display(void)
raydium_file_readable(char *filename)
raydium_file_rm_rf(char *path)
raydium_file_set_textures (char *name)
raydium_file_sum_simple(char *filename)
raydium_file_sum_simple_mode(char *filename,char *mode)
raydium_file_utime(const char *filename, struct utimbuf *times)
raydium_fog_apply(void)
raydium_fog_color_update (void)
raydium_fog_density(GLfloat density)
raydium_fog_disable (void)
raydium_fog_enable (void)
raydium_fog_far(GLfloat far)
raydium_fog_mode(GLuint mode)
raydium_fog_near(GLfloat near)
raydium_fog_volumetric_disable(void)
raydium_fog_volumetric_enable(void)
raydium_fog_volumetric_support(void)
raydium_fog_wait(void)
raydium_gui_button_clicked(void)
raydium_gui_button_create(char *name, int window, GLfloat px, GLfloat py, char *caption, void *OnClick)
raydium_gui_button_create_simple(char *name, int window, GLfloat px, GLfloat py, char *caption)
raydium_gui_button_draw(int w, int window)
raydium_gui_button_read(int window, int widget, char *str)
raydium_gui_button_write(int window, int widget, char *str)
raydium_gui_check_create(char *name, int window, GLfloat px, GLfloat py, char *caption, signed char checked)
raydium_gui_check_draw(int w, int window)
raydium_gui_check_read(int window, int widget, char *str)
raydium_gui_check_write(int window, int widget, int value)
raydium_gui_combo_create(char *name, int window, GLfloat px, GLfloat py, char *items, int current)
raydium_gui_combo_draw(int w, int window)
raydium_gui_combo_read(int window, int widget, char *str)
raydium_gui_combo_write(int window, int widget, int value)
raydium_gui_draw(void)
raydium_gui_edit_create(char *name, int window, GLfloat px, GLfloat py, char *default_text)
raydium_gui_edit_draw(int w, int window)
raydium_gui_edit_read(int window, int widget, char *str)
raydium_gui_edit_write(int window, int widget, char *str)
raydium_gui_hide(void)
raydium_gui_init(void)
raydium_gui_internal_object_create(char *name, int window, signed char type, GLfloat px, GLfloat py, GLfloat sizex, GLfloat sizey, GLfloat font_size)
raydium_gui_isvisible(void)
raydium_gui_label_create(char *name, int window, GLfloat px, GLfloat py, char *caption, GLfloat r, GLfloat g, GLfloat b)
raydium_gui_label_draw(int w, int window)
raydium_gui_label_read(int window, int widget, char *str)
raydium_gui_label_write(int window, int widget, char *str)
raydium_gui_list_id(char *item, char *list)
raydium_gui_read(int window, int widget, char *str)
raydium_gui_read_name(char *window, char *widget, char *str)
raydium_gui_read_widget(raydium_gui_Object *w, char *str)
raydium_gui_show(void)
raydium_gui_theme_init(void)
raydium_gui_theme_load(char *filename)
raydium_gui_track_create(char *name, int window, GLfloat px, GLfloat py, int min, int max, int current)
raydium_gui_track_draw(int w, int window)
raydium_gui_track_read(int window, int widget, char *str)
raydium_gui_track_write(int window, int widget, int value)
raydium_gui_widget_draw_internal(GLfloat *uv, GLfloat *xy)
raydium_gui_widget_find(char *name, int window)
raydium_gui_widget_focus(int widget, int window)
raydium_gui_widget_focus_name(char *widget, char *window)
raydium_gui_widget_isvalid(int i, int window)
raydium_gui_widget_next(void)
raydium_gui_widget_sizes(GLfloat sizex, GLfloat sizey, GLfloat font_size)
raydium_gui_window_OnDelete(int window, void *OnDelete)
raydium_gui_window_OnDelete_name(char *window, void *OnDelete)
raydium_gui_window_create(char *name, GLfloat px, GLfloat py, GLfloat sizex, GLfloat sizey)
raydium_gui_window_delete(int window)
raydium_gui_window_delete_name(char *window)
raydium_gui_window_draw(int window)
raydium_gui_window_find(char *name)
raydium_gui_window_init(int window)
raydium_gui_window_isvalid(int i)
raydium_gui_write(int window, int widget, char *str, int value)
raydium_gui_write_name(char *window, char *widget, char *str, int value)
raydium_gui_zone_create(char *name, int window, GLfloat px, GLfloat py, GLfloat sx, GLfloat sy, int tag, void *OnClick)
raydium_gui_zone_draw(int w, int window)
raydium_gui_zone_read(int window, int widget, char *str)
raydium_hdr_block(signed char blocking)
raydium_hdr_blur(unsigned char *in, unsigned char *out)
raydium_hdr_disable(void)
raydium_hdr_enable(void)
raydium_hdr_init(void)
raydium_hdr_internal_window_malloc(void)
raydium_hdr_map(void)
raydium_hdr_map_apply(void)
raydium_hdr_settings(GLfloat *color_local, GLfloat *color_ambient, float eye_speed, float alpha_max)
raydium_hdr_settings_color_ambient(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
raydium_hdr_settings_color_local(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
raydium_hdr_settings_eye(float speed, float alpha_max)
raydium_hdr_texture(int texture, signed char hdr)
raydium_hdr_texture_name(char *texture, signed char hdr)
raydium_hdr_texture_reset(void)
raydium_init_args(int argc, char * *argv)
raydium_init_args_name(int argc, char * *argv, char *app_name)
raydium_init_cli_option(char *option, char *value)
raydium_init_cli_option_default(char *option, char *value, char *default_value)
raydium_init_engine (void)
raydium_init_internal_homedir_find(char *)
raydium_init_key (void)
raydium_init_lights (void)
raydium_init_load(char *filename)
raydium_init_objects (void)
raydium_init_reset (void)
raydium_internal_dump (void)
raydium_internal_dump_matrix (int n)
raydium_internal_live_close(void)
raydium_internal_live_video_callback(void)
raydium_joy_ff_autocenter (int perc)
raydium_joy_ff_tremble_set (GLfloat period, GLfloat force)
raydium_joy_key_emul (void)
raydium_key_normal_callback (GLuint key, int x, int y)
raydium_key_pressed (GLuint key)
raydium_key_special_callback (GLuint key, int x, int y)
raydium_key_special_up_callback (GLuint key, int x, int y)
raydium_lensflare_create(char *name, char *filename)
raydium_lensflare_disable(void)
raydium_lensflare_draw(int lf)
raydium_lensflare_draw_all(void)
raydium_lensflare_enable(void)
raydium_lensflare_find(char *name)
raydium_lensflare_fx_alpha_change(int lf, int fx, float a)
raydium_lensflare_fx_color_change(int lf, int fx, float r, float g, float b)
raydium_lensflare_fx_color_rgba(int lf, int fx, float r, float g, float b, float a)
raydium_lensflare_fx_internal_draw(int lf, int fx, int id, int tex, float d, float cx, float cy, float vx, float vy, float g, float pt)
raydium_lensflare_fx_isvalid(int fx)
raydium_lensflare_fx_off(int lf, int fx)
raydium_lensflare_fx_on(int lf, int fx)
raydium_lensflare_fx_size_change(int lf, int fx, float s)
raydium_lensflare_fx_switch(int lf, int fx)
raydium_lensflare_fx_velocity_change(int lf, int fx, float v)
raydium_lensflare_init(void)
raydium_lensflare_internal_load(int lf, char *filename)
raydium_lensflare_internal_point_is_occluded(float x, float y, float z)
raydium_lensflare_isvalid(int lf)
raydium_lensflare_move(int lf, float *pos)
raydium_lensflare_move_3f(int lf, float x, float y, float z)
raydium_lensflare_move_relative_3f(int lf, float x, float y, float z)
raydium_lensflare_off(int lf)
raydium_lensflare_on(int lf)
raydium_lensflare_reset(int lf)
raydium_lensflare_switch(int lf)
raydium_lensflare_texture_name(int lf, char *name)
raydium_light_blink_internal_update (GLuint l)
raydium_light_blink_start (GLuint l, int fpc)
raydium_light_callback (void)
raydium_light_disable (void)
raydium_light_enable (void)
raydium_light_move (GLuint l, GLfloat * vect)
raydium_light_off (GLuint l)
raydium_light_on (GLuint l)
raydium_light_reset (GLuint l)
raydium_light_switch (GLuint l)
raydium_light_texture(int texture, signed char enable)
raydium_light_texture_name(char *name, signed char enable)
raydium_light_to_GL_light (GLuint l)
raydium_light_update_all (GLuint l)
raydium_light_update_intensity (GLuint l)
raydium_light_update_position (GLuint l)
raydium_light_update_position_all (void)
raydium_live_init(void)
raydium_live_texture_create(char *as, unsigned char *data_source, int tx, int ty, int bpp)
raydium_live_texture_draw(int livetex, GLfloat alpha,GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
raydium_live_texture_draw_name(char *texture, GLfloat alpha,GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
raydium_live_texture_find(int original_texture)
raydium_live_texture_find_free(void)
raydium_live_texture_isvalid(int i)
raydium_live_texture_mask(int livetex, GLfloat alpha)
raydium_live_texture_mask_name(char *texture, GLfloat alpha)
raydium_live_texture_refresh(int livetex)
raydium_live_texture_refresh_callback_set(int livetex, void *callback)
raydium_live_texture_refresh_callback_set_name(char *texture, void *callback)
raydium_live_texture_refresh_name(char *texture)
raydium_live_texture_video(int device_id, char *as)
raydium_live_video_find_free(void)
raydium_live_video_isvalid(int i)
raydium_live_video_open(char *device, int sizex, int sizey)
raydium_live_video_open_auto(void)
raydium_live_video_read(raydium_live_Device *dev)
raydium_log (char *format, ...)
raydium_loop(void)
raydium_math_MatrixInverse(const float *m,float *out)
raydium_math_abs(a) (macro)
raydium_math_angle_from_projections(float px, float py)
raydium_math_cos (GLfloat i)
raydium_math_cos_inv (GLfloat i)
raydium_math_hms(double t, int *h, int *m, int *s, int *ms)
raydium_math_isfloat(a) (macro)
raydium_math_max(a,b) (macro)
raydium_math_min(a,b) (macro)
raydium_math_point_unproject_3D(GLfloat x, GLfloat y, GLfloat z, float* resx, float* resy)
raydium_math_pos_get_modelview (GLfloat * res)
raydium_math_pos_to_matrix (GLfloat * pos, GLfloat * m)
raydium_math_pow2_next(int value)
raydium_math_quaternion_multiply(float *q1, float *q2, float *result)
raydium_math_quaternion_normalize(float *quat)
raydium_math_quaternion_slerp(float *start, float *end, float alpha,float *result)
raydium_math_rotate (GLfloat * p, GLfloat rx, GLfloat ry, GLfloat rz, GLfloat * res)
raydium_math_round(a) (macro)
raydium_math_sin (GLfloat i)
raydium_math_sin_inv (GLfloat i)
raydium_mouse_button_pressed (int button)
raydium_mouse_click_callback (int but, int state, int x, int y)
raydium_mouse_grab_delta(int *x, int *y)
raydium_mouse_hide() (macro)
raydium_mouse_init (void)
raydium_mouse_isvisible(void)
raydium_mouse_move(int x, int y)
raydium_mouse_move_callback (int x, int y)
raydium_mouse_show() (macro)
raydium_network_broadcast (signed char type, char *buff)
raydium_network_client_connect_to (char *server)
raydium_network_client_disconnect(void)
raydium_network_client_discover(char *game,int version)
raydium_network_close (void)
raydium_network_discover_getserver(int num, char *name, char *ip, char *info, int *player_count, int *player_max)
raydium_network_discover_numservers(void)
raydium_network_init (void)
raydium_network_init_sub(void)
raydium_network_internal_dump (void)
raydium_network_internal_find_delay_addr (int player)
raydium_network_internal_server_delays_dump (void)
raydium_network_internet_test(void)
raydium_network_linux_find_broadcast_interfaces(void)
raydium_network_netcall_add (void *ptr, int type, signed char tcp)
raydium_network_netcall_exec (int type, char *buff)
raydium_network_nid_element_find (int nid)
raydium_network_player_name (char *str)
raydium_network_propag_add (int type, void *data, int size)
raydium_network_propag_find (int type)
raydium_network_propag_recv (int type, char *buff)
raydium_network_propag_refresh (int type)
raydium_network_propag_refresh_all (void)
raydium_network_propag_refresh_id (int i)
raydium_network_queue_ack_recv (int type, char *buff)
raydium_network_queue_ack_send (unsigned short tcpid, struct sockaddr *to)
raydium_network_queue_check_time (void)
raydium_network_queue_element_add (char *packet, struct sockaddr *to)
raydium_network_queue_element_init (raydium_network_Tcp * e)
raydium_network_queue_is_tcpid (int type)
raydium_network_queue_tcpid_gen (void)
raydium_network_queue_tcpid_known (unsigned short tcpid, unsigned short player)
raydium_network_queue_tcpid_known_add (int tcpid, int player)
raydium_network_read (int *id, signed char *type, char *buff)
raydium_network_read_faked(void)
raydium_network_read_flushed (int *id, signed char *type, char *buff)
raydium_network_server_broadcast(char *name, char *app_or_mod, int version)
raydium_network_server_broadcast_check(void)
raydium_network_server_broadcast_info(char *info)
raydium_network_server_create (void)
raydium_network_set_socket_block (int block)
raydium_network_socket_close(int fd)
raydium_network_socket_is_readable(int fd)
raydium_network_timeout_check (void)
raydium_network_write (struct sockaddr *to, int from, signed char type, char *buff)
raydium_normal_generate_lastest_tangent(void)
raydium_normal_generate_lastest_triangle (int default_visu)
raydium_normal_internal_smooth_generic(char *type,GLuint from, GLuint to,GLfloat *in_x, GLfloat *in_y, GLfloat *in_z,GLfloat *out_x, GLfloat *out_y, GLfloat *out_z)
raydium_normal_regenerate_all (void)
raydium_normal_restore_all (void)
raydium_normal_smooth_all (void)
raydium_normal_smooth_from_to(GLuint from, GLuint to)
raydium_normal_tangent_smooth_all (void)
raydium_normal_tangent_smooth_from_to(GLuint from, GLuint to)
raydium_object_anim(int object, int instance, int anim)
raydium_object_anim_automatic(int object, int anim, GLfloat factor)
raydium_object_anim_automatic_name(char *object, char *anim, GLfloat factor)
raydium_object_anim_default(int object, int anim)
raydium_object_anim_find(int object, char *name)
raydium_object_anim_frame(int object, int instance, GLfloat frame)
raydium_object_anim_frame_name(char *object, int instance, GLfloat frame)
raydium_object_anim_generate_internal(int object, int instance)
raydium_object_anim_instance(int object, int instance)
raydium_object_anim_instance_name(char *object, int instance)
raydium_object_anim_ispunctually(int object, int instance)
raydium_object_anim_ispunctually_name(char *object, int instance)
raydium_object_anim_name(char *object, int instance, char *anim)
raydium_object_anim_punctually(int object, int anim, int instance)
raydium_object_anim_punctually_name(char *object, char *anim, int instance)
raydium_object_callback(void)
raydium_object_deform (GLuint obj, GLfloat ampl)
raydium_object_deform_name (char *name, GLfloat ampl)
raydium_object_draw (GLuint o)
raydium_object_draw_name (char *name)
raydium_object_find (char *name)
raydium_object_find_axes_max (GLuint obj, GLfloat * tx, GLfloat * ty, GLfloat * tz)
raydium_object_find_center_factors(GLuint obj, GLfloat *tx, GLfloat *ty, GLfloat *tz)
raydium_object_find_dist_max (GLuint obj)
raydium_object_find_load (char *name)
raydium_object_find_minmax(GLuint obj, GLfloat *min, GLfloat *max)
raydium_object_isvalid(int obj)
raydium_object_load (char *filename)
raydium_object_reset (GLuint o)
raydium_object_tangent_smooth(GLuint obj)
raydium_object_tangent_smooth_name(char *obj)
raydium_object_translate(GLuint obj,GLfloat tx,GLfloat ty,GLfloat tz)
raydium_ode_autodisable_get(void)
raydium_ode_autodisable_set(signed char autod)
raydium_ode_callback (void)
raydium_ode_capture_3d(char *filename)
raydium_ode_capture_internal_create(int type, int id, dReal *sizes, char *mesh)
raydium_ode_capture_internal_create_all(void)
raydium_ode_capture_internal_delete(int id)
raydium_ode_capture_internal_read_event(signed char sense)
raydium_ode_capture_internal_read_move(signed char pass)
raydium_ode_capture_play(char *rrp_filename, signed char change_ground)
raydium_ode_capture_play_callback(void)
raydium_ode_capture_play_internal_index_build(void)
raydium_ode_capture_record(char *rrp_filename)
raydium_ode_capture_record_rate(char *rrp_filename, int rate_hz)
raydium_ode_capture_record_stop(void)
raydium_ode_capture_seek(double time)
raydium_ode_capture_seek_rel(double time)
raydium_ode_capture_speed(GLfloat factor)
raydium_ode_capture_stop(void)
raydium_ode_contact_feedback_get(int custom_id)
raydium_ode_contact_feedback_save(int custom_id)
raydium_ode_draw_all(signed char names)
raydium_ode_draw_all_post(void)
raydium_ode_element_OnBlow (int e, void *OnBlow)
raydium_ode_element_OnBlow_name (char *e, void *OnBlow)
raydium_ode_element_OnDelete (int e, void *OnDelete)
raydium_ode_element_OnDelete_name (char *e, void *OnDelete)
raydium_ode_element_RelPointPos (int e, dReal px, dReal py, dReal pz, dReal * res)
raydium_ode_element_RelPointPos_name (char *e, dReal px, dReal py, dReal pz, dReal * res)
raydium_ode_element_aabb_get (int element, dReal * aabb)
raydium_ode_element_aabb_get_name (char *element, dReal * aabb)
raydium_ode_element_addforce (int e, dReal *vect)
raydium_ode_element_addforce_3f (int e, dReal fx, dReal fu, dReal fz)
raydium_ode_element_addforce_name (char *e, dReal * vect)
raydium_ode_element_addforce_name_3f (char *e, dReal vx, dReal vy, dReal vz)
raydium_ode_element_addtorque (int e, dReal * vect)
raydium_ode_element_addtorque_3f(int e, dReal vx, dReal vy, dReal vz)
raydium_ode_element_addtorque_name (char *e, dReal * vect)
raydium_ode_element_addtorque_name_3f (char *e, dReal vx, dReal vy, dReal vz)
raydium_ode_element_angularvelocity_get(int elem)
raydium_ode_element_angularvelocity_get_name(char *elem)
raydium_ode_element_angularvelocity_set (int e,dReal *avel)
raydium_ode_element_angularvelocity_set_3f (int e,dReal avelx,dReal avely,dReal avelz)
raydium_ode_element_angularvelocity_set_name (char * e,dReal *avel)
raydium_ode_element_angularvelocity_set_name_3f (char * e,dReal avelx,dReal avely,dReal avelz)
raydium_ode_element_camera_inboard (int e, dReal px, dReal py, dReal pz, dReal lookx, dReal looky, dReal lookz)
raydium_ode_element_camera_inboard_name (char *name, dReal px, dReal py, dReal pz, dReal lookx, dReal looky, dReal lookz)
raydium_ode_element_data_get (int e)
raydium_ode_element_data_get_name (char *e)
raydium_ode_element_data_set (int e, void *data)
raydium_ode_element_data_set_name (char *e, void *data)
raydium_ode_element_delete (int e, signed char deletejoints)
raydium_ode_element_delete_name (char *name, signed char deletejoints)
raydium_ode_element_disable_get(int elem)
raydium_ode_element_disable_get_name (char *e)
raydium_ode_element_disable_set(int elem, signed char disable_state)
raydium_ode_element_disable_set_name (char *e, signed char disable_state)
raydium_ode_element_find (char *name)
raydium_ode_element_fix (char *name, int *elem, int nelems, signed char keepgeoms)
raydium_ode_element_force_get(int e)
raydium_ode_element_force_get_name(char * elem)
raydium_ode_element_gravity (int e, signed char enable)
raydium_ode_element_gravity_name (char *e, signed char enable)
raydium_ode_element_ground_texture_get (int e)
raydium_ode_element_ground_texture_get_name (char *e)
raydium_ode_element_isvalid (int i)
raydium_ode_element_lensflare_offset(int elem, char *flare_name, char *filename, dReal *offset)
raydium_ode_element_lensflare_offset_name(char *elem, char *flare_name, char *filename, dReal *offset)
raydium_ode_element_lensflare_offset_name_3f(char *elem, char *flare_name, char *filename, dReal offx, dReal offy, dReal offz)
raydium_ode_element_linearvelocity_get (int e)
raydium_ode_element_linearvelocity_get_name(char *e)
raydium_ode_element_linearvelocity_set (int e, dReal *vel)
raydium_ode_element_linearvelocity_set_3f (int e, dReal velx, dReal vely, dReal velz)
raydium_ode_element_linearvelocity_set_name (char * e, dReal *vel)
raydium_ode_element_linearvelocity_set_name_3f(char *e, dReal vx, dReal vy, dReal vz)
raydium_ode_element_mass(int elem, dReal mass)
raydium_ode_element_mass_get(int elem)
raydium_ode_element_mass_get_name(char * elem)
raydium_ode_element_mass_name(char *elem, dReal mass)
raydium_ode_element_mass_set(int elem,dReal mass)
raydium_ode_element_mass_set_name(char *elem, dReal mass)
raydium_ode_element_material (int e, dReal erp, dReal cfm)
raydium_ode_element_material_name (char *name, dReal erp, dReal cfm)
raydium_ode_element_mesh_scale(int elem, float scale_factor)
raydium_ode_element_mesh_scale_name(char *e, float scale_factor)
raydium_ode_element_move (int elem, dReal * pos)
raydium_ode_element_move_3f(int elem, dReal x,dReal y, dReal z)
raydium_ode_element_move_name (char *name, dReal * pos)
raydium_ode_element_move_name_3f (char *name, dReal x, dReal y, dReal z)
raydium_ode_element_moveto (int element, int object, signed char deletejoints)
raydium_ode_element_moveto_name (char *element, char *object, signed char deletejoints)
raydium_ode_element_object_get (int e)
raydium_ode_element_object_get_name (char *e)
raydium_ode_element_particle (int elem, char *filename)
raydium_ode_element_particle_name (char *elem, char *filename)
raydium_ode_element_particle_offset (int elem, char *filename, dReal * offset)
raydium_ode_element_particle_offset_name (char *elem, char *filename, dReal * offset)
raydium_ode_element_particle_offset_name_3f (char *elem, char *filename, dReal ox, dReal oy, dReal oz)
raydium_ode_element_particle_point (int elem, char *filename)
raydium_ode_element_particle_point_name (char *elem, char *filename)
raydium_ode_element_player_angle (int e, dReal angle)
raydium_ode_element_player_angle_name (char *e, dReal angle)
raydium_ode_element_player_get (int e)
raydium_ode_element_player_get_name (char *name)
raydium_ode_element_player_set (int e, signed char isplayer)
raydium_ode_element_player_set_name (char *name, signed char isplayer)
raydium_ode_element_pos_get (int j)
raydium_ode_element_pos_get_name (char *name)
raydium_ode_element_ray_attach(int element, dReal length, dReal dirx, dReal diry, dReal dirz)
raydium_ode_element_ray_attach_name(char *element, dReal length, dReal dirx, dReal diry, dReal dirz)
raydium_ode_element_ray_delete(int element, int ray_id)
raydium_ode_element_ray_delete_name(char *element, int ray_id)
raydium_ode_element_ray_get(int element, int ray_id, raydium_ode_Ray *result)
raydium_ode_element_ray_get_name(char *element, int ray_id, raydium_ode_Ray *result)
raydium_ode_element_ray_pos(int element, int ray_id, dReal *pos)
raydium_ode_element_ray_pos_name(char *element, int ray_id, dReal *pos)
raydium_ode_element_ray_pos_name_3f(char *element, int ray_id, dReal px, dReal py, dReal pz)
raydium_ode_element_ray_set_length(int element, int ray_id, dReal length)
raydium_ode_element_ray_set_length_name(char *element, int ray_id, dReal length)
raydium_ode_element_rel2world(int element,dReal *rel,dReal *world)
raydium_ode_element_rot_get (int e, dReal * rx, dReal * ry, dReal * rz)
raydium_ode_element_rot_get_name (char *e, dReal * rx, dReal * ry, dReal * rz)
raydium_ode_element_rotate (int elem, dReal * rot)
raydium_ode_element_rotate_3f (int elem, dReal rx, dReal ry, dReal rz)
raydium_ode_element_rotate_direction (int elem, signed char Force0OrVel1)
raydium_ode_element_rotate_direction_name (char *e, signed char Force0OrVel1)
raydium_ode_element_rotate_name (char *name, dReal * rot)
raydium_ode_element_rotate_name_3f (char *name, dReal rx, dReal ry, dReal rz)
raydium_ode_element_rotateq (int elem, dReal * rot)
raydium_ode_element_rotateq_name (char *name, dReal * rot)
raydium_ode_element_rotfriction (int e, dReal rotfriction)
raydium_ode_element_rotfriction_name (char *e, dReal rotfriction)
raydium_ode_element_rotq_get (int j, dReal * res)
raydium_ode_element_rotq_get_name (char *name, dReal * res)
raydium_ode_element_slip (int e, dReal slip)
raydium_ode_element_slip_name (char *e, dReal slip)
raydium_ode_element_sound_update (int e, int source)
raydium_ode_element_sound_update_name (char *e, int source)
raydium_ode_element_tag_get (int e)
raydium_ode_element_tag_get_name (char *e)
raydium_ode_element_touched_get (int e)
raydium_ode_element_touched_get_name (char *e)
raydium_ode_element_ttl_set (int e, int ttl)
raydium_ode_element_ttl_set_name (char *e, int ttl)
raydium_ode_element_unfix (int e)
raydium_ode_element_vect2world(int element,dReal *vect,dReal *world)
raydium_ode_element_world2rel(int element,dReal *world,dReal *rel)
raydium_ode_explosion_blow (dReal radius, dReal max_force, dReal * pos)
raydium_ode_explosion_blow_3f (dReal radius, dReal max_force, dReal px, dReal py, dReal pz)
raydium_ode_explosion_blow_rand(dReal radius, dReal max_force, dReal rand_factor, dReal *pos)
raydium_ode_explosion_blow_rand_3f(dReal radius, dReal max_force, dReal rand_factor, dReal px, dReal py, dReal pz)
raydium_ode_explosion_create (char *name, dReal final_radius, dReal propag, dReal * pos)
raydium_ode_explosion_delete (int e)
raydium_ode_explosion_find (char *name)
raydium_ode_explosion_isvalid (int i)
raydium_ode_get_physics_freq(void)
raydium_ode_get_timestep(void)
raydium_ode_gravity(dReal *vect)
raydium_ode_gravity_3f(dReal gx, dReal gy, dReal gz)
raydium_ode_ground_dTriArrayCallback (dGeomID TriMesh, dGeomID RefObject, const int *TriIndices, int TriCount)
raydium_ode_ground_dTriCallback (dGeomID TriMesh, dGeomID RefObject, int TriangleIndex)
raydium_ode_ground_set_name (char *name)
raydium_ode_init (void)
raydium_ode_init_element (int i)
raydium_ode_init_explosion (int e)
raydium_ode_init_joint (int i)
raydium_ode_init_motor (int i)
raydium_ode_init_object (int i)
raydium_ode_internal_particle_genetator_deleted_callback(int gen)
raydium_ode_joint_attach_fixed (char *name, int elem1, int elem2)
raydium_ode_joint_attach_fixed_name (char *name, char *elem1, char *elem2)
raydium_ode_joint_attach_hinge (char *name, int elem1, int elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z)
raydium_ode_joint_attach_hinge2 (char *name, int elem1, int elem2, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z)
raydium_ode_joint_attach_hinge2_name (char *name, char *elem1, char *elem2, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z)
raydium_ode_joint_attach_hinge_name (char *name, char *elem1, char *elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z)
raydium_ode_joint_attach_universal (char *name, int elem1, int elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z)
raydium_ode_joint_attach_universal_name (char *name, char *elem1, char *elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z)
raydium_ode_joint_break (int j)
raydium_ode_joint_break_force (int j, dReal maxforce)
raydium_ode_joint_break_force_name (char *name, dReal maxforce)
raydium_ode_joint_delete (int joint)
raydium_ode_joint_delete_callback (int j, void (*f) (int))
raydium_ode_joint_delete_callback_name (char *name, void (*f) (int))
raydium_ode_joint_delete_name (char *name)
raydium_ode_joint_elements_get (int j, int *e1, int *e2)
raydium_ode_joint_elements_get_name (char *j, int *e1, int *e2)
raydium_ode_joint_find (char *name)
raydium_ode_joint_hinge2_block (int j, signed char block)
raydium_ode_joint_hinge2_block_name (char *name, signed char block)
raydium_ode_joint_hinge2_limits (int j, dReal lo, dReal hi)
raydium_ode_joint_hinge2_limits_name (char *j, dReal lo, dReal hi)
raydium_ode_joint_hinge_limits (int j, dReal lo, dReal hi)
raydium_ode_joint_hinge_limits_name (char *j, dReal lo, dReal hi)
raydium_ode_joint_isvalid (int i)
raydium_ode_joint_suspension (int j, dReal erp, dReal cfm)
raydium_ode_joint_suspension_name (char *j, dReal erp, dReal cfm)
raydium_ode_joint_universal_limits (int j, dReal lo1, dReal hi1, dReal lo2, dReal hi2)
raydium_ode_joint_universal_limits_name (char *j, dReal lo1, dReal hi1, dReal lo2, dReal hi2)
raydium_ode_launcher (int element, int from_element, dReal * rot, dReal force)
raydium_ode_launcher_name (char *element, char *from_element, dReal * rot, dReal force)
raydium_ode_launcher_name_3f (char *element, char *from_element, dReal rx, dReal ry, dReal rz, dReal force)
raydium_ode_launcher_simple (int element, int from_element, dReal * lrot, dReal force)
raydium_ode_launcher_simple_name (char *element, char *from_element, dReal * rot, dReal force)
raydium_ode_launcher_simple_name_3f (char *element, char *from_element, dReal rx, dReal ry, dReal rz, dReal force)
raydium_ode_motor_angle (int j, dReal angle)
raydium_ode_motor_angle_get(int m, int axe)
raydium_ode_motor_angle_get_name(char *name, int axe)
raydium_ode_motor_angle_name (char *motor, dReal angle)
raydium_ode_motor_attach (int motor, int joint, int joint_axe)
raydium_ode_motor_attach_name (char *motor, char *joint, int joint_axe)
raydium_ode_motor_create (char *name, int obj, signed char type)
raydium_ode_motor_delete (int e)
raydium_ode_motor_delete_name (char *name)
raydium_ode_motor_find (char *name)
raydium_ode_motor_gear_change (int m, int gear)
raydium_ode_motor_gear_change_name (char *m, int gear)
raydium_ode_motor_gear_ratio(int m)
raydium_ode_motor_gear_ratio_name(char *m)
raydium_ode_motor_gears_set (int m, dReal * gears, int n_gears)
raydium_ode_motor_gears_set_name (char *m, dReal * gears, int n_gears)
raydium_ode_motor_isvalid (int i)
raydium_ode_motor_power_max (int j, dReal power)
raydium_ode_motor_power_max_name (char *name, dReal power)
raydium_ode_motor_rocket_orientation (int m, dReal rx, dReal ry, dReal rz)
raydium_ode_motor_rocket_orientation_name (char *name, dReal rx, dReal ry, dReal rz)
raydium_ode_motor_rocket_playermovement (int m, signed char isplayermovement)
raydium_ode_motor_rocket_playermovement_name (char *m, signed char isplayermovement)
raydium_ode_motor_rocket_set (int m, int element, dReal x, dReal y, dReal z)
raydium_ode_motor_rocket_set_name (char *motor, char *element, dReal x, dReal y, dReal z)
raydium_ode_motor_speed (int j, dReal force)
raydium_ode_motor_speed_get (int m, int gears)
raydium_ode_motor_speed_get_name (char *name, int gears)
raydium_ode_motor_speed_name (char *name, dReal force)
raydium_ode_motor_update_joints_data_internal (int j)
raydium_ode_mouse_pick(dReal dist,dReal pos[3],dReal *depth)
raydium_ode_name_auto (char *prefix, char *dest)
raydium_ode_near_callback (void *data, dGeomID o1, dGeomID o2)
raydium_ode_network_MaxElementsPerPacket (void)
raydium_ode_network_TimeToSend (void)
raydium_ode_network_apply (raydium_ode_network_Event * ev)
raydium_ode_network_element_delete (int e)
raydium_ode_network_element_distantowner(int elem)
raydium_ode_network_element_distantowner_name(char *elem)
raydium_ode_network_element_isdistant (int elem)
raydium_ode_network_element_isdistant_name (char *elem)
raydium_ode_network_element_new (int e)
raydium_ode_network_element_send (short nelems, int *e)
raydium_ode_network_element_send_all (void)
raydium_ode_network_element_send_iterative (int nelems)
raydium_ode_network_element_send_random (int nelems)
raydium_ode_network_element_trajectory_correct (int elem)
raydium_ode_network_elment_next_local(void)
raydium_ode_network_explosion_event (int type, char *buff)
raydium_ode_network_explosion_send (raydium_ode_network_Explosion * exp)
raydium_ode_network_init (void)
raydium_ode_network_newdel_event (int type, char *buff)
raydium_ode_network_nidwho (int nid)
raydium_ode_network_nidwho_event (int type, char *buff)
raydium_ode_network_read (void)
raydium_ode_object_OnDelete (int o, void *OnDelete)
raydium_ode_object_OnDelete_name (char *o, void *OnDelete)
raydium_ode_object_addforce (int o, dReal *vect)
raydium_ode_object_addforce_3f (int o, dReal vx, dReal vy, dReal vz)
raydium_ode_object_addforce_name (char *o, dReal * vect)
raydium_ode_object_addforce_name_3f (char *o, dReal vx, dReal vy, dReal vz)
raydium_ode_object_box_add (char *name, int group, dReal mass, dReal tx, dReal ty, dReal tz, signed char type, int tag, char *mesh)
raydium_ode_object_capsule_add(char *name, int group, dReal mass, dReal radius, dReal length, signed char type, int tag, char *mesh)
raydium_ode_object_colliding (int o, signed char colliding)
raydium_ode_object_colliding_name (char *o, signed char colliding)
raydium_ode_object_create (char *name)
raydium_ode_object_data_get (int e)
raydium_ode_object_data_get_name (char *e)
raydium_ode_object_data_set (int o, void *data)
raydium_ode_object_data_set_name (char *o, void *data)
raydium_ode_object_delete (int obj)
raydium_ode_object_delete_name (char *name)
raydium_ode_object_find (char *name)
raydium_ode_object_isvalid (int i)
raydium_ode_object_linearvelocity_set (int o, dReal * vect)
raydium_ode_object_linearvelocity_set_name (char *o, dReal * vect)
raydium_ode_object_linearvelocity_set_name_3f (char *o, dReal vx, dReal vy, dReal vz)
raydium_ode_object_move (int obj, dReal * pos)
raydium_ode_object_move_3f (int obj, dReal x, dReal y, dReal z)
raydium_ode_object_move_name (char *name, dReal * pos)
raydium_ode_object_move_name_3f (char *name, dReal x, dReal y, dReal z)
raydium_ode_object_rename (int o, char *newname)
raydium_ode_object_rename_name (char *o, char *newname)
raydium_ode_object_rotate(int obj, dReal *rot)
raydium_ode_object_rotate_name(char *obj, dReal *rot)
raydium_ode_object_rotate_name_3f(char *obj, dReal rx, dReal ry, dReal rz)
raydium_ode_object_rotateq (int obj, dReal * rot)
raydium_ode_object_rotateq_name (char *obj, dReal * rot)
raydium_ode_object_sphere_add (char *name, int group, dReal mass, dReal radius, signed char type, int tag, char *mesh)
raydium_ode_orphans_check(void)
raydium_ode_record_play_ghost(signed char ghost)
raydium_ode_set_physics_freq (GLfloat freq)
raydium_ode_set_timestep(GLfloat tstep)
raydium_ode_time_change (GLfloat perc)
raydium_osd_alpha_change (GLfloat a)
raydium_osd_color_change (GLfloat r, GLfloat g, GLfloat b)
raydium_osd_color_ega (char hexa)
raydium_osd_color_rgba (GLfloat r, GLfloat g, GLfloat b, GLfloat a)
raydium_osd_cursor_draw (void)
raydium_osd_cursor_offset(GLfloat xoffset, GLfloat yoffset)
raydium_osd_cursor_set (char *texture, GLfloat xsize, GLfloat ysize)
raydium_osd_draw (int tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
raydium_osd_draw_name (char *tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
raydium_osd_draw_quad(int tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, GLfloat angle)
raydium_osd_draw_quad_name(char *tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, GLfloat angle)
raydium_osd_fade_callback (void)
raydium_osd_fade_from (GLfloat * from4, GLfloat * to4, GLfloat time_len, void *OnFadeEnd)
raydium_osd_fade_init (void)
raydium_osd_internal_vertex (GLfloat x, GLfloat y, GLfloat top)
raydium_osd_logo (char *texture)
raydium_osd_mask (GLfloat * color4)
raydium_osd_mask_texture(int texture,GLfloat alpha)
raydium_osd_mask_texture_clip(int texture,GLfloat alpha, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
raydium_osd_mask_texture_clip_name(char *texture,GLfloat alpha, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
raydium_osd_mask_texture_name(char *texture,GLfloat alpha)
raydium_osd_network_stat_draw (GLfloat px, GLfloat py, GLfloat size)
raydium_osd_printf (GLfloat x, GLfloat y, GLfloat size, GLfloat spacer, char *texture, char *format, ...)
raydium_osd_printf_3D (GLfloat x, GLfloat y, GLfloat z, GLfloat size, GLfloat spacer, char *texture, char *format, ...)
raydium_osd_start (void)
raydium_osd_stop (void)
raydium_parser_cut(char *str, char *part1, char *part2, char separator)
raydium_parser_db_get(char *key, char *value, char *def)
raydium_parser_db_set(char *key, char *value)
raydium_parser_isdata(char *str)
raydium_parser_read(char *var, char *val_s, GLfloat *val_f, int *size, FILE *fp)
raydium_parser_remove(char *str, char what)
raydium_parser_replace(char *str, char what, char with)
raydium_parser_trim(char *org)
raydium_parser_trim_right(char *org)
raydium_particle_callback (void)
raydium_particle_draw (raydium_particle_Particle * p, GLfloat ux, GLfloat uy, GLfloat uz, GLfloat rx, GLfloat ry, GLfloat rz)
raydium_particle_draw_all (void)
raydium_particle_find_free (void)
raydium_particle_generator_delete (int gen)
raydium_particle_generator_delete_name (char *gen)
raydium_particle_generator_enable (int gen, signed char enabled)
raydium_particle_generator_enable_name (char *gen, signed char enable)
raydium_particle_generator_find (char *name)
raydium_particle_generator_isvalid (int g)
raydium_particle_generator_load (char *filename, char *name)
raydium_particle_generator_load_internal (int generator, FILE * fp, char *filename)
raydium_particle_generator_move (int gen, GLfloat * pos)
raydium_particle_generator_move_name (char *gen, GLfloat * pos)
raydium_particle_generator_move_name_3f (char *gen, GLfloat x, GLfloat y, GLfloat z)
raydium_particle_generator_particles_OnDelete (int gen, void *OnDelete)
raydium_particle_generator_particles_OnDelete_name (char *gen, void *OnDelete)
raydium_particle_generator_update (int g, GLfloat step)
raydium_particle_init (void)
raydium_particle_name_auto (char *prefix, char *dest)
raydium_particle_preload (char *filename)
raydium_particle_scale_all(GLfloat scale)
raydium_particle_state_dump(char *filename)
raydium_particle_state_restore(char *filename)
raydium_particle_update (int part, GLfloat step)
raydium_path_add(char *dir)
raydium_path_add_priority(char *dir, int priority)
raydium_path_dump(void)
raydium_path_ext(char *dir, char *ext)
raydium_path_ext_priority(char *dir,char *ext,int priority)
raydium_path_find(char *pathfolder)
raydium_path_find_free(void)
raydium_path_init(void)
raydium_path_package_cache_clear(void)
raydium_path_package_find(char *name)
raydium_path_package_find_free(void)
raydium_path_package_internal_add(char * file)
raydium_path_package_mode(char * name,unsigned char mode)
raydium_path_package_register(char *file)
raydium_path_reset(void)
raydium_path_resolv(char *in, char *out, char mode)
raydium_path_string_from(char *str)
raydium_path_string_to(char *out)
raydium_path_write(char *dir)
raydium_path_write_local_deny(signed char deny)
raydium_php_exec (char *name)
raydium_php_rayphp_path_change(char *path)
raydium_profile_end(char *tag)
raydium_profile_start(void)
raydium_random_0_x (GLfloat i)
raydium_random_f (GLfloat min, GLfloat max)
raydium_random_i (int min, int max)
raydium_random_neg_pos_1 (void)
raydium_random_pos_1 (void)
raydium_random_proba (GLfloat proba)
raydium_random_randomize (void)
raydium_rayphp_http_test(void)
raydium_rayphp_repository_defaults(char *def)
raydium_rayphp_repository_file_get (char *path)
raydium_rayphp_repository_file_list(char *filter)
raydium_rayphp_repository_file_put (char *path, int depends)
raydium_rayphp_zip_add(char * zip_file, char * full_file_name,char * file_name)
raydium_rayphp_zip_extract(char *file, char *to)
raydium_register_api(void)
raydium_register_dump (void)
raydium_register_find_name (char *name)
raydium_register_function (void *addr, char *name)
raydium_register_modifiy (char *var, char *args)
raydium_register_name_isvalid (char *name)
raydium_register_variable (void *addr, int type, char *name)
raydium_register_variable_const_f(float val, char *name)
raydium_register_variable_const_i(int val, char *name)
raydium_register_variable_unregister_last (void)
raydium_render_fps_limit(float maxfps)
raydium_render_lightmap_color(GLfloat *color)
raydium_render_lightmap_color_4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
raydium_rendering (void)
raydium_rendering_displaylists_disable(void)
raydium_rendering_displaylists_enable(void)
raydium_rendering_finish (void)
raydium_rendering_from_to (GLuint from, GLuint to)
raydium_rendering_from_to_simple(GLuint from, GLuint to)
raydium_rendering_internal_prepare_texture_render (GLuint tex)
raydium_rendering_internal_restore_render_state (void)
raydium_rendering_normal (void)
raydium_rendering_prepare_texture_unit (GLenum tu, GLuint tex)
raydium_rendering_rgb_force (GLfloat r, GLfloat g, GLfloat b)
raydium_rendering_rgb_normal (void)
raydium_rendering_wireframe (void)
raydium_server_accept_new (struct sockaddr *from, char *name)
raydium_shader_attach_texture(int shader, int texture)
raydium_shader_attach_texture_name(char *shader, char *texture)
raydium_shader_current(int shader)
raydium_shader_current_name(char *shader)
raydium_shader_find(char *name)
raydium_shader_infolog(GLhandleARB shader)
raydium_shader_init(void)
raydium_shader_internal_vertex_attributes(int i)
raydium_shader_isvalid(int shader)
raydium_shader_load(char *name, char *file_vert, char *file_frag)
raydium_shader_var_2f(int var_id, float value1, float value2)
raydium_shader_var_2f_name(char *shader, char *variable, float value1, float value2)
raydium_shader_var_3f(int var_id, float value1, float value2, float value3)
raydium_shader_var_3f_name(char *shader, char *variable, float value1, float value2, float value3)
raydium_shader_var_4f(int var_id, float value1, float value2, float value3, float value4)
raydium_shader_var_4f_name(char *shader, char *variable, float value1, float value2, float value3, float value4)
raydium_shader_var_f(int var_id, float value)
raydium_shader_var_f_name(char *shader, char *variable, float value)
raydium_shader_var_fv(int var_id, int num, float value[])
raydium_shader_var_fv_name(char *shader, char *variable, int num, float value[])
raydium_shader_var_i(int var_id, int value)
raydium_shader_var_i_name(char *shader, char *variable, int value)
raydium_shader_variable(int shader, char *name)
raydium_shadow_camerabox_size(GLfloat size)
raydium_shadow_disable(void)
raydium_shadow_enable(void)
raydium_shadow_ground_change(int object)
raydium_shadow_init(void)
raydium_shadow_isenabled(void)
raydium_shadow_light_main(GLuint l)
raydium_shadow_map_generate(void)
raydium_shadow_map_render(void)
raydium_shadow_mode(char mode)
raydium_shadow_object_draw(GLuint o)
raydium_sky_atmosphere_check(void)
raydium_sky_atmosphere_disable(void)
raydium_sky_atmosphere_enable(void)
raydium_sky_atmosphere_render(GLfloat x, GLfloat y, GLfloat z,int detail)
raydium_sky_box_cache (void)
raydium_sky_box_name(char *name)
raydium_sky_box_render (GLfloat x, GLfloat y, GLfloat z)
raydium_sky_check(void)
raydium_sky_disable(void)
raydium_sky_enable(void)
raydium_sky_sphere_render(GLfloat x, GLfloat y, GLfloat z, int detail)
raydium_sound_Array3IsValid(ALfloat *a)
raydium_sound_GetListenerOr (ALfloat * Or[])
raydium_sound_GetListenerPos (ALfloat * Pos[])
raydium_sound_GetListenerVel (ALfloat * Vel[])
raydium_sound_GetSourceDir (int src, ALfloat * Dir[])
raydium_sound_GetSourceGain (int src, ALfloat * g)
raydium_sound_GetSourcePitch (int src, ALfloat * p)
raydium_sound_GetSourcePos (int src, ALfloat * Pos[])
raydium_sound_GetSourceVel (int src, ALfloat * Vel[])
raydium_sound_InitSource (int src)
raydium_sound_IsPlaying(int src)
raydium_sound_LoadWav (const char *fname)
raydium_sound_SetListenerOr (ALfloat Or[])
raydium_sound_SetListenerPos (ALfloat Pos[])
raydium_sound_SetListenerVel (ALfloat Vel[])
raydium_sound_SetSourceDir (int src, ALfloat Dir[])
raydium_sound_SetSourceGain (int src, ALfloat g)
raydium_sound_SetSourceLoop (int src, signed char loop)
raydium_sound_SetSourcePitch (int src, ALfloat p)
raydium_sound_SetSourcePos (int src, ALfloat Pos[])
raydium_sound_SetSourcePosCamera(int src)
raydium_sound_SetSourceRefDist(int src, ALfloat distance)
raydium_sound_SetSourceVel (int src, ALfloat Vel[])
raydium_sound_SourcePause (int src)
raydium_sound_SourcePlay (int src)
raydium_sound_SourceStop (int src)
raydium_sound_SourceUnpause (int src)
raydium_sound_SourceVerify (int src)
raydium_sound_callback (void)
raydium_sound_close (void)
raydium_sound_init (void)
raydium_sound_load_music (char *fname)
raydium_sound_music_callback (void)
raydium_sound_music_info_init(void)
raydium_sound_music_info_refresh(void)
raydium_sound_source_fade(int src, ALfloat len)
raydium_sound_source_fade_to(int src, ALfloat len, char *to)
raydium_sound_verify (char *caller)
raydium_sprite_billboard(float x, float y, float z,float ux, float uy, float uz, float rx, float ry, float rz, int textureid, float s0, float s1, float t0, float t1,float size)
raydium_sprite_change_sprite_time(int id,float time)
raydium_sprite_change_sprite_time_relative(int id,float time)
raydium_sprite_check_available(void)
raydium_sprite_display(int id)
raydium_sprite_dump_info(int id)
raydium_sprite_find(char *name)
raydium_sprite_free(int sprite)
raydium_sprite_free_name(char *name)
raydium_sprite_get_current_frame(int id)
raydium_sprite_get_current_group(int id)
raydium_sprite_get_id_from_element(int element)
raydium_sprite_get_name_from_object(int obj)
raydium_sprite_get_pos(int number)
raydium_sprite_group_change(int sprite,int group)
raydium_sprite_is_stopped(int id)
raydium_sprite_move(int sprite,float x, float y, float z)
raydium_sprite_move_relative(int sprite, float deltax, float deltay, float deltaz)
raydium_sprite_object_get(int spriteid)
raydium_sprite_set_name(int id,char *cadena)
raydium_sprite_set_type(int id,int value)
raydium_texture_compression(signed char enable)
raydium_texture_current_set (GLuint current)
raydium_texture_current_set_name (char *name)
raydium_texture_exists(char *name)
raydium_texture_filter_change (GLuint filter)
raydium_texture_find_by_name (char *name)
raydium_texture_free(int number)
raydium_texture_free_name(char *name)
raydium_texture_get_next_free_slot_internal(void)
raydium_texture_is_slot_used(int slot)
raydium_texture_load (char *filename)
raydium_texture_load_erase (char *filename, GLuint to_replace)
raydium_texture_load_internal(char *filename, char *as, signed char faked, int faked_tx, int faked_ty, int faked_bpp, int or_live_id_fake)
raydium_texture_npot_disable(void)
raydium_texture_npot_enable(void)
raydium_texture_size_is_correct (GLuint size)
raydium_timecall_add (void *funct, GLint hz)
raydium_timecall_callback (void)
raydium_timecall_clock (void)
raydium_timecall_detect_frequency (void)
raydium_timecall_devrtc_clock (void)
raydium_timecall_devrtc_close (void)
raydium_timecall_devrtc_init (void)
raydium_timecall_devrtc_rate_change (unsigned long new_rate)
raydium_timecall_freq_change (int callback, GLint hz)
raydium_timecall_init (void)
raydium_timecall_internal_w32_detect_modulo(int div)
raydium_timecall_internal_w32_divmodulo_find(void)
raydium_timecall_raydium (GLfloat step)
raydium_version(void)
raydium_vertex_add (GLfloat x, GLfloat y, GLfloat z)
raydium_vertex_uv_add (GLfloat x, GLfloat y, GLfloat z, GLfloat u, GLfloat v)
raydium_vertex_uv_normals_add (GLfloat x, GLfloat y, GLfloat z, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat u, GLfloat v)
raydium_video_callback(void)
raydium_video_callback_video(int id)
raydium_video_delete(int id)
raydium_video_delete_name(char *name)
raydium_video_duration(int id)
raydium_video_duration_name(char *name)
raydium_video_elapsed(int id)
raydium_video_elapsed_name(char *name)
raydium_video_find(char *name)
raydium_video_find_free(void)
raydium_video_fps_change(int id, float fps)
raydium_video_fps_change_name(char *name, float fps)
raydium_video_init(void)
raydium_video_isplaying(int id)
raydium_video_isplaying_name(char *name)
raydium_video_isvalid(int i)
raydium_video_jpeg_decompress(FILE *fp,unsigned char *to)
raydium_video_loop(int id, signed char loop)
raydium_video_loop_name(char *name, signed char loop)
raydium_video_open(char *filename, char *as)
raydium_video_open_with_sound(char *filename, char *as, char *ogg)
raydium_video_seek(int id, float time)
raydium_video_seek_name(char *name, float time)
raydium_video_seek_rel(int id, float time)
raydium_video_seek_rel_name(char *name, float time)
raydium_video_sound_callback(void)
raydium_viewport_create (char * name,int tx,int ty)
raydium_viewport_draw(char * name, GLfloat tx,GLfloat ty,GLfloat sx,GLfloat sy)
raydium_viewport_enable(char * name)
raydium_viewport_init(void)
raydium_viewport_save(void)
raydium_web_answer(char *message, int fd)
raydium_web_callback(void)
raydium_web_client_get(char *filename)
raydium_web_extension_add(char *ext, char *mime, void *handler)
raydium_web_init(void)
raydium_web_request(int fd)
raydium_web_start(char *title)
raydium_window_close (void)
raydium_window_create (GLuint tx, GLuint ty, signed char rendering, char *name)
raydium_window_resize_callback (GLsizei Width, GLsizei Height)
raydium_window_view_perspective(GLfloat fov, GLfloat fnear, GLfloat ffar)
raydium_window_view_update (void)
unsupported - int read_vertex_from (char *filename)
unsupported - int v4l_yuv420p2rgb (unsigned char *rgb_out, unsigned char *yuv_in, int width, int height, int bits)
unsupported - void dump_vertex_to (char *filename)
unsupported - void dump_vertex_to_alpha (char *filename)
unsupported - void sprite_render_frame(float x, float y, float z, int spriteid,int frame,float scalex,float scaley)
unsupported - void v4l_copy_420_block (int yTL, int yTR, int yBL, int yBR, int u, int v, int rowPixels, unsigned char *rgb, int bits)