collision-detection

How do I test for collision of two moving 2d oriented bounding boxes?

冷暖自知 提交于 2019-12-03 08:06:29
The OBBs have a position(x,y), a velocity(x,y) and an orientation(Matrix). Given periodic updates, the OBBs must collide with each other, returning the fraction of the move that was deemed successful. I have looked at the Polygon test on the GPWiki - http://gpwiki.org/index.php/Polygon_Collision - but it does not account for moving objects or an object that is completely within an OBB. The book Real Time Collision Detection covers 3D OBBs in Chapter 4: Bounding Volumes, but the method for testing in 3 dimensions is notably more complex than in 2D. To test collision detections between 2

Open source, pure Java physics / dynamics library [closed]

泄露秘密 提交于 2019-12-03 06:53:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm looking for a lightweight, pure Java physics engine to do some simulations for robotic motion control. My requirements: Rigid body physics Joint constraints and forces Convex object collision detection Lightweight, pure Java so it can be embedded in my application Ability to run simulations quickly Handles

Spatial Data Structures for moving objects?

柔情痞子 提交于 2019-12-03 05:50:43
问题 I was wondering what is the best data structure to deal with a lot of moving objects(spheres, triangles, boxes, points, etc)? I'm trying to answer two questions, Nearest Neighbor and Collsion detection. I do realize that traditionally, data structures like R trees are used for nearest neighbor queries and Oct/Kd/BSP are used for collision detection problems dealing with static objects, or with very few moving objects. I'm just hoping that there is something else out there that is better. I

Good 2D Collision Response References

早过忘川 提交于 2019-12-03 04:24:55
问题 Hey, I'm currently looking for various methods of implementing collision response in 2D video games, something similar to this tutorial Metanet has: N Tutorial I'm looking to implement something in XNA, but any language would be fine. I'm more interested in implementing programmatically than actual theory. I'd prefer more beginner friendly material, but I do welcome more advance topics. So could someone suggest some good 2D collision response articles/books? (PS: I'm more interested in

XNA C# 2D Platformer Game

大兔子大兔子 提交于 2019-12-03 04:13:42
I'm trying to make (figure out how to..) a 2d platformer in XNA. I know how to create a tile grid and how to perform collision detection. I perform collision detection on the 9 bounding tiles of the player, but I'd like to know if there's a better way to perform collision detection. I've read Braid doesn't use tiles but pieced images or something, how do you perform collision detection on those? and is that better than using tiles? Assuming you don't mind using a third party tool to do the majority of the work for you, you may be better off using something like Box2D for C#. http://www.box2d

One-way platform collisions in Sprite Kit

眉间皱痕 提交于 2019-12-03 03:47:17
I am making a Doodle Jump clone game in Swift and the issue is that when the player jumps, it hits its head on the bottom of the platform and doesn't pass through. How can I make the player pass over the platform and jump through them? I have my code here: import SpriteKit class GameScene: SKScene, SKPhysicsContactDelegate { var hero = SKSpriteNode(imageNamed: "hero"); var stepSizeTest = SKSpriteNode(imageNamed: "step"); var start = false; var jumpSpeed = CGFloat(0); var gravity = CGFloat(0); var stepPositionDivision:CGFloat = 0 //allows the step to spawn on specific places on y axes var

Java HashMap detect collision

孤街醉人 提交于 2019-12-03 03:05:47
Is there a way to detect collision in Java Hash-map ? Can any one point out some situation's where lot of collision's can take place. Of-course if you override the hashcode for an object and simply return a constant value collision is sure to occur.I'm not talking about that.I want to know in what all situations other that the previously mentioned do huge number of collisions occur without modifying the default hashcode implementation. I have created a project to benchmark these sort of things: http://code.google.com/p/hashingbench/ (For hashtables with chaining, open-addressing and bloom

Problem with collision detection of a fast moving ball with a racket controlled by mouse

假如想象 提交于 2019-12-03 02:59:59
In unity, i have a racket which is supposed to hit a ball, and the racket is controlled directly by the mouse, i.e the bat is being moved by the mouse using mouse axes and the using transform.translate() function to move the racket. I expected that Unity3d's physics will not properly translate the racket's movement directly by mouse and impact the ball accordingly, and i would have to write something custom, and it turned out to be true. But the ball's collision is not being detected properly when the racket is moving. When it is still, everything is fine, and the ball behaves as i like. Now i

IOS: verify if a point is inside a rect

我是研究僧i 提交于 2019-12-03 01:25:15
问题 Is there a way to verify if a CGPoint is inside a specific CGRect . An example would be: I'm dragging a UIImageView and I want to verify if its central point CGPoint is inside another UIImageView 回答1: Swift 4 let view = ... let point = ... view.bounds.contains(point) Objective-C Use CGRectContainsPoint(): bool CGRectContainsPoint(CGRect rect, CGPoint point); Parameters rect The rectangle to examine. point The point to examine. Return Value true if the rectangle is not null or empty and the

How do I create collision detections for my bouncing balls?

≡放荡痞女 提交于 2019-12-03 00:28:34
I have coded an animation (in python) for three beach balls to bounce around a screen. I now wish to have them all collide and be able to bounce off each other. I would really appreciate any help that can be offered. import pygame import random import sys class Ball: def __init__(self,X,Y): self.velocity = [1,1] self.ball_image = pygame.image.load ('Beachball.jpg'). convert() self.ball_boundary = self.ball_image.get_rect (center=(X,Y)) self.sound = pygame.mixer.Sound ('Thump.wav') self.rect = self.ball_image.get_rect (center=(X,Y)) if __name__ =='__main__': width = 800 height = 600 background