- // Bonus.cpp: implementation of the Bonus class. 
- // 
- ////////////////////////////////////////////////////////////////////// 
-   
- #include "Bonus.h" 
- #include <GL/glut.h> 
- #include <stdlib.h> 
- ////////////////////////////////////////////////////////////////////// 
- // Construction/Destruction 
- ////////////////////////////////////////////////////////////////////// 
-   
- Bonus::Bonus() 
- { 
- 	//movimiento gravitatorio 
- 	//velocidad vertical inicial 
- 	aceleracion.y=-9.8; 
- 	velocidad.y=5; 
- 	lado=0.5f; 
- } 
-   
- Bonus::~Bonus() 
- { 
-   
- } 
-   
- void Bonus::Dibuja() 
- { 
- 	glPushMatrix(); 
- 	glTranslatef(posicion.x,posicion.y,0); 
- 	glRotatef(30,1,1,1); 
- 	glColor3f(	rand()/(float)RAND_MAX, 
- 			rand()/(float)RAND_MAX, 
- 			rand()/(float)RAND_MAX);//color aleatorio 
-     	glutSolidCube(lado); 
- 	glPopMatrix(); 
- } 
-   
- void Bonus::Mueve(float t) 
- { 
- 	posicion=posicion + velocidad*t + aceleracion*(0.5f*t*t); 
- 	velocidad=velocidad+aceleracion*t; 
- } 
-   
- void Bonus::SetPos(float ix, float iy) 
- { 
- posicion.x=ix; 
- posicion.y=iy; 
- } 
-   
-   
-   
- #if _MSC_VER > 1000 
- #pragma once 
- #endif // _MSC_VER > 1000 
-   
- #include "Vector2D.h"	// Added by ClassView 
-   
- class Bonus   
- { 
- public: 
- 	void SetPos(float ix,float iy); 
- 	Bonus(); 
- 	virtual ~Bonus(); 
-   
- 	void Mueve(float t); 
- 	void Dibuja(); 
- private:	 
- 	float lado; 
- 	Vector2D posicion; 
- 	Vector2D velocidad; 
- 	Vector2D aceleracion; 
- }; 
-   
- #endif // !defined(AFX_BONUS_H__0EE7EF41_0205_4320_8F97_4AFEB50418B8__INCLUDED_) 
-   
-   
- // Vector2D.cpp: implementation of the Vector2D class. 
- // 
- ////////////////////////////////////////////////////////////////////// 
-   
- #include "Vector2D.h" 
- #include <math.h> 
- ////////////////////////////////////////////////////////////////////// 
- // Construction/Destruction 
- ////////////////////////////////////////////////////////////////////// 
-   
- Vector2D::Vector2D(float xv,float yv) 
- { 
- 	x=xv; 
- 	y=yv; 
- } 
-   
- Vector2D::~Vector2D() 
- { 
-   
- } 
- float Vector2D::modulo() 
- { 
- 	return (float)sqrt(x*x+y*y); 
- } 
- float Vector2D::argumento() 
- { 
- 	return (float)atan2(y,x); 
- }	 
-   
- Vector2D Vector2D::operator - (Vector2D &v) 
- { 
- 	Vector2D res; 
- 	res.x=x-v.x; 
- 	res.y=y-v.y; 
- 	return res; 
- } 
- Vector2D Vector2D::operator + (Vector2D &v) 
- { 
- 	Vector2D res; 
- 	res.x=x+v.x; 
- 	res.y=y+v.y; 
- 	return res; 
- } 
- float Vector2D::operator *(Vector2D &v)	 
- { 
- 	return x*v.x+y*v.y; 
- } 
- Vector2D Vector2D::operator *(float f) 
- { 
- 	Vector2D res; 
- 	res.x=x*f; 
- 	res.y=y*f; 
- 	return res; 
- } 
- Vector2D Vector2D::Unitario() 
- { 
- 	Vector2D retorno(x,y); 
- 	float mod=modulo(); 
- 	if(mod>0.00001) 
- 	{ 
- 		retorno.x/=mod; 
- 		retorno.y/=mod; 
- 	} 
- 	return retorno; 
- } 
-   
-   
- #if _MSC_VER > 1000 
- #pragma once 
- #endif // _MSC_VER > 1000 
-   
- class Vector2D   
- { 
- public: //atributos 
- 	float x; 
- 	float y; 
- public: //métodos 
- 	Vector2D(float xv=0.0f,float yv=0.0f); 
- 	virtual ~Vector2D(); 
-   
- 	float modulo();					 //modulo del vector 
- 	float argumento();				 //argumento del vector 
- 	Vector2D Unitario();			 //devuelve un vector unitario 
- 	Vector2D operator - (Vector2D &);//resta de vectores 
- 	Vector2D operator + (Vector2D &);//suma de vectores 
- 	float operator *(Vector2D &);	 //producto escalar 
- 	Vector2D operator *(float);		 //producto por un escalar 
- }; 
-   
- #endif // !defined(AFX_VECTOR2D_H__86ED85F9_9ED7_4672_9273_C1BB38271909__INCLUDED_) 
-   
-   
el error me sale aca void Bonus::Mueve(float t)
Leo no te puedo pasar los archivos a tu corre a ver si me das una mano o por aka numas tu diras .................