0
votes
1answer
70 views

Trying to make sprite float up and down [closed]

Using LibGDX + Box2D and my understanding of the answer posted from this question: Here I apply the following impulse: // modify sprite's Box2d Body object int a = 8; // amplitude int f = 1; // ...
8
votes
3answers
448 views

Can I jump from A to B?

I'm making some rudimentary AI for my side-scroller and I need to know whether an AI unit can reach point B from point A simply by taking a jump. Flight trajectory of my characters is a bit unusal as ...
7
votes
1answer
278 views

RK4, Derivatives, Understanding Game Physics

Gafferon Games has a great article on RK4 Integration for building physics simulations which can be found here: Integration Basics Personally my mathematics and physics knowledge could use ...
0
votes
3answers
75 views

How to apply logarithmic type formula for speed?

I want my character's speed to ramp up using somewhat of a logarithmic formula. I am confused about how specifically I would implement this. I want the character to move fast with a little movement as ...
0
votes
1answer
45 views

What does it mean to cross a scalar with a vector in a 2D plane?

At the moment, I'm following this page to create a physics engine. As per that page, I need to cross angular velocity by a distance vector to get relative torque and such, but I'm not sure how (in a ...
2
votes
3answers
109 views

How can I determine trajectory from distance and time, without initial velocity?

I'm attempting to develop a Mortar that needs to lead it's shot to the target enemy. The shot will have a pre-determined constant flight time of (2.5 seconds) and it will have where the enemy should ...
1
vote
1answer
157 views

How can I implement jumping in a 2D game using bounding box collision?

Problem: I'm trying to implement basic jumping to my 2D game engine, but have failed several times. Basically what I've done so far is disabling gravity and using a separate function moving the player ...
1
vote
0answers
82 views

How to aim with a spaceship in 3D considering its angular momentum?

So I have a spaceship and I have 6 degrees of freedom. At a given moment the following vectors are known of the spaceship: Local forward. Local up. Local sideways (may be implied from the previous ...
4
votes
4answers
312 views

The physics equation for a perpetual seesaw

I am trying to create a game that involves two or more people jumping on a seesaw and propelling each other in the air. I need help with the physics equations Assume no friction and no air ...
0
votes
1answer
198 views

Performing intersection testing in world's or object's space?

Am adding basic ray casting and collision detection for my game, also adding bounding volumes/collision mesh. Given that the ray is cast in world space and each mesh's node can track world ...
0
votes
1answer
249 views

Box2d making a body follow the mouse accurately

I am trying to make a box2d b2Body follow my mouse position. This is the code I am using at the moment but it is not performing very well: deltaPos = mousePos - body->GetPosition(); deltaPos *= k; ...
4
votes
1answer
464 views

GGX specular BRDF is way over 1!

Now, the classic Torrance derivation for roughened surfaces which Cook took into vectorized form yields the familiar parametrization of a specular BRDF where we have the NDF which decides how much ...
2
votes
2answers
352 views

Canting of track in a racing game

I am trying to create a small racing game in which the track would be modeled using a BSpline curve for the path's center line and directional vectors to define the canting of the track at each point. ...
0
votes
1answer
173 views

Issues calculating frame independent movement

I'm developing a Breakout style game in C++ using SDL. The problem so far is that the ball slows down and speeds up for no particular reason. The slowdowns usually last a few seconds. EDIT : When ...
2
votes
1answer
168 views

Implementing a time scale in game with fixed physics update

I'm currently putting together my game loop based on the "Fix Your Timestep" article at gafferongames.com. This is going fine, but I'm also trying to implement a 'time scale', i.e. a way to control ...
2
votes
1answer
206 views

Transforms in Box2D

I'm attempting to implement a camera in my game. I had it working for regular objects, but I began using Box2D and obviously things changed a bit. I have a Body object that I want to draw at the ...
4
votes
2answers
337 views

Modular spaceship control

I am developing a physics based game with spaceships. A spaceship is constructed from circles connected by joints. Some of the circles have engines attached. Engines can rotate around the center ...
8
votes
2answers
369 views

Drone targeting

Imagine a "drone" and a target point on a 2d plane. There are eight parameters: P = my position Q = target position V = my velocity I = my moment of inertia w = my angular velocity s = my angular ...
5
votes
1answer
658 views

2D car physics and high speed turning

I've been looking at the following page, which has been very helpful: http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html but have come into problems with the ...
6
votes
3answers
331 views

How can I change the acceleration of an object to arrive at a particular time?

I'm trying to write some code to change an acceleration factor so a ball will arrive at a destination in a desired time. The problem is I don't know time (t) but I do know I want it to arrive at (t - ...
0
votes
1answer
215 views

Jump function of player [duplicate]

I'm developing game in marmalade sdk in c++. I have player in the area.and I wanna make him jump when i pressed a button.When I use this player.moveUp(5px); it just go up 5px, but he has to fall down ...
1
vote
2answers
170 views

Distribute circles evenly on Screen - circle packing

I want to evenly distribute a random amount of circles with random diameter on the screen for. This level doesn't scroll so the users screen resolution sets the limits. Further I would like the ...
2
votes
1answer
142 views

Physics movement prediction is way off [closed]

I'm making a simple, non-networked game. There are two players and a ball. In implementing the AI for the second player, I've run into a huge problem predicting where the ball will hit the ground. ...
1
vote
0answers
167 views

How do I implement a physics gun?

I'm currently trying to implement a physics gun for my game. What I want is for the entity to stay in the same position on the screen no matter how I wiggle the camera about, what is the correct way ...
-2
votes
1answer
193 views

Move projectile in direction the gun is facing [duplicate]

Possible Duplicate: Move sprite in the direction it is facing? I am attempting to have a projectile follow the direction a gun is facing. When using the following code I am unable to make ...
1
vote
1answer
294 views

Point inside Oriented Bounding Box?

I have an OBB2D class based on SAT. This is my point in OBB method: public boolean pointInside(float x, float y) { float newy = (float) (Math.sin(angle) * (y - center.y) + Math.cos(angle) * ...
41
votes
3answers
1k views

How to determine which thrusters to turn on to rotate the ship?

The configuration of the ship changes dynamically, so I have to determine which thruster to turn on when I want to rotate the ship clockwise or counter clockwise. The thrusters are always axis aligned ...
1
vote
2answers
113 views

How do I apply a force using the object direction and speed?

I have a 3D object moving and I need to be able to apply forces to it such as gravity. In 2D, I would simply store its movement in dx and dy, but since this is in 3D, I am using a Vector3D direction ...
-1
votes
1answer
497 views

Breakout… Getting the ball reflection X angle when htitting paddle / bricks [duplicate]

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 ...
2
votes
4answers
534 views

Math and physics, where to start?

the only math I know how is to add the velocity to position. Thats it. i would like to know how to do more stuff, physics, collision detection with stuff other than perfect circles, etc. But where ...
0
votes
2answers
791 views

Calculating angle between two vectors to steer towards a target

I have been trying to implement a path following steering behaviour for AI in a 2D racing game. I have two vectors: futurePosition represents the predicted future position given the car's current ...
1
vote
2answers
387 views

Aligning bullet's position in Asteroid Game

I'm writing an asteroid game and I would like to align the bullets on the ship's tip. I also want when the ship fires, the bullet gets the same orientation(angle, direction) of the ship and also be ...
5
votes
1answer
812 views

Predicting physics/trajectory for pool/billiards games

I'm thinking of making a quick proof of concept of a billiard-style game mechanic, where the player has perfect information of what is about to happen. Here's a good example: I'm only mildly ...
0
votes
2answers
490 views

Asteroids Ship Movement

I have read source code of asteroids game. I want to know why when updating the ship's position in X, and Y Axis, we must write it in sin and cosine of the current angle. Is it angular velocity ? why ...
-1
votes
2answers
343 views

How should I learn about collision detection?

If I want to use physics engine for my game then how should I go to learn collision-detection algorithms? When I read AI book for games, the book talks about collision detection, so I want to learn ...
2
votes
1answer
188 views

Electricity and Magnetism: Relevant?

The computer science major at my university requires that I take a sequence in either biology, chemistry, and physics, plus an additional natural science course (which I might fill with meteorology). ...
0
votes
3answers
588 views

Game Institute Math Courses

I'm 21 years old and I suck at math, I mean really bad. I don't have the necessary logic to apply it towards programming. I would like to learn the math and logic of applying it. I found Game ...
6
votes
2answers
349 views

Elliptical orbit modeling

I'm playing with orbits in a simple 2-d game where a ship flies around in space and is attracted to massive things. The ship's velocity is stored in a vector and acceleration is applied to it every ...
8
votes
3answers
1k views

Calculation of Inertia Tensors

Bit of a complex and lengthy question that, I'll admit, I don't quite understand very well yet so I will try and explain as best as I can. Short Version: Is there a general c++/physx formula out ...
2
votes
2answers
313 views

Automatic weapon recoil with that “Counter Strike”-feel

How would you do it? I already found this function for an impulse (helped by math.SE). It works for single shots, but not for automatic weapons. Any ideas?
1
vote
1answer
152 views

Anybody remember this webpage? [closed]

I remember visiting a webpage some time ago (1 year ago maybe) It contained many java applets, describing how certain mathematical functions like sin, cos, arcsin, exp would make an object move, with ...
5
votes
3answers
2k views

Determine Resulting Angle of Wall Collision

So I have an object moving in a direction towards a fixed horizontal or vertical wall. How do I compute the angle that the object should bounce off at? The object can approach the wall at an arbitrary ...
2
votes
3answers
1k views

simplest way of making a sphere roll in a realistic way

rather than just moving a sphere across a plane, I want to make it roll like a ball. What is the simplest way of doing this? I assume it will have something to do with the circumference of the ball ...
4
votes
2answers
316 views

Box-box contact information

I have two colliding boxes, How i can calculate contact information like (contact normal, contact point and penetration) . Is there any simple algorithm . Note: i'm using XNA .
0
votes
2answers
524 views

Ways to define a curve

I'm trying to give shapes in my physics engine roundness/ curvature. I am aware of various methods for mathematically defining curves; such as bezier-cruves, ellipses, etc. However I am not sure ...
9
votes
1answer
349 views

Deforming surfaces

I try to accomplish an deforming physic behaviour for levelsurfaces, but don't get an idea how to start with the implemenation so far. Regardless of the shape from the surface (planes, cubes, ...
4
votes
1answer
882 views

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 ...
8
votes
1answer
571 views

Projected trajectory of a vehicle?

In the game I am developing, I have to calculate if my vehicle (1) which in the example is travelling north with a speed V, can reach its target (2). The example depict the problem from atop: There ...
10
votes
3answers
735 views

Random map generation - strategies for scattering/clustering random nodes

I am doing a simple 4X strategy game in space where each node is a point-of-interest (a planet, an asteroid and etc.). To randomly generate a map, I would follow the steps below Decide how many ...
11
votes
4answers
637 views

How to get object to lose less velocity as its speed increases

I'm developing a game in Flash and I need a little help. It can be considered a math problem. My object is flying with speed X and my object can collide with stones. When it collides with a stone, I ...