collision

Collision realisation with SAT (canvas, javascript)

做~自己de王妃 提交于 2019-12-11 19:19:10
问题 So, I have this simple 2d train sim, and I already made a pretty nice SAT realisation, that works without errors (at least I have not stumbled upon any): function calcCollision(self){ var dist = self.distanceCheck(); var possible = [], collision = []; var myBox, otherBox, myMin, myMax, otherMin, otherMax, myBoxRecalc = [], otherBoxRecalc = []; for (var i=0;i<trainCount;i++){ if (dist[i]!="SELF"&&dist[i]<=(dTrain+10)){ possible.push(i); } } if (possible.length!==0){ myBox = self.box(); self

what is wrong with the following code

天涯浪子 提交于 2019-12-11 18:52:17
问题 The following function gets file offsets from the rabin_polynomial structure, opens the input_file for md5 fingerprint generation and writes the result to fpfile My problem is it seems to use the same chunk_buffer content some times that it generates similar fingerprints for chunks with different legths. What could be the reason? I have tested the md5 function with other inputs separately and it generates correct digests. int write_rabin_fingerprints_to_binary_file(FILE *fpfile,FILE *input

collision testing with multiple objects on stage

混江龙づ霸主 提交于 2019-12-11 17:13:58
问题 I'm trying to create a sort of tree diagram such that, if you click on one of the circles, its child circles spread outward with some degree of randomness from the original circle, connected by lines. I have this working, but now what I want to do is make sure that none of the circles collide with each other and none of the lines criss cross. You can see the screenshot for what is currently happening. My code is below. How do I change this code so that it checks for collisions and avoids them

Scrolling the 2d world with physics

坚强是说给别人听的谎言 提交于 2019-12-11 16:38:23
问题 I'm writing a side scrolling game with physics. Before get my hands dirty i started concentrating on physics and rendering graphics. Initially i thought of keeping every thing static (non scrolling). For physics after referring to many tutorial finally i ended up here http://www.tonypa.pri.ee/vectors/tut08.html. This set of tutorial covers most of the basic/advanced physics required for simple game. By following this tutorial i have created my 2d world with objects like triangle , box ,.....

Why is my data getting corrupted when I send requests asynchronously in objective c for iOS?

与世无争的帅哥 提交于 2019-12-11 15:37:12
问题 I am encountering a problem with a basic content delivery app. The concept is simple in that the app should periodically load updates. The first time, there is no data to go by on the local device, so I am pulling down many files ( all of them ) during the course of an update. The update progress is reported to the user by a UIProgressView comparing expected bytes to received bytes. The problem is that everything is going well about 90% of the time, but sometimes there are collisions. The

How to detect Collision between 2 UIViews

廉价感情. 提交于 2019-12-11 13:01:31
问题 I have a UIImageView which contains my main Character, and I have made the UIImageView appear circle see below code for creating my character copter = [[UIImageView alloc] initWithFrame:CGRectMake(100, 500, 90, 90)]; [copter setContentMode:UIViewContentModeScaleAspectFit]; copter.layer.cornerRadius = roundf(copter.frame.size.width/2.0); copter.layer.masksToBounds = YES; [copter startAnimating]; [[self view] addSubview:copter]; [self setBat:copter]; I am having trouble with my collision

cocoa collision detection question

时间秒杀一切 提交于 2019-12-11 12:30:22
问题 I get the concept of the NSIntersectionRect for collision detection but I can't seem to think of how to implement it for my project. It's nothing fancy, click a button and a view subclass is called and places a circle in the window at a random location. Click within the that view and the circle pulses (this makes it the active view). If you have an active view, clicking anywhere outside it (but not on another circle) will move that view to the click point. I'm using [activeView animator

Per Pixel Collision - Could do with some general tips

痴心易碎 提交于 2019-12-11 10:09:23
问题 I understand the theory behind Per Pixel Collision in Xna, you get the texture data from two textures, and then compare them, checking the alpha values of, for example, your character texture. What I'm wanting to do is use Per Pixel Collision to check if the Player Sprite has touched the map by checking for collisions with a certain colour (Black). I've tried implementing this before, but the characters always falls through the map with no programming errors thrown. Please point me towards

Why is collision response allowing bouncing sphere to eventually pass through Plane?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 09:44:30
问题 I'm currently replicating a particle system in Unity (C#). I am adding physics to each particle (represented by a sphere) to allow it to bounce off a plane located at the origin. The particle bounces a number of times, being affected by gravity. As the bounces become smaller the sphere starts passing through the plane until finally falling through. The force of gravity will be continuously acting on the particle. What is the proper way to stop the sphere on top of the plane? I have included

How to get coordinates/area of collision in Pygame

好久不见. 提交于 2019-12-11 09:13:12
问题 I have a game where the bullet is moving so fast that in a single frame it is already across the screen. That being said, it has already collided with multiple walls. Currently, I have a rectangular image that spans from where the bullet currently is, to where the bullet will be in the next frame, in order to not miss any zombies that may be in between. I also kill the bullet if it collided with any wall, before checking if it collided with any of the zombies because what happened was that if