collision

AS3 - Detect WHERE a collision occurred and ROTATE everything AFTER the collision point of the object by 90 degrees

我的未来我决定 提交于 2019-12-12 04:54:40
问题 AS3 - Detect WHERE a collision occurred and ROTATE everything AFTER the collision point of the object by 90 degrees DISCLAIMER The following explanation probably makes no sense, so have a look at http://raphaelhennessy.com/misc/Explanation.png for more information Essentially, I'm making a game where a lazer shines onto the screen and you have a mirror somewhere on the screen you can drag around. There is also a globe somewhere on the screen. The aim of the game is to direct the light, using

detect click on shape pygame

╄→尐↘猪︶ㄣ 提交于 2019-12-12 04:44:00
问题 so I have tried detecting the collision by making 2 shapes but there is some kind of mistake in it and I am wondering if there are easier ways. so this is what i tried: cursorSurface = pygame.Surface((0,0)) cursor = pygame.draw.rect(cursorSurface, (0,0,0),(mouseX,mouseY,2,2)) mouse_mask = pygame.mask.from_surface(cursorSurface,255) mouse_rect = cursor if mouseAction[0] == 'move': if mouseX > x and mouseX < xEnd and mouseY > y and mouseY < yEnd: topTriangle = selectedSquare.subsurface(x+4,y+4

Unity - collision failure for fast moving objects

元气小坏坏 提交于 2019-12-12 04:21:41
问题 Does anyone have any suggestions on how to deal with fast moving objects missing collisions in Unity. I am creating a breakout game for mobile and discovered that when the paddle is moved very fast then it misses the collision with the ball. I changed the collision to continuous detection but that throws up weird behaviour such as paddle being pushed down on collision. I also tried playing around with the dontgothrough script to make it work for 2D colliders without success. Anyone have any

Collision of a drawed line and objects(Corona SDK)

时光毁灭记忆、已成空白 提交于 2019-12-12 04:08:59
问题 For example i have a line that i can draw with a finger and i have a rectangle. i want my line to end drawing up when it collisions with the rectangle. How can i do it? For ex my function of a line: local line = function() if(e.phase == "began") then --code for line elseif(e.phase == "moved") then --code for line to draw elseif(e.phase == "ended") then --code for line to stop draw end i guess that i can do that with collision smith like this local function onCollision( event ) if ( event

How can I make rotating hitboxes that detect collision?

牧云@^-^@ 提交于 2019-12-12 03:58:48
问题 I am trying to make a rotate a hitbox that detects collision. I want a non-rotating rectangle_1 moving from the left to the right and a rotating rectangle_2 moving from the right to the left, and I want the rotating hitbox to detect the collision regardless of its orientation. However, collision is detected only when rectangle_1 collides with the non-rotated rectangle_2. How can I make a rotating hit box detect collision? Here are the codes: The main program: import java.awt.Color; import

camera and terrain collision on three.js

核能气质少年 提交于 2019-12-12 03:33:33
问题 I have a building model created with sketchup, exported as collada file and loaded to three.js with colladaloader. Everything works fine except that the camera can pass through walls. How do I prevent this? So far I have tried with Raycasting, but I think something is wrong. this is how the model is loaded loader.options.convertUpAxis = true; loader.load( 'model/cityhall.dae', function ( collada ) { dae = collada.scene; skin = collada.skins[ 0 ]; model_geometry = collada.scene.children[ 0 ]

Collision detection with complex shapes

别来无恙 提交于 2019-12-12 02:57:18
问题 I am wanting to make a game that has each level loaded from an image. I want to draw up the whole level in Photoshop, and then set it as the background and allow the player to walk over it. I want another invisible image to go over top which will be black in all places that I want to collide with. The reason I don't want to use tiles, which are much easier with rectangle collision and such, is because there will be complex corners and not everything will be rectangle. Is this a good idea, and

QT GraphicScene - Text label collission

六月ゝ 毕业季﹏ 提交于 2019-12-12 01:45:43
问题 I want to stop labels colliding within my Scene and as a result used this code to check for a collision:- QGraphicsTextItem *textLabel = new QGraphicsTextItem; .... addItem(textLabel); //check for collision QList<QGraphicsItem*> items = this->items(textLabel>boundingRect(),Qt::IntersectsItemBoundingRect); I never get any items in the list, yet on screen I can see the collisions. Am I reading the documentation incorrectly? 回答1: You're checking if any items are colliding with the label's

XNA 3D custom collision method?

丶灬走出姿态 提交于 2019-12-12 01:09:34
问题 Ok, after 10 hours of digging, I've come to the conclusion XNA really doesn't offer good collision support. Here is my problem.. imagine an apartment building in your game world. Wrap it with a bounding box.. rotate it on the Y axis 45 degrees. Now walk around it. If your camera intersects that bounding box.. you cant walk.. Well.. 50% of the bounding box is incorrect, because the box is axis oriented.. Now, use a sphere. A sphere that large, has ALOT of error.. I guess the question is.. how

Objective-C function dispatch collisions; Or, how to achieve “namespaces”?

懵懂的女人 提交于 2019-12-11 20:13:48
问题 I have an application for Mac OS X that supports plugins that are intended to be loaded at the same time. Some of these plugins are built on top of a Cocoa framework that may receive updates in one plugin but not another. Given Objective-C's current method for function dispatching, any call from any plugin to a given Objective-C routine will go to the same routine every time. That means plugin A can find itself inside plugin B with a trivial Objective-C call! Obviously what we're looking for