physics

Powder Physics Games

Does anyone have any experience with this sort of thing? I'm talking about applets like this http://dan-ball.jp/en/javagame/dust/ I'm really interested in how they work, it seems more like fluid-dynamics than regular game physics. Does anyone know any open source variations, or any hints on how they might work? I think it would be real...

physics game programming box2d - orientating a turret-like object using torques

This is a problem I hit when trying to implement a game using the LÖVE engine, which covers box2d with Lua scripting. The objective is simple: A turret-like object (seen from the top, on a 2D environment) needs to orientate itself so it points to a target. The turret is on the x,y coordinates, and the target is on tx, ty. We can consid...

How to identify four sided polygon (not rectangle) collision detection?

I am developing 2D game for iPhone, for that I need to handle collision detection. My need is: I have two polygons, each is a four-sided polygon (not a rectangle), I need to check whether they are collided or not. ...

The physics of turning in a boat

I am writing a small simulation of a boat (a sailboat under power rather than sail). It has a rudder and a keel and I have most of the physics working for the thrust and drag. I have modelled the drag across the boat to be higher than along the boat to reduce the sideways slip. However it doesn't behave quite right. Am I right in sa...

coin rotation, as3

What's the better way to make a coin rotation? I tried Math.random, but the coin doesn't wobble correctly. starter code //ROTATION addEventListener(Event.ENTER_FRAME, enterFrameHandler); function enterFrameHandler(event:Event):void { /* ADD VELOCITY, GRAVITY, ACCELERATION */ coin.rotationY += 8; } tried this, but it has no gravity o...

iPhone shooter game bullet physics!

Hello, Making a new shooter game here in the vein of "Galaga" (my fav shooter game growing up). Here's the code I have for bullet physics: -(IBAction)shootBullet:(id)sender{ imgBullet.hidden = NO; timer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(fireBullet) userInfo:Nil repeats:YES]; } -(void)fireBu...

Any idea about an iPhone Accelerometer Library?

Have looked so long for a library specialized in dealing with iPhone Accelerometer but couldn't find anything. I have made some few sample apps, but none reaches a level of accuracy as in Labyrinth games for example, so any idea about a library for that? Or maybe an open source app? Would be better if it's integrated in a Physics libra...

Free Fall Question

OK, I'm going to try my best to explain my problem. I have this program where you can select 5 balls. When you select one, you can drag it while you have the mouse button pressed and the cursor is within the ball's radius. The problem is that I need a way to make the ball go up when the user stop pressing the mouse button, like he sent ...

Chipmunk Physics or Box2D for C++ 2D GameEngine ?

Hello, I'm developing what it's turning into a "cross-platform" 2D Game Engine, my initial platform target is iPhone OS, but could move on to Android or even some console like the PSP, or Nintendo DS, I want to keep my options open. My engine is developed in C++, and have been reading a lot about Box2D and Chipmunk but still I can't d...

How to install python physics engine

I want a python physics engine that works on mac and makes it easy to simulate physics. I have VPython and it works fine, but it is not quite what I want. VPython just shows visual elements and all the physics is in formulas. I looked at the documentation for PyODE and it looked like more what I want. It allowed you to add forces to mass...

Can my loop be optimized any more? (C++)

Below is my innermost loop that's run several thousand times, with input sizes of 20 - 1000 or more. This piece of code takes up 99 - 99.5% of execution time. Is there anything I can do to help squeeze any more performance out of this? I'm not looking to move this code to something like using tree codes (Barnes-Hut), but towards optimi...

Detecting Acceleration in a car (iPhone Accelerometer)

Hello, I am working on an iPhone app where we are trying to calculate the acceleration of a moving car. Similar apps have accomplished this (Dynolicious), but the difference is that this app is designed to be used during general city driving, not on a drag strip. This leads us to one big concern that Dynolicious was luckily able to avo...

Javascript phsyics in a 2d space

So, I am working on teaching myself Canvas (HTML5) and have most of a simple game engine coded up. It is a 2d representation of a space scene (planets, stars, celestial bodies, etc). My default "Sprite" class has a frame listener like such: "baseClass" contains a function that allows inheritance and applies "a" to "this.a". So, "var aTe...

Calculating collision for a moving circle, without overlapping the boundaries

Let's say I have circle bouncing around inside a rectangular area. At some point this circle will collide with one of the surfaces of the rectangle and reflect back. The usual way I'd do this would be to let the circle overlap that boundary and then reflect the velocity vector. The fact that the circle actually overlaps the boundary isn'...

[Physics] Why is Verlet integration better than Euler integration?

Hello! Can someone explain me why Verlet integration is better than Euler integration? And why RK4 better than Verlet? I don't understand why it is a better method :/ ...

Pool Billiard AI

Im implementing a pool billiard game in Java and it all works fine. It is a multiplayer game, but nevertheless, it should also be possible to play it alone. For this purpose I'm trying to implement a simple KI. At the moment, the KI choose just randomly a direction and a random intensity of the impulse (don't know the correct english wor...

Android Accelerometer Gravity Compensation

How do you accurately compensate gravity such that I can know the magnitude of the acceleration due to my hand movement in the x-y-z component using the accelerometer data ? ...

Example of a RoboCup 3D Soccer bot?

I'd like to write a bot to play in the 3D RoboCup software soccer simulation league that runs under SimSpark. Can anyone point me at some code that already deals with communication with the server, etc? Ideally this would be .NET code, but an example produced in any language would still be useful. EDIT For anyone who is not familiar...

Python optimization problem?

Alright, i had this homework recently (don't worry, i've already done it, but in c++) but I got curious how i could do it in python. The problem is about 2 light sources that emit light. I won't get into details tho. Here's the code (that I've managed to optimize a bit in the latter part): import math, array import numpy as np from PIL...

In software engineering, is it required you're good in math or physics there?

In what particular situation you will need a depth knowledge of math/physics in software engineering? ...