Tagged Questions
2
votes
1answer
56 views
Farseer: Shooting a ball in a certain angle?
How can I shoot a ball in a certain angle? When I press the Space key, the ball should be shot in a 45 degree angle. How can I do that?
0
votes
0answers
36 views
Farseer: Difficulties with implementation of DebugView
I added the project "Farseer Physics Engine 3.3.1 HelloWorld XNA\DebugView XNA\DebugView XNA.csproj" to my solution explorer in Visual Studio. In addition, I added a reference to my project and the ...
0
votes
1answer
30 views
Farseer: RemoveBody is not working [closed]
I want to remove bodies after they touched the character(playerrect). But the bodies get not removed. I set a breakpoint in the following line but it doesn't get yellow:
...
1
vote
1answer
50 views
Farseer: How can I remove a body?
I have many sensors(coins) in each level and I want to remove the sensors(coins) when the player rectangle(Mario) touches them. I check in OnCollision if Mario touches a coin, if he touches it, it ...
-1
votes
1answer
126 views
“Car” movement in 2D dimension [closed]
I am searching for a simple tutorial how to add arcade car physics for my game.
Exactly same user units behaviour i found in next games:
Tank Hero: Laser Wars
Death Worm:
Video:
...
0
votes
1answer
26 views
Farseer: Difficulties with ContactListener
How can I register the ContactListener in XNA? In the box2d manual is written:
9.4 Contact Listener
...
At run-time you can create an instance of the listener and register it with ...
3
votes
1answer
134 views
How do I make a tile passable in one direction only?
I want that my character can jump through some of the tiles, like Mario does in this video:
http://www.youtube.com/watch?v=zIPYzbNrNhc
In this video, Mario jumps up through orange platforms, but ...
-2
votes
1answer
43 views
Farseer: are you missing a using directive or an assembly reference?
I want to create a polygon in Farseer. I found an example in the documentation but it's not working because I get this error message:
The type or namespace name 'Vertices' could not be found (are you ...
0
votes
1answer
54 views
Farseer: Ball is not getting slower
The ball is not getting slower when it rolls over a straight platform. I added friction but that changed nothing, the ball still gets not slower. I want that the ball gets slower and slower and stops ...
0
votes
1answer
80 views
Farseer: Ball is not bouncing realistically
I created a ball that is rolling over platforms. When it falls from one platform to another, it should bounce just like in real life, but the ball keeps bouncing constantly and I don't know how to ...
0
votes
0answers
29 views
Farseer physics engine: The name 'ConvertUnits' does not exist in the current context [duplicate]
http://digitalerr0r.wordpress.com/2012/03/11/farseer-physics-in-xna-4-0-for-windows-phone-1/
I tried this Farseer tutorial but I always get that error message in the following lines:
...
-4
votes
1answer
74 views
How to use a physics engine for collision detection? [closed]
I want to use Box2D.XNA or Farseer for collision detection in my 2D game, but I don't know how to start. I added Box2D.XNA to my solution, but I don't know how to create rectangles, circles or ...
-1
votes
1answer
162 views
Creating physics in xna
I am creating a racing game using visual studio 2010 and xna 4.0. I'm trying to create some simple physics so my car sticks to the heightmap I have created within my game world and the model adjusts ...
2
votes
3answers
225 views
How should I calculate the new angle/direction of my ball hitting a wall? [duplicate]
I'm building a Pong game and I am stuck at how the ball should bounce when hitting a horizontal wall.
I tried a few methods but none seems to work.
So far I have an update method, which is called ...
4
votes
2answers
248 views
Ball bouncing infinitely and constantly
Alright, so I've got hold of some simple physics mechanics, and am currently trying to implement bouncing. Based on the first answer of this question, I've developed the following algorithm:
...
0
votes
2answers
357 views
How to make a smooth movement in XNA?
I'm trying to make a nice controls for my game, but I can't achieve enough SMOOTHNESS.
if (kbState.GetPressedKeys().Length != 0 && _direction != Vector2.Zero)
{
...
1
vote
1answer
186 views
XNA (BEPU) Physics Performance
Im using XNA 4.0 with the BEPU physics engine v1.2 and I have encountered some performance problems on Xbox. Im not sure if the my mesurements are an expected result of the Xbox (with alot of dynamic ...
5
votes
2answers
696 views
Get collision details from Rectangle.Intersects()
I have a Breakout game in which, at some point, I detect the collision between the ball and the paddle with something like this:
// Ball class
rectangle.Intersects(paddle.Rectangle);
Is there any ...
26
votes
3answers
3k views
2D water with dynamic waves
New Super Mario Bros has really cool 2D water that I'd like to learn how to create.
Here's a video showing it. When something hits the water, it creates a wave. There are also constant "background" ...
0
votes
0answers
163 views
Artificial Gravity - Rolling Ball Physics
How could I make a program that simulates the physics of a ball?
I want it to be so that if i have a ball and place it on top of a ramp it will roll down that ramp. How might this be accomplished?
3
votes
3answers
167 views
Scaling Sound Effects and Physics with Framerate
(I'm using XNA and C#)
Currently, my game (a shooter) runs flawlessly with 60 FPS (which I developed around).
However, if the framerate is changed, there are two major problems:
Gunshot sound ...
1
vote
1answer
105 views
What is going on in this SAT/vector projection code?
I'm looking at the example XNA SAT collision code presented here:
http://www.xnadevelopment.com/tutorials/rotatedrectanglecollisions/rotatedrectanglecollisions.shtml
See the following code:
private ...
1
vote
1answer
384 views
Farseer Physics for Xna missing ConvertUnits class
Im using Farseer Physics with Xna 4.0. Im following a starter guide. It said that to draw, I need to convert the meters to pixels with the ConvertUnits namespace. I looked through all of the engine, ...
1
vote
1answer
146 views
2D Physics Engine to Handle Shapes Composed of Multiple Densities XNA
The game I'm working on involves shapes that might be composed of multiple materials in a variety of ways. Let's just take for example a wooden rod with and sizable tip of iron or say a block composed ...
-1
votes
1answer
290 views
Breakout… Getting the ball reflection X angle when htitting paddle / bricks
Im currently creating a breakout clone for my first ever C# / XNA game. Currently Ive had little trouble creating the paddle object, ball object, and all the bricks. The issue im currently having is ...
0
votes
0answers
113 views
Rendering light rays that intersect the viewport but have off-screen sources (XNA)
I am creating a very simple 2D navigation app in XNA. The grid/world starts at (1,1) and carries on to infinity in the East and South directions. The view-port shows the world without any scaling ...
2
votes
1answer
660 views
Platformer Starter Kit - Collision Issues
I'm having trouble with my game that is based off the XNA Platformer starter kit.
My game uses smaller tiles (16x16) then the original (32x40) which I'm thinking may be having an effect on collision ...
2
votes
0answers
152 views
How can I stop my Jitter physics meshes being offset?
I'm developing a C# game engine and have hit a snag trying to add physics. I'm using XNA for graphics and Jitter for physics. I am trying to split the XNA model into it's meshes, then create a ...
9
votes
6answers
2k views
Ball Physics : Smoothing the final bounces as the ball comes to rest
I've come against another issue in my little bouncing ball game.
My ball is bouncing around fine except for the last moments when it is about to come to rest. The movement of the ball is smooth for ...
2
votes
1answer
662 views
Getting started using C# and Physics (Resources, Tutorials, Samples, etc.)
As an application developer, I plan on now getting started in game development so I have come along to this site.
I am a proficient C# developer so I guess it makes sense to start game development in ...
1
vote
1answer
234 views
Free physics library?
What are some good recommendations? I have a vertex buffer and indices and I want to be able to detect collision between it and a bounding box or another object.
1
vote
3answers
703 views
How to make a ball fall faster on a ramp?
So, I'm making a ball game. Where you pick up the ball, drop it on a ramp, and it flies off in to blocks. The only problem right now is it falls at a normal speed, then lightly falls off, not nearly ...
2
votes
1answer
329 views
Getting a sphere to roll down a .FBX object Unity3D/C#
I'm working on a little ramp and ball game in Unity, I modeled the ramp outside Unity and exported it to a .FBX file, then I imported the ramp in to Unity. I set up the ball and ramp, both have ...
3
votes
1answer
369 views
Making particle bounce off a line with friction
So I'm making a game and I need a particle to bounce off a line. I've got this so far:
public static Vector2f Reflect(this Vector2f vec, Vector2f axis) //vec is velocity
{
Vector2f result ...
8
votes
2answers
2k views
Why use Runge Kutta Integration over Improved Euler Integration?
I was reading these slides (very good by the way!), and if you skip all the way to the end the author compares all the different integrators presented.
In one way or another, they all fall short ...
3
votes
1answer
399 views
Calculating torque required to turn an object to a target rotation, depending on timestep
The function below works fine, when the timesteps of the physicsengine are short enough for the function to update often. It determinates when the ship(the object) needs to start decelerating to reach ...
4
votes
3answers
546 views
IndexOutOfRangeException on World.Step after enabling/disabling a Farseer physics body?
Earlier, I posted a question asking how to swap fixtures on the fly in a 2D side-scroller using Farseer Physics Engine. The ultimate goal being that the player's physical body changes when the player ...
2
votes
2answers
790 views
Jumping Vs. Gravity
Hi i'm working on my first XNA 2D game and I have a little problem.
If I jump, my sprite jumps but does not fall down.
And I also have another problem, the user can hold spacebar to jump as high as he ...
4
votes
1answer
556 views
RK4 Bouncing a Ball
I am trying to wrap my head around RK4. I decided to do the most basic 'ball with gravity that bounces' simulation. I have implemented the following integrator given Glenn Fiedler's tutorial:
/// ...
0
votes
1answer
172 views
Is it possible (from the vertex shader) to always draw at specific pixels?
I am wondering if I can (if possible) make a vertex shader that will always make the pixel shader draw everything in 1 pixel, at position 0,0.
I know this sounds crazy, but it's needed in the ...
5
votes
3answers
1k views
2D Platformer Collision/Physics Problems
I'm making a 2D platformer similar to Terraria, although I'm having some problems with some collision detection code. I'm using the code from the AppHub Platformer sample, but tweaked so it fits with ...
22
votes
4answers
2k views
Momentum and order of update problems in my physics engine
This question is a "follow-up" question from my previous one, regarding collision detection and resolution, which you can find here.
If you don't want to read the previous question, here's a ...
1
vote
1answer
2k views
2D Physics Engine for Platform Games - Riding on a Platform
I have a number of questions relating to using a 2D physics engine in a platform game, but one main one that I'm grappling with at the moment. I managed to somewhat integrate the Physics2D.Net engine ...
7
votes
4answers
2k views
2D Spatial partitioning alternatives to spatial hashes and quadtrees
I've been trying to implement a spatial partitioning algorithm in my game, but both spatial hashes and quadtrees aren't what I'm looking for.
My level size is not supposed to have a limit (only Int32 ...
43
votes
7answers
4k views
2D Platformer AABB collision problems
I have a problem with AABB collision resolution.
I resolve AABB intersection by resolving the X axis first, then the Y axis.
This is done to prevent this bug: http://i.stack.imgur.com/NLg4j.png
...
2
votes
2answers
175 views
Collisions between players at spawnpoints
I am working on a FPS/MMORPG and ran into a problem at spawnpoints, when I enabled collision detection between players. Neither player would be able to move if both spawned at the same time, because ...
4
votes
1answer
338 views
How to balance a ball on a rotating plane?
I'm doing some research and I really don't want a physics engine when a simple mechanism will do. I have a ball that will be balanced on a plane. The ball will always be "stuck" to the plane and ...
6
votes
5answers
1k views
Why do objects interpenetrate in this simple collision solver?
The code below is from a Microsoft XNA sample here.
This is quite a simple rigid body simulation that ignores many physical effects (such as angular momentum), but it does try to push objects ...
5
votes
1answer
211 views
Splitting an object into two
I'm using Farseer physics engine.
I have a simple rectangle body and would like it to split into two pieces given a starting coordinate (where the bullet enters the object) and ending coordinate ...
9
votes
1answer
986 views
Adding air drag to a golf ball trajectory equation
I'm developing a 2D golf game in VB.NET 2005, but I am stuck on how to implement air or wind drag that should affect the ball.
Already I have these equations for projectile:
Vo ...


