Jump to content
  • Advertisement
  • entries
  • comments
  • views


Sign in to follow this  


Spent most of the weekend re-writing the buzzsaws as I found some major problems.

As I mentioned before, I did not have the saws actually spinning in terms of physics as it seemed to make them bounce around too much on their prismatic joints. The problem was that if an object landed on top of a spinning saw, it did not react correctly and looked very strange.

So I decided that I needed to have the saws actually spin.

To stop them bouncing around, I now create two invisible shapes along the axis of movement, rendering them below purely for debugging purposes - these do not collide with anything but the buzzsaw:

I found I had trouble setting limits on the revolute joints that actually spin the saw, so when the stop spinning, I deactivate the motor but also create an offcentre invisible static shape that is connected to the saw with another revolute joint. This acts as a lock and prevents the circle from spinning.

The visual spinning is handled separately from the physics spinning so that the saws spin up and down to speed nicely even though the actual physics shape stops abruptly.

The code also now deals with static buzzsaws slightly differently, avoiding the need to create the prismatic joint and one other shape altogether.

I think this now solves all the issues with the buzzsaws. I hope so, anyway.

Sometimes working with Box2D is a bit awkward, not through any fault of the physics engine but just because it is designed to simulate physics accurately and so sometimes strange work-arounds are required.


I also managed to break the level file that I was previously using when I was updating something in the editor so I currently have no levels except the test-box above, but this is not a major problem.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!