#include "image.h"
#include "base_image.h"
#include "solid_gl.h"
+#include "solid_all.h"
#include "base_config.h"
#include "lang.h"
static void sol_draw_list(const struct s_file *fp,
const struct s_body *bp, GLuint list)
{
- float p[3];
+ float p[3], e[4], u[3], a;
- sol_body_p(p, fp, bp);
+ sol_body_p(p, fp, bp->pi, bp->t);
+ sol_body_e(e, fp, bp, 0);
+
+ q_as_axisangle(e, u, &a);
+ a = V_DEG(a);
glPushMatrix();
{
- /* Translate a moving body. */
+ /* Translate and rotate a moving body. */
glTranslatef(p[0], p[1], p[2]);
+ glRotatef(a, u[0], u[1], u[2]);
/* Draw the body. */
static void sol_shad_list(const struct s_file *fp,
const struct s_body *bp, GLuint list)
{
- float p[3];
+ float p[3], e[4], u[3], a;
+
+ sol_body_p(p, fp, bp->pi, bp->t);
+ sol_body_e(e, fp, bp, 0);
- sol_body_p(p, fp, bp);
+ q_as_axisangle(e, u, &a);
+ a = V_DEG(a);
glPushMatrix();
{
- /* Translate a moving body. */
+ /* Translate and rotate a moving body. */
glTranslatef(p[0], p[1], p[2]);
+ glRotatef(a, u[0], u[1], u[2]);
/* Translate the shadow on a moving body. */
{
glPushMatrix();
glTranslatef(p[0], p[2], 0.0f);
+ glRotatef(-a, u[0], u[2], u[1]);
}
glMatrixMode(GL_MODELVIEW);
return 0;
}
-static void sol_load_textures(struct s_file *fp, int k)
+static void sol_load_textures(struct s_file *fp)
{
int i;
/*---------------------------------------------------------------------------*/
-int sol_load_gl(struct s_file *fp, const char *filename, int k, int s)
+int sol_load_gl(struct s_file *fp, const char *filename, int s)
{
if (sol_load_only_file(fp, filename))
{
- sol_load_textures(fp, k);
+ sol_load_textures(fp);
sol_load_objects (fp, s);
return 1;
}