Merge pull request #92 from Ventrella/master

removed init values in HandMotion structure
This commit is contained in:
ZappoMan 2013-04-18 21:33:16 -07:00
commit a434f26939

View file

@ -174,27 +174,43 @@ int mouseY = 0;
// Mouse location at start of last down click // Mouse location at start of last down click
int mousePressed = 0; // true if mouse has been pressed (clear when finished) int mousePressed = 0; // true if mouse has been pressed (clear when finished)
Menu menu; // main menu Menu menu; // main menu
int menuOn = 1; // Whether to show onscreen menu int menuOn = 1; // Whether to show onscreen menu
struct HandMovement struct HandMovement
{ {
bool enabled = false; bool enabled;
int startX = WIDTH / 2; int startX;
int startY = HEIGHT / 2; int startY;
int x = 0; int x;
int y = 0; int y;
int lastX = 0; int lastX;
int lastY = 0; int lastY;
int velocityX = 0; int velocityX;
int velocityY = 0; int velocityY;
float rampUpRate = 0.05; float rampUpRate;
float rampDownRate = 0.02; float rampDownRate;
float envelope = 0.0f; float envelope;
}; };
HandMovement handMovement; HandMovement handMovement;
void initializeHandMovement() {
handMovement.enabled = false;
handMovement.startX = WIDTH / 2;
handMovement.startY = HEIGHT / 2;
handMovement.x = 0;
handMovement.y = 0;
handMovement.lastX = 0;
handMovement.lastY = 0;
handMovement.velocityX = 0;
handMovement.velocityY = 0;
handMovement.rampUpRate = 0.05;
handMovement.rampDownRate = 0.02;
handMovement.envelope = 0.0f;
}
void updateHandMovement( int x, int y ) { void updateHandMovement( int x, int y ) {
handMovement.lastX = handMovement.x; handMovement.lastX = handMovement.x;
handMovement.lastY = handMovement.y; handMovement.lastY = handMovement.y;
@ -361,6 +377,8 @@ void init(void)
voxels.init(); voxels.init();
voxels.setViewerHead(&myAvatar); voxels.setViewerHead(&myAvatar);
myAvatar.setRenderYaw(startYaw); myAvatar.setRenderYaw(startYaw);
initializeHandMovement();
headMouseX = WIDTH/2; headMouseX = WIDTH/2;
headMouseY = HEIGHT/2; headMouseY = HEIGHT/2;