collision-detection

Collision Detection with MANY objects

强颜欢笑 提交于 2019-11-27 13:02:10
问题 I mainly focused on the Graphics aspects to create a little 2DGame. I've watched/looked at several tutorials but none of them were that pleasing. I already have a player(a square) moving and colliding with other squares on the screen. Gravity etc. Are also done. If there are only that much objects as seen on the screen (30*20), everything works perfectly fine. But if I increase it to let's say 300*300 the program starts to run very slow since it has to check for so many objects. I really don

Swift/SpriteKit Multiple Collision Detection?

拈花ヽ惹草 提交于 2019-11-27 12:56:57
Hello. I have a multiple collision problem. There is a bullet, which hits the enemy(red rectangle). Then, it ++ the score. There is a spiral (red circle) which is supossed to trigger the scene to end when the enemy (red rectangle) touches it. In this situation, when enemy hits the spiral, it works, the scene ends, and we go to the menu screen. But, when bullet hits the enemy, the same thing happens, and I don't know why. Now, here's my code: struct PhysicsCategory { static let None : UInt32 = 0 static let All : UInt32 = UInt32.max static let enemyOne : UInt32 = 0b1 static let enemyTwo : UInt32

CRC32 Collision

别来无恙 提交于 2019-11-27 12:29:24
I am trying to find a collision between two messages that will lead to the same CRC hash. Considering I am using CRC32, is there any way I can shorten the list of possible messages I have to try when doing a brute force attack? Any links to websites with hints on this will be helpful. I already have a brute force algorithm that will do this but it simply increment integers and sees if it will match other hashes. scruffy_brit It depends entirely on what you mean by "message". If you can append four bytes of gibberish to one of the messages. (I.E. four bytes that have no meaning within the

How to detect collision in three.js?

孤街醉人 提交于 2019-11-27 11:13:06
I am using three.js. I have two mesh geometries in my scene. If these geometries are intersected (or would intersect if translated) I want to detect this as a collision. How do I go about performing collision detection with three.js? If three.js does not have collision detection facilities, are there other libraries I might use in conjuction with three.js? In Three.js, the utilities CollisionUtils.js and Collisions.js no longer seem to be supported, and mrdoob (creator of three.js) himself recommends updating to the most recent version of three.js and use the Ray class for this purpose instead

How did older games do collision detection with walls, floors and ceilings?

大憨熊 提交于 2019-11-27 10:21:53
问题 I have been reading about collision detection in games on stackoverflow and other sites. A lot of them talk about BSPs, bounding elipses, integration etc. However, on the NES, they managed to do floor and wall collision detection in games and I find it hard to believe that they did many calculations to detect wall collisions. I guess my question is, given a level made up of just tiles, how did they detect collisions with walls and floors in games like Mario and Megaman which had little

Broad-phase collision detection methods?

三世轮回 提交于 2019-11-27 09:30:33
问题 I'm building a 2D physics engine and I want to add broad-phase collision detection, though I only know of 2 or 3 types: Check everything against everything else (O(n^2) complexity) Sweep and Prune (sort and sweep) something about Binary Space Partition (not sure how to do this) But surely there's more options right? what are they? And can either a basic description of each be provided or links to descriptions? I've seen this but I'm asking for a list of algorithms available, not the best one

Best algorithm for efficient collision detection between objects

耗尽温柔 提交于 2019-11-27 09:25:51
问题 I'm confused. Well not confused, so much as not wanting to do 6 test programs to see which algorithm is the best. So I thought I'd ask my expert friends here at SO to give me the benefit of their experience. The scenario is a 3d scene with potentially quite a large area compared to the sizes of the objects inside it. There are potentially thousands of objects in the scene. Objects vary in size from tenths of a unit to up to around 10 units, but no bigger (or smaller). The objects tend to be

Detect collision/colliding only once

点点圈 提交于 2019-11-27 08:27:24
问题 I have an object that moves towards another object and physically collides with it, I want that collision/colliding event to happen only once. I tried using a bool but it didn't work as intended. It seems that I'm doing something wrong. bool doDamage = true; void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "Target" && doDamage) { doDamage = false; // damage code } } void OnCollisionExit2D(Collision2D other) { if (other.gameObject.tag == "Target") { doDamage = true; } }

What is AABB - Collision detection?

流过昼夜 提交于 2019-11-27 07:23:58
Hi I'm making a voxel game in Java and while researching all the different things I'd need to learn, I noticed that a lot of games use AABB for collision detection. And then I remembered seeing AABB in Minecraft also. But when I google what AABB is, it only comes up with other peoples code, or some organization out the history book. Stackoverflow, what is AABB ? jwd AABB stands for " Axis-Aligned Bounding Box ." It is a fairly computationally- and memory-efficient way of representing a volume, typically used to see if two objects might be touching. Since it is axis-aligned, it does not

Sprite Kit Collision Detection

青春壹個敷衍的年華 提交于 2019-11-27 07:10:57
问题 Hi I am trying to setup collision detection in my game and I want to add collision detection so when the balloons hit the spikes they pop. I have looked at Ray Wenderliches tutorial but I couldn't figure it out because it didn't apply to my case. Any ideas how to set it up for my case? The spikes are at the top of the screen and the balloons spawn at the bottom. 回答1: The basics for setting upp collision between 2 objects is to first setting upp constant that represent the different objects