Scale

  ... the Physics Box2D Extension for AndEngine.

Scale

Postby kkarry » Fri Oct 03, 2014 6:02 pm

I'm new to AE and B2. So bear with me please.

So I created a simple project. A 480x800 camera, and 32x32 pixel image. Then set the gravity at Earth and dropped the stripe. It did drop, but it didn't seem "natural" to me; it dropped to slow.

Then I realized there should be a translation between pixels and meters somewhere. The gravity is in m/s2, while the environment is in pixels. Where does this scaling happen? How do I control it?


Just to try, I multiplied the gravity by a factor of 10, and it improved the "naturaleness". But I think there should be a more sophisticated method.

Thanks in advance.
kkarry
 
Posts: 1
Joined: Fri Oct 03, 2014 5:53 pm

Re: Scale

Postby Therdiday » Thu Oct 09, 2014 11:10 pm

Then I realized there should be a translation between pixels and meters somewhere. The gravity is in m/s2, while the environment is in pixels. Where does this scaling happen? How do I control it?


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public interface PhysicsConstants {
  2.         // ===========================================================
  3.         // Final Fields
  4.         // ===========================================================
  5.        
  6.         public static final float PIXEL_TO_METER_RATIO_DEFAULT = 32.0f;
  7.  
  8.         // ===========================================================
  9.         // Methods
  10.         // ===========================================================
  11. }
  12.  
Parsed in 0.013 seconds, using GeSHi 1.0.8.4


Just to try, I multiplied the gravity by a factor of 10, and it improved the "naturaleness". But I think there should be a more sophisticated method.


This greatly depends on what you want the game to "feel" like. As anybody searching the box2d forums knows, there is a great difference between accurate physical simulation and fun gameplay. I usually have gravity set to a factor of 4 for my games.
Therdiday
 
Posts: 343
Joined: Thu Oct 20, 2011 11:12 pm

Re: Scale

Postby CliffordLIsom » Thu Jul 16, 2015 9:24 am

SCALE also works with foundations, research groups, and local and state education agencies to develop assessments that measure teaching effectiveness beyond student standardized test scores. Observation tools and performance-based assessments of student learning were developed for the Bill and Melinda Gates Foundation Measures of Effective Teaching program and the New York City Teacher Effectiveness Pilot Project.

scholarship essay writing help
CliffordLIsom
 
Posts: 1
Joined: Thu Jul 16, 2015 9:17 am


Return to Physics Box2D

Who is online

Users browsing this forum: No registered users and 7 guests