Relating to the motion of objects through space and time. Including concepts such as acceleration (thrust and gravity), mass, collision response, friction and more.

learn more… | top users | synonyms

2
votes
1answer
207 views

Collider2D and Rigidbody2D, how do they work?

I have been learning JavaScript and Unity for a week now. I learned how to make Cube as a Ground and another Cube as a player and I used this code to make the Player Cube move forward and backward and ...
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 ...
1
vote
1answer
58 views

3D collision physics. Response when hitting wall, floor or roof

I am having problem with the most basic physic response when the player collide with static wall, floor or roof. I have a simple 3D maze, true means solid while false means air: bool ...
1
vote
1answer
3k views

LibGDX Box2D Body and Sprite AND DebugRenderer out of sync

I am having a couple issues with Box2D bodies. I have a GameObject holding a Sprite and Body. I use a ShapeRenderer to draw an outline of the Body's and Sprite's bounding boxes. I also added a ...
0
votes
1answer
68 views

Relative Position/Rotation calculation

I have 2 objects each with a 3x3 Matrix (Orientation) and a Vector3 (Translation). Both are relative to world coordinates. How do I calculate the position and orientation of object B in relation to ...
0
votes
1answer
73 views

Grid collision - finding the location of an entity in each box

I am trying to implement grid-based collision in a 2d game with moving circles. The canvas is 400x400 pixels. Below you can see the code for my Grid class. What I want it to do is check inside which ...
0
votes
1answer
62 views

How can I get a function of time for coordinates of a 2D-moving body in a gravitational field from equations of forces?

I am having a hard time with writing code for simulation of 2D motion of a body with mass in a gravitational field of another body. I have 2 masses and a gravitational force equation. I know that ...
0
votes
1answer
117 views

How do I prevent other dynamic bodies from affecting the player's velocity with Box2D?

I'm working on my player object for my game. PhysicsBodyDef def; def.fixedRotation = true; def.density = 1.0f; def.position = Vec2(200.0f, 200.0f); def.isDynamic = true; def.size = ...
0
votes
1answer
229 views

Circle vs. Rect Collision accuracy problem

The blue ball is dynamic and is supposed to bounce off the walls, as well as the rectangle. Currently, the green rectangle is adding an invisible line to the scene, which doesn't let my ball go where ...
-1
votes
1answer
74 views

Can not seem to adjust the speed of my Car

I'm programming in C++, rendering in OpenGL and using GLM for matrix/vector manipulation and I have implemented very (very) basic car controls; ignoring many forces that are present in reality. Since ...
-1
votes
1answer
199 views

forward motion car physics - gradual slow

Im having trouble creating realistic car movements in xna 4. Right now i have a car going forward and hitting a terminal velocity which is fine but when i release the up key i need to the car to slow ...
-2
votes
1answer
279 views

How can I create a curved path for a ball?

I am creating a soccer game. Now I want to shoot the ball and create an after-effect resulting in a curved path. I tried several things, but nothing seems to work. I am using a 3D tool, but the ...
3
votes
0answers
191 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 ...
2
votes
0answers
140 views

Collision detection with an irregular curve

I'm building a custom physics engine to accompany a level-editor. This image shows how the level-editor outputs levels: Now, some explanation is in order. The curve is defined by the red points. ...
2
votes
0answers
228 views

Friction due to gravity in an impulse based physics engine

In my physics engine, I'm using impulses to solve collisions. I'm basing all calculations on these equations: impulse = desired_velocity_change * mass impulse = force * time friction_force <= ...
2
votes
0answers
187 views

How do I run a callback when all objects have stopped moving?

I'm using Bullet and want to take some action once all objects in a dynamic world have reached 0 velocity (or at least a value that's very close). I was trying to iterate over all of them all the ...
1
vote
0answers
50 views

2D Enemy AI reacting to sound

I'm currently working on a 2D top-down survival game and I'm trying to figure out a good method for enemies to detect player sounds. For instance - if the player fires his gun it should play a sound ...
1
vote
0answers
27 views

How do you calculate the rate of rotation using the accelerometer values in Android for a particular axis?

I am developing a simple game which involves a character moving up and down only along the Y axis. Currently I am using the accelerometer readings to change the Y velocity of the character. The game ...
1
vote
0answers
86 views

Conceptual - What is the optimal way to combine steering behaviors with rigid body physics?

I am working on a simple 3D space simulator that makes use of the Bullet physics engine. The spaceships are rigid bodies that have a mass and hitbox so that they can be considered for collisions. At ...
1
vote
0answers
65 views

Spin wheel with gesture in Andengine

I want to implement Fortune wheel in Andengine. The wheel would start spinning based on the speed of a finger fling. Then it would stop slowly like real Fortune wheel. What I am able to do now is to ...
1
vote
0answers
81 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 ...
1
vote
0answers
821 views

Why do restitution values less than one still cause infinite bouncing in Box2D?

I'm currently trying to implement basketball bouncing into my game using Box2d (jBox2d technically), but I'm a bit confused about restitution. While trying to create the ball in the testbed first, ...
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 ...
1
vote
0answers
530 views

Unity3D: collider performances on mobile iOS devices

I'm experimenting with Unity3D and colliders. Unfortunately I still don't have Unity Pro version and I can't use the profiler. Consider the following situation: mobile devices (ios, iphone 3GS). an ...
1
vote
0answers
115 views

Collision shape and Model problem

I used BEPUphysics for my XNA 4.0 game , the problem is that I load my model.fbx from into the game then add it to the space of physics engine , but when I change the scaling matrix of my Model then ...
1
vote
0answers
563 views

Unity3d Gravity script issues

