Search Results

Search found 3988 results on 160 pages for 'collision resolution'.

Page 12/160 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Ubuntu can't identify correct resolution

    - by Kushal
    I had a Dell monitor and now I have an AOC monitor. The last time these worked without any Xrandr tweaking were with Ubuntu 10.10. Since 11.04, the max resolution that I can use on these is 1024x768. I know for a fact that the correct resolution on this monitor should be 1360x768. Even with Precise beta 2, this problem persists. I know I can fix it using Xrandr, but I want to understand how to get Ubuntu to identify the correct possible resolutions the way it did two years ago. Can someone help me? Thanks in advance for all your help.

    Read the article

  • Only one resolution available in Xorg.conf

    - by Kévin Guilbeault
    I recently upgraded to Ubuntu 12.10 and when I try to change my resolution in NVIDIA X server settings, I only get the native one (1600x900). When I had 12.04 installed, all resolutions were available in the drop down list. My goal is to have twinview working again. I used to set my two screens to twinview and clones, using my HDTV resolution (1360x768) which was previously available in 12.04 for my laptop screen too. In 12.10, I tried to install all of the NVIDIA drivers available except the nouveau driver. I tried to add a new mode using Xrandr --newmode / --addmode, but it didn't work; it coudn't detect my output. I'd like to know if this is a known bug and if there's something to do with that. Thanks!

    Read the article

  • ubuntu 11, maximum resolution is a low 1024 x 768

    - by djturbojp7
    I just installed ubuntu 11 and the maximum resolution that it will let me set it at is 1024 x 768. My graphics are onboard, its the intel 82845g. Trying to increase the resolution and support the video more smoothly. UPDATE: user1@pc1:~$ xrandr | grep maximum Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2048 x 2048 user1@pc1:~$ gtf 1280 1024 59.9 # 1280x1024 @ 59.90 Hz (GTF) hsync: 63.49 kHz; pclk: 108.70 MHz Modeline "1280x1024_59.90" 108.70 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync user1@pc1:~$ xrandr --newmode "1280x1024_59.90" 108.70 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync X Error of failed request: BadName (named color or font does not exist) Major opcode of failed request: 149 (RANDR) Minor opcode of failed request: 16 (RRCreateMode) Serial number of failed request: 20 Current serial number in output stream: 20 user1@pc1:~$

    Read the article

  • Problem with the screen resolution on 12.04

    - by sveinn
    I just installed Ubuntu on my laptop. The screen resolution is stuck in 1024x768. The screen is made for 1280x800. When I run xrandr I get: xrandr: Failed to get size of gamma for output default Screen 0: minimum 800 x 600, current 1024 x 768, maximum 1024 x 768 default connected 1024x768+0+0 0mm x 0mm 1024x768 61.0* 800x600 61.0 1280x800 isn't offered and I get gamma size error. I was going to look into the Xorg.conf file but I couldn't locate it. 1280x800 was displayed in Windows 7 and I think it is being displayed in Grub before Ubuntu starts also. Here are some details about my computer: CPU: Intel atom D2500 1.86GHz Chipset: Intel 945GSE+ICH7M LCD: 14" TFT 16:9 Resolution ratio: 1280*800 Video Card: Intel integrated GMA950 Does anyone know how to fix this?

    Read the article

  • Changing the rendering resolution while maintaining the design layout

    - by Coyote
    I would like to increase the FPS of my project. Currently I would like to try reducing the resolution at which the scenes are rendered. Let's say I never want to draw more than 1280*720. What ever the real resolution is. How should I proceed? I tried pEGLView->setFrameSize(1280, 720); but only reduces the displayed size of the frame on screen (boxing). In my activity I tried setting the size of the "surface" but this seems to completely break the layout (as defined by setDesignResolutionSize). @Override public Cocos2dxGLSurfaceView onCreateView() { Cocos2dxGLSurfaceView surfaceView = new Cocos2dxGLSurfaceView(this); surfaceView.getHolder().setFixedSize(1280, 720); return surfaceView; } Is there a way to simply change the rendered

    Read the article

  • Inserting x200s into (ultrabase) docking station mirror screen is always activated leading to non optimal resolution

    - by kiu
    Builtin LCD should be 1440x900 External LCD should be 1920x1080 If X200s is inserted into docking station the option mirror screen is always activated leading to a resolution of 1152x864 which looks terrible on the builtin and external lcd. My manual configuration for docking mode (seperate screens with maximum resolution) should be respected, but "Make Default" button has no consequences. Found a quick fix, but this cant be the offical ubuntu way... /etc/udev/rules.d/99-vga.rules: SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/sbin/vga_changed.sh" /usr/local/sbin/vga_changed.sh: #!/bin/bash dmode="$(cat /sys/class/drm/card0-VGA-1/status)" export DISPLAY=:0.0 if [ "${dmode}" = disconnected ]; then /usr/bin/sudo -u kiu /usr/bin/xrandr --output LVDS1 --mode 1440x900 --pos 0x0 --output VGA1 --off elif [ "${dmode}" = connected ]; then /usr/bin/sudo -u kiu /usr/bin/xrandr --output LVDS1 --mode 1440x900 --pos 0x0 --output VGA1 --auto --mode 1920x1080 --right-of LVDS1 fi

    Read the article

  • Resolution problems

    - by tampe125
    i'm having some troubles with screen resolution. First of all, i'm using a Lenovo Thinkpad E520, with BackTrack 5 R2 installed. As far as I know, BT is based on Ubuntu 3.2, so I hope this is the right place to ask for help. My natural resolution is 1366x768, but I'm stuck with 1024x768. This is my hardware: lspci | grep VGA 00:02.0 VGA compatible controller: Interl Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) How can I fix that? Is there a ready-to-use driver or I have to compile that from source? At least, is there a solution, at all? :(

    Read the article

  • Problem with the screen resolution on Ubuntu 12.04

    - by sveinn
    I just installed ubuntu on my laptop. The screen resolution is stuck in 1024x768. The screen is made for 1280x800. When I run xrandr I get: xrandr: Failed to get size of gamma for output default Screen 0: minimum 800 x 600, current 1024 x 768, maximum 1024 x 768 default connected 1024x768+0+0 0mm x 0mm 1024x768 61.0* 800x600 61.0 1280x800 isn't offered and I get gamma size error. I was going to look into the Xorg.conf file but I couldn't locate it. 1280x800 was displayed in Windows 7 and I think it is being displayed in Grub before ubuntu starts also. Here are some details about my computer: CPU Intel atom D2500 1.86GHz Chipset Intel 945GSE+ICH7M LCD 14" TFT 16:9 Resolution ratio 1280*800 Video Card Intel integrated GMA950 Does anyone know how to fix this?

    Read the article

  • Asus 101mt Resolution change

    - by jayb151
    I've been looking for a fix, but no luck. my Asus 101mt has a maximum resolution of 1024x768, but I cannot select this in "Displays" since it is not an option. I have added this resolution before, but now I can't seem to find the same information. I just did a clean install with 12.04. I am also dual booting with Win 7. I am really a newb when it comes to Linux. I'm only now starting to see the light! Any help would be appreciated!

    Read the article

  • 2D game collision response: SAT & minimum displacement along a given axis?

    - by Archagon
    I'm trying to implement a collision system in a 2D game I'm making. The separating axis theorem (as described by metanet's collision tutorial) seems like an efficient and robust way of handling collision detection, but I don't quite like the collision response method they use. By blindly displacing along the axis of least overlap, the algorithm simply ignores the previous position of the moving object, which means that it doesn't collide with the stationary object so much as it enters it and then bounces out. Here's an example of a situation where this would matter: According to the SAT method described above, the rectangle would simply pop out of the triangle perpendicular to its hypotenuse: However, realistically, the rectangle should stop at the lower right corner of the triangle, as that would be the point of first collision if it were moving continuously along its displacement vector: Now, this might not actually matter during gameplay, but I'd love to know if there's a way of efficiently and generally attaining accurate displacements in this manner. I've been racking my brains over it for the past few days, and I don't want to give up yet! (Cross-posted from StackOverflow, hope that's not against the rules!)

    Read the article

  • Is an extra collision-mesh for level-data worth the hassle?

    - by Serthy
    What is the optimal approach for collision-detection with the environment in an 3D engine (with triangle mesh based geometry, no bsp)? A) Use the render mesh [+] no need for additional work for artists to fiddle with collision detection [-] high detail is harder for physics calculation [+/-] maybe use collidable flags for materials [+/-] compute the collision-mesh from the render-mesh B) Use an additional collision mesh [+] faster/more optimal collision-detection [-] additional work (either by the artist or by the programmer who has to develop an algorithm to compute it from the render-mesh) [-] more memory useage How do AAA title handle this? And what are the indie dev's approaches?

    Read the article

  • How do I set my main monitor to a higher resolution?

    - by Sean
    My laptop monitor's native resolution is 1280x800 and it just isnt big enough for me. I tried to set the resolution higher, but my graphics card only showed options upto 1280x800, and I figured that was the max res my card would allow. I found a monitor out on the street a few days ago and its native resolution is 1024x768. I have been playing around with it a bit. I was looking under the resolutions for it, and I can set it upto 1400x1050, so apparently my card allows for more than 1280x800, so why can't I set my laptop monitor to higher?

    Read the article

  • Gravity stops when side-collision detected

    - by Adrian Marszalek
    Please, look at this GIF: The label on the animation says "Move button is pressed, then released". And you can see when it's pressed (and player's getCenterY() is above wall getCenterY()), gravity doesn't work. I'm trying to fix it since yesterday, but I can't. All methods are called from game loop. public void move() { if (left) { switch (game.currentLevel()) { case 1: for (int i = 0; i < game.lvl1.getX().length; i++) game.lvl1.getX()[i] += game.physic.xVel; break; } } else if (right) { switch (game.currentLevel()) { case 1: for (int i = 0; i < game.lvl1.getX().length; i++) game.lvl1.getX()[i] -= game.physic.xVel; break; } } } int manCenterX, manCenterY, boxCenterX, boxCenterY; //gravity stop public void checkCollision() { for (int i = 0; i < game.lvl1.getX().length; i++) { manCenterX = (int) game.man.getBounds().getCenterX(); manCenterY = (int) game.man.getBounds().getCenterY(); if (game.man.getBounds().intersects(game.lvl1.getBounds(i))) { boxCenterX = (int) game.lvl1.getBounds(i).getCenterX(); boxCenterY = (int) game.lvl1.getBounds(i).getCenterY(); if (manCenterY - boxCenterY > 0 || manCenterY - boxCenterY < 0) { game.man.setyPos(-2f); game.man.isFalling = false; } } } } //left side of walls public void colliLeft() { for (int i = 0; i < game.lvl1.getX().length; i++) { if (game.man.getBounds().intersects(game.lvl1.getBounds(i))) { if (manCenterX - boxCenterX < 0) { for (int i1 = 0; i1 < game.lvl1.getX().length; i1++) { game.lvl1.getX()[i1] += game.physic.xVel; game.man.isFalling = true; } } } } } //right side of walls public void colliRight() { for (int i = 0; i < game.lvl1.getX().length; i++) { if (game.man.getBounds().intersects(game.lvl1.getBounds(i))) { if (manCenterX - boxCenterX > 0) { for (int i1 = 0; i1 < game.lvl1.getX().length; i1++) { game.lvl1.getX()[i1] += -game.physic.xVel; game.man.isFalling = true; } } } } } public void gravity() { game.man.setyPos(yVel); } //not called from gameloop: public void setyPos(float yPos) { this.yPos += yPos; }

    Read the article

  • Minecraft-style player-gound collision detection

    - by khyperia
    The title pretty much says it all... (Minecraft is a game consisting of evenly-spaced cubes for terrain, like voxels) Note: I am using C# XNA. I am pretty sure AABB is the way to go, yet I don't know how to implement it. I admit, I'm almost looking for code, but theories/ideas are very welcome. Important capabilities of my code: I have a function that can get a block anywhere in the world, and get a BoundingBox for that cube. Hence, I have created a BoundingBox for the player to collide with those cubes. My idea was to get the blocks around the player (maybe 4x6x4) and test against those. The problems I have been having: Say the world is a flat plane. If I use the method of go the shortest distance out, then if the player is slightly clipped into the ground (from gravity), but even slighter into the next block over, then the player will be pushed sideways (and so cannot walk along ground). Of course, this is assuming I react to every block intersected. Another problem is knowing which direction to go (aka negative x or positive). That takes me to my final problem- Getting the amount of intersection, in the correct direction (+ or -) has been tough for me. I hope I haven't been too hard to understand, I'm not too good at explaining things... And if this question has already been asked, I'm sorry, I looked for it... for 3 days straight. One last thing, if someone knows exactly how minecraft does it, or has source (I know MC modders have the source, how else would they mod), please point me to it.

    Read the article

  • Tile-based 2D collision detection problems

    - by Vee
    I'm trying to follow this tutorial http://www.tonypa.pri.ee/tbw/tut05.html to implement real-time collisions in a tile-based world. I find the center coordinates of my entities thanks to these properties: public float CenterX { get { return X + Width / 2f; } set { X = value - Width / 2f; } } public float CenterY { get { return Y + Height / 2f; } set { Y = value - Height / 2f; } } Then in my update method, in the player class, which is called every frame, I have this code: public override void Update() { base.Update(); int downY = (int)Math.Floor((CenterY + Height / 2f - 1) / 16f); int upY = (int)Math.Floor((CenterY - Height / 2f) / 16f); int leftX = (int)Math.Floor((CenterX + Speed * NextX - Width / 2f) / 16f); int rightX = (int)Math.Floor((CenterX + Speed * NextX + Width / 2f - 1) / 16f); bool upleft = Game.CurrentMap[leftX, upY] != 1; bool downleft = Game.CurrentMap[leftX, downY] != 1; bool upright = Game.CurrentMap[rightX, upY] != 1; bool downright = Game.CurrentMap[rightX, downY] != 1; if(NextX == 1) { if (upright && downright) CenterX += Speed; else CenterX = (Game.GetCellX(CenterX) + 1)*16 - Width / 2f; } } downY, upY, leftX and rightX should respectively find the lowest Y position, the highest Y position, the leftmost X position and the rightmost X position. I add + Speed * NextX because in the tutorial the getMyCorners function is called with these parameters: getMyCorners (ob.x+ob.speed*dirx, ob.y, ob); The GetCellX and GetCellY methods: public int GetCellX(float mX) { return (int)Math.Floor(mX / SGame.Camera.TileSize); } public int GetCellY(float mY) { return (int)Math.Floor(mY / SGame.Camera.TileSize); } The problem is that the player "flickers" while hitting a wall, and the corner detection doesn't even work correctly since it can overlap walls that only hit one of the corners. I do not understand what is wrong. In the tutorial the ob.x and ob.y fields should be the same as my CenterX and CenterY properties, and the ob.width and ob.height should be the same as Width / 2f and Height / 2f. However it still doesn't work. Thanks for your help.

    Read the article

  • Java - 2d Array Tile Map Collision

    - by Corey
    How would I go about making certain tiles in my array collide with my player? Like say I want every number 2 in the array to collide. I am reading my array from a txt file if that matters and I am using the slick2d library. Here is my code if needed. public class Tiles { Image[] tiles = new Image[3]; int[][] map = new int[500][500]; Image grass, dirt, mound; SpriteSheet tileSheet; int tileWidth = 32; int tileHeight = 32; public void init() throws IOException, SlickException { tileSheet = new SpriteSheet("assets/tiles.png", tileWidth, tileHeight); grass = tileSheet.getSprite(0, 0); dirt = tileSheet.getSprite(7, 7); mound = tileSheet.getSprite(2, 6); tiles[0] = grass; tiles[1] = dirt; tiles[2] = mound; int x=0, y=0; BufferedReader in = new BufferedReader(new FileReader("assets/map.txt")); String line; while ((line = in.readLine()) != null) { String[] values = line.split(","); for (String str : values) { int str_int = Integer.parseInt(str); map[x][y]=str_int; //System.out.print(map[x][y] + " "); y=y+1; } //System.out.println(""); x=x+1; y = 0; } in.close(); } public void update() { } public void render(GameContainer gc) { for(int x = 0; x < 50; x++) { for(int y = 0; y < 50; y ++) { int textureIndex = map[y][x]; Image texture = tiles[textureIndex]; texture.draw(x*tileWidth,y*tileHeight); } } } } I tried something like this, but I it doesn't ever "collide". X and y are my player position. if (tiles.map[(int)x/32][(int)y/32] == 2) { System.out.println("Collided"); }

    Read the article

  • Collision Detection on floor tiles Isometric game

    - by Anivrom
    I am having a very hard to time figuring out a bug in my code. It should have taken me 20 minutes but instead I've been working on it for over 12 hours. I am writing a isometric tile based game where the characters can walk freely amongst the tiles, but not be able to cross over to certain tiles that have a collides flag. Sounds easy enough, just check ahead of where the player is going to move using a Screen Coordinates to Tile method and check the tiles array using our returned xy indexes to see if its collidable or not. if its not, then don't move the character. The problem I'm having is my Screen to Tile method isn't spitting out the proper X,Y tile indexes. This method works flawlessly for selecting tiles with the mouse. NOTE: My X tiles go from left to right, and my Y tiles go from up to down. Reversed from some examples on the net. Here's the relevant code: public Vector2 ScreentoTile(Vector2 screenPoint) { //Vector2 is just a object with x and y float properties //camOffsetX,Y are my camera values that I use to shift everything but the //current camera target when the target moves //tilescale = 128, screenheight = 480, the -46 offset is to center // vertically + 16 px for some extra gfx in my tile png Vector2 tileIndex = new Vector2(-1,-1); screenPoint.x -= camOffsetX; screenPoint.y = screenHeight - screenPoint.y - camOffsetY - 46; tileIndex.x = (screenPoint.x / tileScale) + (screenPoint.y / (tileScale / 2)); tileIndex.y = (screenPoint.x / tileScale) - (screenPoint.y / (tileScale / 2)); return tileIndex; } The method that calls this code is: private void checkTileTouched () { if (Gdx.input.justTouched()) { if (last.x >= 0 && last.x < levelWidth && last.y >= 0 && last.y < levelHeight) { if (lastSelectedTile != null) lastSelectedTile.setColor(1, 1, 1, 1); Sprite sprite = levelTiles[(int) last.x][(int) last.y].sprite; sprite.setColor(0, 0.3f, 0, 1); lastSelectedTile = sprite; } } if (touchDown) { float moveX=0,moveY=0; Vector2 pos = new Vector2(); if (player.direction == direction_left) { moveX = -(player.moveSpeed); moveY = -(player.moveSpeed / 2); Gdx.app.log("Movement", String.valueOf("left")); } else if (player.direction == direction_upleft) { moveX = -(player.moveSpeed); moveY = 0; Gdx.app.log("Movement", String.valueOf("upleft")); } else if (player.direction == direction_up) { moveX = -(player.moveSpeed); moveY = player.moveSpeed / 2; Gdx.app.log("Movement", String.valueOf("up")); } else if (player.direction == direction_upright) { moveX = 0; moveY = player.moveSpeed; Gdx.app.log("Movement", String.valueOf("upright")); } else if (player.direction == direction_right) { moveX = player.moveSpeed; moveY = player.moveSpeed / 2; Gdx.app.log("Movement", String.valueOf("right")); } else if (player.direction == direction_downright) { moveX = player.moveSpeed; moveY = 0; Gdx.app.log("Movement", String.valueOf("downright")); } else if (player.direction == direction_down) { moveX = player.moveSpeed; moveY = -(player.moveSpeed / 2); Gdx.app.log("Movement", String.valueOf("down")); } else if (player.direction == direction_downleft) { moveX = 0; moveY = -(player.moveSpeed); Gdx.app.log("Movement", String.valueOf("downleft")); } //Player.moveSpeed is 1 //tileObjects.x is drawn in the center of the screen (400px,240px) // the sprite width is 64, height is 128 testX = moveX * 10; testY = moveY * 10; testX += tileObjects.get(player.zIndex).x + tileObjects.get(player.zIndex).sprite.getWidth() / 2; testY += tileObjects.get(player.zIndex).y + tileObjects.get(player.zIndex).sprite.getHeight() / 2; moveX += tileObjects.get(player.zIndex).x + tileObjects.get(player.zIndex).sprite.getWidth() / 2; moveY += tileObjects.get(player.zIndex).y + tileObjects.get(player.zIndex).sprite.getHeight() / 2; pos = ScreentoTile(new Vector2(moveX,moveY)); Vector2 pos2 = ScreentoTile(new Vector2(testX,testY)); if (!levelTiles[(int) pos2.x][(int) pos2.y].collides) { Vector2 newPlayerPos = ScreentoTile(new Vector2(moveX,moveY)); CenterOnCoord(moveX,moveY); player.tileX = (int)newPlayerPos.x; player.tileY = (int)newPlayerPos.y; } } } When the player is moving to the left (downleft-ish from the viewers point of view), my Pos2 X values decrease as expected but pos2 isnt checking ahead on the x tiles, it is checking ahead on the Y tiles(as if we were moving DOWN, not left), and vice versa, if the player moves down, it will check ahead on the X values (as if we are moving LEFT, instead of DOWN). instead of the Y values. I understand this is probably the most confusing and horribly written post ever, but I'm confused myself so I'm having a hard time explaining it to others lol. if you need more information please ask!! I'm so frustrated after over 12 hours of working on it I'm about to give up.

    Read the article

  • Game physics / 2D Collision detection AS3

    - by Jery
    I know there are some methods you can use like hittestPoint and so on, but I want to see where my movieclip colliedes with another another movieclip. Any other methods I can use? by any chance does somebody know some a good introduction to game physics? Im asking because I coded a small engine and pretty much the whole code is spagetti code thats why I would like to know how you can setup something like this properly

    Read the article

  • circle - rectangle collision in 2D, most efficient way

    - by john smith
    Suppose I have a circle intersecting a rectangle, what is ideally the least cpu intensive way between the two? method A calculate rectangle boundaries loop through all points of the circle and, for each of those, check if inside the rect. method B calculate rectangle boundaries check where the center of the circle is, compared to the rectangle make 9 switch/case statements for the following positions: top, bottom, left, right top left, top right, bottom left, bottom right inside rectangle check only one distance using the circle's radius depending on where the circle happens t be. I know there are other ways that are definitely better than these two, and if could point me a link to them, would be great but, exactly between those two, which one would you consider to be better, regarding both performance and quality/precision? Thanks in advance.

    Read the article

  • efficient collision detection - tile based html5/javascript game

    - by Tom Burman
    Im building a basic rpg game and onto collisions/pickups etc now. Its tile based and im using html5 and javascript. i use a 2d array to create my tilemap. Im currently using a switch statement for whatever key has been pressed to move the player, inside the switch statement. I have if statements to stop the player going off the edge of the map and viewport and also if they player is about to land on a tile with tileID 3 then the player stops. Here is the statement: canvas.addEventListener('keydown', function(e) { console.log(e); var key = null; switch (e.which) { case 37: // Left if (playerX > 0) { playerX--; } if(board[playerX][playerY] == 3){ playerX++; } break; case 38: // Up if (playerY > 0) playerY--; if(board[playerX][playerY] == 3){ playerY++; } break; case 39: // Right if (playerX < worldWidth) { playerX++; } if(board[playerX][playerY] == 3){ playerX--; } break; case 40: // Down if (playerY < worldHeight) playerY++; if(board[playerX][playerY] == 3){ playerY--; } break; } viewX = playerX - Math.floor(0.5 * viewWidth); if (viewX < 0) viewX = 0; if (viewX+viewWidth > worldWidth) viewX = worldWidth - viewWidth; viewY = playerY - Math.floor(0.5 * viewHeight); if (viewY < 0) viewY = 0; if (viewY+viewHeight > worldHeight) viewY = worldHeight - viewHeight; }, false); My question is, is there a more efficient way of handling collisions, then loads of if statements for each key? The reason i ask is because i plan on having many items that the player will need to be able to pickup or not walk through like walls cliffs etc. Thanks for your time and help Tom

    Read the article

  • simple collision detection

    - by Rob
    Imagine 2 squares sitting side by side, both level with the ground: http://img19.imageshack.us/img19/8085/sqaures2.jpg A simple way to detect if one is hitting the other is to compare the location of each side. They are touching if ALL of the following are NOT true: The right square's left side is to the right of the left square's right side. The right square's right side is to the left of the left square's left side. The right square's bottom side is above the left square's top side. The right square's top side is below the left square's bottom side. If any of those are true, the squares are not touching. If all of those are false, the squares are touching. But consider a case like this, where one square is at a 45 degree angle: http://img189.imageshack.us/img189/4236/squaresb.jpg Is there an equally simple way to determine if those squares are touching?

    Read the article

  • How to perform simple collision detection?

    - by Rob
    Imagine two squares sitting side by side, both level with the ground like so: A simple way to detect if one is hitting the other is to compare the location of each side. They are touching if all of the following are false: The right square's left side is to the right of the left square's right side. The right square's right side is to the left of the left square's left side. The right square's bottom side is above the left square's top side. The right square's top side is below the left square's bottom side. If any of those are true, the squares are not touching. But consider a case like this, where one square is at a 45 degree angle: Is there an equally simple way to determine if those squares are touching?

    Read the article

  • Box 2D Collision Question

    - by Farooq Arshed
    I am very new to Box 2D Physics world. I wanted to know how to collide 2 bodies when one is Dynamic and other is Kinematic. The whole Scenario is explained below: I have 3 balls in total. I want to balls to remain in their places and the third ball to be able to move. When the third ball hits the other two balls then they should move according to the speed and direction from which they were hit. My gravity of the world is 0 because I only want z-axis gravity. I would also like some one to point me towards some good tutorials regarding Box 2D basics which is language independent. I hope I have explained my scenario well. Thanks for the help in advance.

    Read the article

  • jBullet Collision/Physics not working as expected

    - by Kenneth Bray
    Below is the code for one of my objects in the game I am creating (yes although this is a cube, I am not making anything remotely like MineCraft), and my issue is I while the cube will display and is does follow the physics if the cube falls, it does not interact with any other objects in the game. If I was to have multiple cubes in screen at once they all just sit there, or shoot off in all directions never stopping. Anyway, I am new to jBullet, and any help would be appreciated. // Constructor public Cube(float pX, float pY, float pZ, float pSize) { posX = pX; posY = pY; posZ = pZ; size = pSize; rotX = 0; rotY = 0; rotZ = 0; // physics stuff fallMotionState = new DefaultMotionState(new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), new Vector3f(posX, posY, posZ), 1))); fallRigidBodyCI = new RigidBodyConstructionInfo(mass, fallMotionState, fallShape, fallInertia); fallRigidBody = new RigidBody(fallRigidBodyCI); }

    Read the article

  • Collision detection of player larger than clipping tile

    - by user1306322
    I want to know how to check for collisions efficiently in case where the player's box is larger than a map tile. On the left is my usual case where I make 8 checks against every surrounding tile, but with the right one it would be much more inefficient. (picture of two cases: on the left is the simple case, on the right is the one I need help with) http://i.stack.imgur.com/k7q0l.png How should I handle the right case?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >