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
67
votes
5 answers

How to convert Euler angles to directional vector?

I have pitch, roll, and yaw angles. How would I convert these to a directional vector? It'd be especially cool if you can show me a quaternion and/or matrix representation of this!
DigitalZebra
  • 39,494
  • 39
  • 114
  • 146
63
votes
5 answers

Why transform normals with the transpose of the inverse of the modelview matrix?

I am working on some shaders, and I need to transform normals. I read in few tutorials the way you transform normals is you multiply them with the transpose of the inverse of the modelview matrix. But I can't find explanation of why is that so, and…
user1796942
  • 3,228
  • 5
  • 29
  • 38
51
votes
4 answers

How to create a simple 2D game for Android?

I'm a complete newbie when it comes to game development and I need someone to point me to the right direction. For the sake of clarity please consider the following animation. Basically I need to know how to emulate the above animation as an…
2hamed
  • 8,719
  • 13
  • 69
  • 112
36
votes
3 answers

Quadtree for 2D collision detection

I'm trying to use a quadtree for 2D collision detection, but I'm a little stumped on how to implement it. First of all, I'd have a quadtree which contains four subtrees (one representing each quadrant), as well as a collection of objects which don't…
bfops
  • 5,348
  • 5
  • 36
  • 48
35
votes
4 answers

AI of spaceship's propulsion: land a 3D ship at position=0 and angle=0

This is a very difficult problem about how to maneuver a spaceship that can both translate and rotate in 3D, for a space game. The spaceship has n jets placing in various positions and directions. Transformation of i-th jet relative to the CM of…
javaLover
  • 6,347
  • 2
  • 22
  • 67
30
votes
5 answers

How to make a 2D Soft-body physics engine?

The definition of rigid body in Box2d is A chunk of matter that is so strong that the distance between any two bits of matter on the chunk is completely constant. And this is exactly what i don't want as i would like to make 2D (maybe 3D…
Griffin
  • 2,399
  • 7
  • 48
  • 83
27
votes
2 answers

Canvas Rotating Star Field

I'm taking the following approach to animate a star field across the screen, but I'm stuck for the next part. JS var c = document.getElementById('stars'), ctx = c.getContext("2d"), t = 0; // time c.width = 300; c.height = 300; var w =…
25
votes
2 answers

Calculating X Y movement based on rotation angle?

Say I have an object in 2D space that can rotate and then should move according to its rotation angle. For example: If angle is 0(pointing upwards), then on_timer it should move 1 by Y and 0 by X. If angle is 45, then it should move 1 by Y and 1…
Rob
  • 643
  • 3
  • 8
  • 13
25
votes
3 answers

Why is Verlet integration better than Euler integration?

Can someone explain to me why Verlet integration is better than Euler integration? And why RK4 is better than Verlet? I don't understand why it is a better method.
21
votes
8 answers

How to prevent colliders from passing through each other?

I am having trouble keeping game objects inside of a contained space. When they reach the edge, there is some momentary push back but then they will go right through the wall. I am using a Box Collider on the player, and a Mesh Collider for the…
CLo
  • 3,650
  • 3
  • 26
  • 44
21
votes
7 answers

iOS 7 Sprite Kit freeing up memory

I am building an iOS game aimed for the new iOS 7 and Sprite Kit, using emitter nodes and physics to enhance gameplay. While developing the app, I ran into a serious problem: you create your scenes, nodes, effects, but when you are done and need to…
Lehel Medves
  • 527
  • 1
  • 5
  • 15
21
votes
8 answers

SpriteKit's SKPhysicsBody with polygon helper tool

I wonder if there is a tool that could be used for easy generation of complex physics bodies in SpriteKit. I would like to have a volume based physical bodies with polygon-type shapes. SpriteKit allows to create such bodies with that method: +…
Darrarski
  • 3,882
  • 6
  • 37
  • 59
20
votes
6 answers

SpriteKit physics in Swift - Ball slides against wall instead of reflecting

I have been creating my own very simple test game based on Breakout while learning SpriteKit (using iOS Games by Tutorials by Ray Wenderlich et al.) to see if I can apply concepts that I have learned. I have decided to simplify my code by using an…
18
votes
1 answer

2D soft bodies: Gelly and moldable?

I am using Matter.js physics in an attempt to create soft bodies. I was able to create a body like this: However I am not sure if this is the "soft body" I want. It is true that this body is not entirely rigid and has that bouncy feel when it…
Kunis
  • 576
  • 7
  • 24
18
votes
7 answers

Good 2D Collision Response References

Hey, I'm currently looking for various methods of implementing collision response in 2D video games, something similar to this tutorial Metanet has: N Tutorial I'm looking to implement something in XNA, but any language would be fine. I'm more…
Jeff
  • 1,153
  • 2
  • 15
  • 35
1
2 3
99 100