Questions tagged [game-physics]

Game Physics is about implementation, creation, optimization and any other thing related to physics in games. Physics controls the interaction of every physical object in a game, where any 2d or 3d model interacts with any other 2d or 3d model of an object in a game. Physics is used to give realistic effects of this interaction.

Game Physics is about implementation, creation, optimization and any other thing related to physics in games. Physics controls the interaction of every physical object in a game, where any 2d or3d model interacts with any other 2d or 3d model of an object in a game. Physics is used to give realistic effects of this interaction.

3864 questions
17
votes
6 answers

Bullet physics engine, how to freeze an object?

Using Bullet 2.76 I'm trying to freeze an object (rigid body) so that it instantly stops moving, but still responds to collisions. I tried setting it's activation state to DISABLE_SIMULATION, but then it's virtually nonexistent to other objects.…
sunside
  • 8,069
  • 9
  • 51
  • 74
17
votes
2 answers

Kalman Filter for Android

Is there a Kalman filter implementation I can use to fliter my gyroscope and acceleration data from an Android Phone?
Johnny
  • 171
  • 1
  • 1
  • 3
16
votes
1 answer

How to make verlet integration collisions more stable?

I'm not using any engine, but instead trying to build my own softbody dynamics for fun using verlet integeration. I made a cube defined by 4x4 points with segments keeping its shape like so: I have the points collide against the edges of the scene…
Green Cell
  • 4,677
  • 2
  • 18
  • 49
16
votes
3 answers

How best to give falling ball real world gravity

I'm a fairly new app dev and very new to Sprite Kit. I am creating a game where I want a ball to always fall downward as if it were in gravity. This is just a 2d app so all I want is when the ball is falling, when you tilt the phone to the left, the…
16
votes
3 answers

Smooth character movement in canvas game using keyboard controls

I'm creating a side-scrolling endless space themed game using canvas and JavaScript. I'm controlling a spaceship just by using the up and down arrows and I want to implement some kind of movement easing so that the ship doesn't just stop dead when I…
Joe Taylor
  • 579
  • 1
  • 6
  • 21
15
votes
2 answers

Turn rate on a player's rotation doing a 360 once it hits pi

Making a game using Golang since it seems to work quite well for games. I made the player face the mouse always, but wanted a turn rate to make certain characters turn slower than others. Here is how it calculates the turn circle: func (p *player)…
HKVariant
  • 837
  • 10
  • 23
15
votes
2 answers

KDTree Splitting

I am currently writing a KDTree for a physics engine (Hobby project). The KDTree does not contain points. Instead it contains Axis Aligned bounding boxes which bound the different objects in the environment. My problem is deciding on how to split…
shaleve
  • 153
  • 1
  • 1
  • 4
15
votes
2 answers

2D orbital physics

I'm working on a 2D physics engine for a game. I have gravity and masses working, using a simple iterative approach (that I know I'll have to upgrade eventually); I can push the masses around manually and watch them move and it all works as I'd…
David Given
  • 13,277
  • 9
  • 76
  • 123
15
votes
1 answer

Bullets not getting shot out of the gun

I'm making a little game just for fun and I got stuck making the bullets come out of the gun. In the code below, the direction of the player is a degree angle called rot. float gunOffsetX = 106, gunOffsetY = 96; double angle = Math.toRadians(rot);…
David Gomes
  • 650
  • 2
  • 10
  • 34
15
votes
1 answer

Sprite Kit set Min. and Max. for Jump

I want to move a SKSpriteNode on the Y-Axis. The SKSpriteNode called Player has no Velocity.The Player can only jump if a Platform is in contact. Everytime the Screen is touched, I want to give the Player an impulse with a minimum impulse or a…
Nimbahus
  • 477
  • 3
  • 16
15
votes
4 answers

Path generation for non-intersecting disc movement on a plane

What I'm looking for I have 300 or fewer discs of equal radius on a plane. At time 0 each disc is at a position. At time 1 each disc is at a potentially different position. I'm looking to generate a 2D path for each disc for times between 0 and 1…
15
votes
4 answers

How to create a rope in SpriteKit?

I want to create a rope like the one that is shown in this video. What is the best way to develop a rope like this? I've already tried to start and I think the best way to do it, is to make many little "rope"-parts and connect them with a pin joint…
user1940136
  • 343
  • 6
  • 12
14
votes
2 answers

Is there an upper limit on velocity when using box2d?

I'm using box2d for physics simulation. I'm moving a circle using arrow keys by applying impulse on the body when ever a key is pressed. Unfortunately, the circle moves excruciatingly slow and doesn't seem to accelerate like a true physical body is…
ivymike
  • 1,511
  • 2
  • 20
  • 27
13
votes
2 answers

How to sync physics in a multiplayer game?

I try to found the best method to do this, considering a turn by turn cross-plateform game on mobile (3G bandwidth) with projectile and falling blocks. I wonder if one device (the current player turn = server role) can run the physics and send some…
JD C4M
  • 151
  • 1
  • 1
  • 6
12
votes
6 answers

Optimization of AndEngine game

I am using java + AndEngine in my game. During the game i have some freezes, i looked for the information and found some steps how to optimize game performance: Avoid GC (garbage collector) to be called in main action in the game: a)don't create…
dilix
  • 3,761
  • 3
  • 31
  • 55