I'm try this script out http://wiki.unity3d.com/index.php/Gravity and I'm having some issues with it (it seemed to work when I tried it with an old version of unity) the first issue is of ...
1
vote
0answers
158 views

Updating physics for animated models

For a new game we have do set up a scene with a minimum of 30 bone animated models.(shooter) The problem is that the update process for the animated models takes too long. Thats what I do: Each ...
1
vote
0answers
277 views

Need help with objects moving toward the player

I am making a 2D game with simple "gravity": everything is just pulled toward 0,0. The speed at which they accelerate towards it is GravityAcceleration up to MaxGSpeed. I also want the player to be ...
1
vote
0answers
74 views

What is the most effective way to create a set of collision points for an aribitrary mesh?

In my project I am working on automatically deforming an arbitrary mesh with respect to another arbitrary mesh, within the context of user generated content, similar to this deformer being developed ...
1
vote
0answers
408 views

Joint constraints in PhysX

I'm trying to use PhysX for my physics engine. I'd like to use spherical joints, but I'm having trouble with the constraints. All of the examples that I've found refer to SDK v2.8. I'd like to ...
0
votes
0answers
26 views

Determine speed of sprite

I'm trying to calculate the speed of my sprites in Cocos2d but I'm having some difficulties. I'm not sure which units of time/speed cocos2d uses. My background sprite moves 2 positions to left each ...
0
votes
0answers
13 views

setChaseEntity freezes or jitters the AnimatedSprite

I'm trying to implement setChaseEntity method in a physics based app. I wrote the below code which has an animated sprite ans as the player. The player is movable and it can jump. When i try to focus ...
0
votes
0answers
37 views

Simple Libgdx bullet example

I'm looking for a SIMPLE example of the use of the bullet physics engine in libgdx. Before you point me at the wiki, I have read that, but that mostly describes installation, and just a "raw" ...
0
votes
0answers
41 views

How to find correct offset to adjust sprite to the position of box2D body after rotation

I am trying to implement phsyics with the as3 box2d port. I currently have a b2body for each of some certain sprites in my game and I am able to update the sprite's positions correctly from the ...
0
votes
0answers
31 views

2D Collision in JavaFX - Bad accuracy with .intersects()

I have several Shape objects - Circle, Rectangle and Polygon. I use the built-in .intersects(Bounds1, Bounds2) method to detect collision but it's quite inaccurate. Circle c1 = new Circle(20); ...
0
votes
0answers
50 views

How to design basic physics and movement behavior for 2D platformer?

I want to make a simple 2D platformer. I know some basic 2D physics and how to implement them in a game. How to make a character jump, accelerate, decelerate, etc. But I have no idea how to actually ...
0
votes
0answers
31 views

Issue with implementing friction for player movement

I have been writing a 2.5D FPS engine in the same style of Doom and Duke Nukem 3D. The game is 3D rendered but the world is represented in 2D. This is my current position update code for an entity ...
0
votes
0answers
16 views

Handling gyroscope data

I'm working on a mobile game that allows user to rotate player around an axis using accelerometer. In addition to that, to allow fast, almost instant, rotation I thought of using gyro data. It seems ...
0
votes
0answers
81 views

Polygon Collision Response

I'm working on a game engine that has a built in custom physics engine (I know it's a waste of time, but I have years to make this, so why not make it good?). Currently, with any number of polygons, ...
0
votes
0answers
39 views

Lateral Friction Phisics

I am trying to create a physics engine for my game, and need to cancel out any lateral velocity for when entities turn. I have tried to mimic this page's example, but it is not working. I have objects ...
0
votes
0answers
33 views

Rotate to face a direction in ODE

I'm trying to code some AI for a space flight simulation game. I have a function called seek that returns the desired velocity to head towards a target. My problem is now applying this to an ODE ...
0
votes
0answers
74 views

Separating axes test for moving objects

I am having trouble figuring when a given case that is often mentioned actually comes into being. In multiple GDC presentations, and in Eberly's Game Physics book SAT on moving objects it is also ...
0
votes
0answers
85 views

Game physics movement

I am trying to write some code in Pygame that will achieve smooth movement from place to another. I've been able to do some nice physics for jumping but when I need to move horizontally I am not sure ...
0
votes
0answers
91 views

Tension Force is zero

And it's not supposed to be. I've been pulling my hair out for a while trying to figure out why... The values used in T = F - ma are below: mass of first body: 1 kg acceleration: [0, 9.80665] (as a ...
0
votes
0answers
146 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
0answers
35 views

Mixing kinematics and dynamics in ODE

I am trying to do some animations on characters with a variety of body plans. I am trying to make a system that uses IK for moving end effector positions (some of the time), and use the actual ...
0
votes
0answers
155 views

Simulating smooth movement along a line after calculating a collision containing a restitution of zero in 2D

[for tl;dr see after listing] //...Code to determine shapes types involved in collision here... //...Rectangle-Line collision detected. ...
0
votes
0answers
137 views

Farseer non-colliding bodies affect eachother

I'm trying to use Farseer to make a tile engine, but bodies that are not colliding with a sprite are still having an effect on it. In this image there is a single sprite(the green box) and a single ...
0
votes
0answers
176 views

Schedule update problem

This might sound pretty straightforward. I've created a method and I've called it as below in the init method. [self createNewSpr:ccp(s.width * 0.25,s.height-200)]; [self createNewSpr:ccp(s.width * ...
0
votes
0answers
312 views

How do I properly use multithreading with Nvidia PhysX?

I'm having a multithreading problem with Nvidia PhysX. the SDK requires that you call Simulate() (starts computing new physics positions within a new thread) and FetchResults() (waits 'till the ...