game-physics

Disable collision completely of a body in AndEngine Box2D

牧云@^-^@ 提交于 2019-12-23 03:19:15
问题 I am working on a Bubble Shooter type game where I want a body not to collide with any thing else when its burst or falling down. I cant use collision filtering because all the bodies on the scene are of same type. I want to disable the collision. I don't want to collide a body with any other body.Some one told me to set the isSensor flag to true but again I am not able to get the flag and set it. Please help. 回答1: Found the answer: for(int i=0; i<getBody().getFixtureList().size();i++){ this

how to move object in circle forward and backward in html5 canvas?

旧时模样 提交于 2019-12-22 10:46:57
问题 I am developing a small app in html5 canvas. I need to move a object in circular motion using keyboard keys . I am able to move the object using keyboard keys but there are bugs .The object do not move back ward or forward from the same position .Can any body help me completing this. Please check the code from following. Any kind of help will be highly appreciable http://jsfiddle.net/tmrhq6s5/ if ( !window.requestAnimationFrame ) { window.requestAnimationFrame = ( function() { return window

Linear movement stutter

只谈情不闲聊 提交于 2019-12-22 04:57:30
问题 I have created simple, frame independent, variable time step, linear movement in Direct3D9 using ID3DXSprite . Most users cant notice it, but on some (including mine) computers it happens often and sometimes it stutters a lot. Stuttering occurs with VSync enabled and disabled. I figured out that same happens in OpenGL renderer. Its not floating point problem. Seems like problem only exist in AERO Transparent Glass windowed mode (fine or at least much less noticeable in fullscreen, borderless

Moving an object at a consistent speed from point A to B

坚强是说给别人听的谎言 提交于 2019-12-21 12:39:37
问题 I'm attempting to create my own primitive 2D graphics based game engine. The core component of the game is firing different projectiles at enemies. I need to get this component working before I can continue working. What I have now moves my projectile along a line going through the Starting point (x, y) and the Target point (x1, x2). I make use of the linear function y = mx + b . The problem is that how I update the position of the projectile causes an inconsistent velocity depending on the

Bullet Physics Simplest Collision Example

点点圈 提交于 2019-12-21 09:20:11
问题 I'm trying to use Bullet Physics for collision detection only. I don't need it to move any objects for me or handle rendering with callbacks. I just want to update object locations every frame and use it to tell me when I have collisions. To get the simplest example going, I'm trying to find collisions between objects with btBoxShape as their shape. Everything runs fine without crashes or apparent memory leaks, but I get no collisions so I must be making some mistakes somewhere. I'll try to

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

别来无恙 提交于 2019-12-20 14:41:45
问题 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

Homing Missiles, How Do They Work?

南楼画角 提交于 2019-12-20 07:58:38
问题 What I am trying to create An object that will launch a missile towards the player, if it collides with player, player dies. The Problem How does the missile move towards the player. How do I make the missile move so that it does not instantly move directly towards the player(to slowly move on an angle). I have a formula for the mouse to be the "Player" and the missile to go towards it. mouse = Mouse.GetState(); mousePosition = new Vector2(mouse.X, mouse.Y); A = (mouse.X - Position.X); B =

Keep SKNodes from applying force to each other

非 Y 不嫁゛ 提交于 2019-12-20 07:37:08
问题 I have two SKNode objects. Their positions change when they collide. How can I prevent that? At the same time, I still want to be able to respond to them contacting via - (void)didBeginContact ; I tried setting both their mass property to 0.0f but that didn't work. 回答1: You can achieve that by setting category, collision and contact bit masks. uint32_t bodyABitMask = 1<<0; uint32_t bodyBBitMask = 1<<1; //A mask that defines which categories this physics body belongs to. [bodyA

Keep SKNodes from applying force to each other

我的梦境 提交于 2019-12-20 07:37:03
问题 I have two SKNode objects. Their positions change when they collide. How can I prevent that? At the same time, I still want to be able to respond to them contacting via - (void)didBeginContact ; I tried setting both their mass property to 0.0f but that didn't work. 回答1: You can achieve that by setting category, collision and contact bit masks. uint32_t bodyABitMask = 1<<0; uint32_t bodyBBitMask = 1<<1; //A mask that defines which categories this physics body belongs to. [bodyA

Recursive call to buff/unbuff? C# Unity3D

南楼画角 提交于 2019-12-20 05:13:13
问题 My goal is to make a single collision detection that will decrease the movement speed of the object it collided with for a specific duration. What I tried so far: //Class that detects the collision if (other.gameObject.tag == "enemy") { EnemyMovement enemyMove = other.GetComponent <EnemyMovement> (); if (enemyMove.slowMove != 1) { return; } enemyMove.Slow (2, 0.5f, true); //.... //Class that handles the Enemy-Movement //The slowfactor gets multiplied with the Vector3 that handles the