public void Update(float deltaTime) { cam.UpdateViewMatrix(); ProjectionMatrix = cam.GetProjectionMatrix(); ViewMatrix = cam.GetViewMatrix(); m.UpdateExportedAnimation(); }
public void Update(float deltaTime) { cam.UpdateViewMatrix(); Gl.glUniform3fv(camposID, 1, cam.GetCameraPosition().to_array()); ProjectionMatrix = cam.GetProjectionMatrix(); ViewMatrix = cam.GetViewMatrix(); m.UpdateExportedAnimation(); enemy2.UpdateExportedAnimation(); }
public void Update() { camera.UpdateViewMatrix(); nextFire += (float)(DateTime.Now - now).TotalSeconds; now = DateTime.Now; if (health <= 0) { dead = true; } //healthBar.Update(mPosition); //model.UpdateExportedAnimation(); }
public void Update(float deltaTime) { camera.UpdateViewMatrix(); ProjectionMatrix = camera.GetProjectionMatrix(); ViewMatrix = camera.GetViewMatrix(); SendLightData(r, g, b, 100, 20); /*if (Daylight) * { * r -= (float)0.0002; * g -= (float)0.0002; * b -= (float)0.0002; * if( r <= 0.1) * { * Daylight = false; * NightLight = true; * } * } * else if (NightLight) * { * r += (float)0.0002; * g += (float)0.0002; * b += (float)0.0002; * if (r >= 1) * { * Daylight = true; * NightLight = false; * } * }*/ if (reverse) { t -= 0.0002f; } else { t += 0.0002f; } if (t > 0.2f) { reverse = true; } if (t < 0) { reverse = false; } Gl.glUniform1f(WaterTimeID, t); }
public void Update(float deltaTime) { cam.UpdateViewMatrix(); ProjectionMatrix = cam.GetProjectionMatrix(); ViewMatrix = cam.GetViewMatrix(); zombie.UpdateAnimation(); Blade.UpdateAnimation(); for (int i = 0; i < bullets.Count; i++) { bullets[i].Update(); if (bullets[i].shouldBeDestroyed()) { bullets.RemoveAt(i); } } }
public void Update() { //update view and projection matrix cam.UpdateViewMatrix(); ViewMatrix = cam.GetViewMatrix(); ProjectionMatrix = cam.GetProjectionMatrix(); //Keyframes if (GraphicsForm.runAnimation == true) { int startKeyFrame = GraphicsForm.startFrame; int endKeyFrame = GraphicsForm.endFrame;// startKeyFrame + 1; time = startKeyFrame; interpolatedList = new List <float>(); time += speed; time %= endKeyFrame; float alpha = (time - startKeyFrame) / (endKeyFrame - startKeyFrame); //to fill the main keyframes list just one time if (initialzeList == 1) { foreach (KeyFrame keyFrame in GraphicsForm.vertexKeyFramesDict.Values) { tempKeyFrameList = new List <float>(); foreach (List <float> l in keyFrame.verticesDict.Values) { tempKeyFrameList.AddRange(l); } int numOfFrames = keyFrame.numOfInterpolatedFrames; Tuple <int, List <float> > t = new Tuple <int, List <float> >(numOfFrames, tempKeyFrameList); mainKeyFrameList.Add(t); } initialzeList = 0; } //to fill the interpolated list with the start, interpolated, end frames for (int i = startKeyFrame; i < endKeyFrame; i++) { //ba7ot al start bta3e ele howa(0,0,0...) interpolatedList.AddRange(mainKeyFrameList[i].Item2); int count = mainKeyFrameList[i].Item2.Count; //Item1: num of required interpolated frames for (int j = 0; j < mainKeyFrameList[i + 1].Item1; j++) { int indx = 0; for (; indx < mainKeyFrameList[i + 1].Item2.Count; indx++) { float interpolatedValue = (alpha * (mainKeyFrameList[i + 1].Item2[indx] - mainKeyFrameList[i].Item2[indx])) + mainKeyFrameList[i].Item2[indx]; interpolatedList.Add(interpolatedValue); } time += speed; time %= endKeyFrame; alpha = (time - startKeyFrame) / (endKeyFrame - startKeyFrame); } } interpolatedList.AddRange(mainKeyFrameList[endKeyFrame].Item2); } }