Tagged Questions
0
votes
1answer
49 views
SFX Played Once per Collision or Hit
I have a question about using Box2D (engine for LibGDX used to make realistic physics). I observed on the code that I've made for the physics here below:
@Override
public boolean touchUp(int screenX, ...
-2
votes
1answer
88 views
Move projectile in direction the gun is facing [closed]
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 ...
2
votes
4answers
309 views
How to Make Objects Fall Faster in a Physics Simulation
I used the collision physics (i.e. Box2d, Physics Body Editor) and implemented onto the java code. I'm trying to make the fall speed higher according to the examples:
It falls slower if light object ...
0
votes
1answer
66 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) *
...
1
vote
2answers
89 views
Perpendicularity of a normal and a velocity?
I'm trying to fake angular velocity on my vehicle when it hits a wall by getting the dot product of the normal of the edge the car is hitting and the vehicle's velocity:
Vector2D normVel ...
4
votes
4answers
368 views
Point of contact of 2 OBBs?
I'm working on the physics for my GTA2-like game so I can learn more about game physics.
The collision detection and resolution are working great.
I'm now just unsure how to compute the point of ...
1
vote
1answer
83 views
Help with Collision Resolution?
I'm trying to learn about physics by trying to make a simplified GTA 2 clone.
My only problem is collision resolution. Everything else works great.
I have a rigid body class and from there cars and ...
1
vote
1answer
118 views
Rotating a cube using jBullet collisions
How would one go about rotating/flipping a cube with the physics of jBullet?
Here is my Draw method for my cube object:
public void Draw() {
// center point posX, posY, posZ
float ...
0
votes
2answers
115 views
Circle physics and collision using vectors
This is a problem I've been having, When making a set number of filled circles at random locations on a JPanel and applying a gravity (a negative change in the y), each of the circles collide. I want ...
0
votes
0answers
138 views
Java Collision Detection of a Slope using a Gradient
Im testing out collision detection for a game, The ball is traveling and i need to know when the ball hits a sloped line.
For this example i have used the whole screen, with a sloped line going from ...
0
votes
1answer
166 views
Change density of the body dynamically
In my game, I want to change density of my body object when it collide with other objects. I found something like following to change density but further I could not able to find any hint for this. So ...
1
vote
1answer
324 views
Box2D platformer movement. Should i mess with velocity?
I have a platformer game in which I implemented the movement using a wheel attached to the hero. For jumping I use this:
player.body.applyLinearImpulse(new Vec2(0, 30000000), ...
0
votes
1answer
324 views
JBox2D applyLinearImpulse doesn't work
So i have this line of code:
if(input.isKeyDown(Input.KEY_W)&&canJump())
{
body.applyLinearImpulse(new Vec2(0, 30), cam.screenToWorld(body.getPosition()));
...
0
votes
0answers
96 views
Calculating an orbit and approach velocties
I have drones in my game that need to approach and orbit a node and shoot at it. Problem is I want to stay away from a real physics simulation, meaning I don't want to give the node and drone a mass ...
0
votes
0answers
1k 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 ...