Changeset 13478 for branches/HeuristicLab.BinPacking
- Timestamp:
- 12/17/15 20:06:23 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/PackingPlanVisualizations/3D/PackingGame.cs
r13465 r13478 21 21 22 22 using System; 23 using System.Drawing.Printing; 23 24 using SharpDX; 24 25 using SharpDX.Direct3D11; … … 198 199 199 200 worldMatrix = 200 Matrix.RotationY(MathUtil.DegreesToRadians(-currentViewAngle.X / 4)) *201 Matrix.RotationX(MathUtil.DegreesToRadians(currentViewAngle.Y / 4));201 Matrix.RotationY(MathUtil.DegreesToRadians(-currentViewAngle.X * control.Width / 4)) * 202 Matrix.RotationX(MathUtil.DegreesToRadians(currentViewAngle.Y * control.Height / 4)); 202 203 basicEffect.World = worldMatrix; 203 204 … … 231 232 } 232 233 233 234 235 236 237 238 234 protected override void Update(GameTime gameTime) { 239 235 computeMouseHandling(); … … 255 251 } 256 252 private void computeLeftMouseBtnHandling(MouseState mouseState) { 257 //Left btn released258 //if (mouseState.LeftButton.Released && mouseState.LeftButton.Equals(previousMouseState.LeftButton)) {259 // //Console.WriteLine("Released");260 //} else261 262 253 //Left btn pressed 263 264 if (mouseState.LeftButton.Pressed && mouseState.LeftButton.Equals(previousMouseState.LeftButton)) { 254 if (mouseState.LeftButton.Down && (previousMouseState.LeftButton.Pressed || previousMouseState.LeftButton.Down)) { 265 255 currentViewAngle = new Vector2( 266 256 viewAngleOnBtnRelease.X + mouseState.X - mousePositionOnBtnDown.X, 267 257 viewAngleOnBtnRelease.Y + mouseState.Y - mousePositionOnBtnDown.Y); 268 269 258 } 270 259 271 260 //Left btn freshly pressed ==> ONLICK-EVENT 272 else if (mouseState.LeftButton.Pressed && !previousMouseState.LeftButton.Pressed) { 273 //Console.WriteLine("OnClick"); 274 //PackingPlan3D native = (PackingPlan3D)Window.NativeWindow; 275 //Console.WriteLine("Window: " + Window.ClientBounds.ToString()); 276 //Console.WriteLine("native: " + native.ClientSize.ToString()); 277 //Console.WriteLine("native.parent: " + native.Parent.ClientSize.ToString()); 278 // 279 //Console.WriteLine(native.ParentForm.ToString()); 280 //Console.WriteLine(Window.Name); 281 //Console.WriteLine(this.IsActive); 261 else if (mouseState.LeftButton.Pressed && !(previousMouseState.LeftButton.Pressed || previousMouseState.LeftButton.Down)) { 282 262 mousePositionOnBtnDown = new Vector2(mouseState.X, mouseState.Y); 283 263 } … … 285 265 //Left btn freshly released ==> ONRELEASE-EVENT 286 266 else if (mouseState.LeftButton.Released && !previousMouseState.LeftButton.Released) { 287 //Console.WriteLine("OnRelease");288 267 viewAngleOnBtnRelease = currentViewAngle; 289 268 } 290 269 } 291 270 private void computeMouseWheelHandling(MouseState mouseState) { 292 int prev = previousMouseState.WheelDelta;293 271 int curr = mouseState.WheelDelta; 294 if (curr < prev&& zoom > 1) {272 if (curr < 0 && zoom > 1) { 295 273 zoom++; 296 //Console.WriteLine(zoom); 297 } else if (curr > prev && zoom < 300) { 274 } else if (curr > 0 && zoom < 300) { 298 275 zoom--; 299 //Console.WriteLine(zoom);300 276 } 301 277 }
Note: See TracChangeset
for help on using the changeset viewer.