Tag Info

Hot answers tagged

4

Circular motion already has velocity; what makes it circular is the continued application of a rotating acceleration of constant magnitude. So to let the object leave the circle at the proper velocity, just stop applying the acceleration.


3

Bare minimum you need to know how the physics SYSTEM works within the engine. Most of these may sound daunting but it's really not that difficult and you CAN simply stumble through things but it will make it significantly easier if you understand these going in. What is a RigidBody? What is a Collider? What is the relationship between the two? How is it ...


2

While the character is running, mark the surface that he's running on as the active running surface. As long as the speed does not reduce to 0 (or reduced, depending on your mechanics), you're on the same surface, no matter if the head touches another surface. To detect where you go next, if your surface is stored as a grid, store last grid cell that you ...


1

I believe the problem is that you're assuming that the ball is at a constant speed throughout the time step. The relevent parts of your code are: ball.y += ball.y_speed * deltaTime / 1000; ball.y_speed += 1.5 * deltaTime; Unfortunately, this method only gives an approximation of the position, and this is why you are seeing errors. You are not taking into ...


1

I wonder if chopmunk allows the object to be made static inside a callback issued from the guts of the physics engine. What if you set a flag on the object and after updating physics you set things static? It would be worth checking the documentation on cpSpaceRemoveBody. I looked into the source code for chipmunk, and here's the relevant function: void ...


1

Movement should never be dependent on framerate. Bob Nystrom wrote an excellent summary of how to write a game loop that is independent of framerate. Check it out here. He starts with the most basic game loop then makes incremental improvements, discussing the motivation behind each iteration. I've added his code here but you should really check the article ...


1

You need to separate your games logic from display logic. Game logic should run at some fixed rate (e.g. 100 ms). Display should query the state of the game and display it at unconnected rate (e.g. 10-20 ms). That way your display performance never affects the game.


1

This picture exemplifies it well. In the given example the rope pulls the robot with the blue vector (a force in the direction of the rope). Once you let go of the rope, of there wass no gravity the robot would move with equal speed in a straight line tangential to the point he stopped the circular motion. If there's gravity, the only acceleration on the ...


1

From my personal experience, some basic physics knowledge can help a lot to tune your game. Lets say that you want to create certain physical effect in your game e.g. players can push boxes. Of course, you need to tune certain parameters to make this effect behave as you want, so that the boxes neither violently fly in every direction neither are almost ...


1

First of all, if you want to avoid aliasing problems, you need to respect the Shannon rule. So you need to take 120FPS or more. Secondly, you don't really need to care, you can simulate at 40 if you want, just be sure to linearly interpolate all of your matrices, the frame presentation time is the t, and your physics simulation always have to run some ...



Only top voted, non community-wiki answers of a minimum length are eligible