#include "example4.h" #define NUM_BOXES 8 using namespace std; RatPhysicsExample4::RatPhysicsExample4(string name): RatPhysicsExample(name) {} RatPhysicsExample4::RatPhysicsExample4(const char *name): RatPhysicsExample(name) {} RatPhysicsExample4::RatPhysicsExample4(char *name): RatPhysicsExample(name) {} static void create_box_row_vary_friction(rat_world *world,vector2 boxsize,rat_real padx,rat_real y,rat_real xcenter,unsigned int numboxes) { register unsigned int i; register rat_real halfwidth=((boxsize.x+padx)/2.0)*numboxes; vector2 halfsize=vector2_multf(boxsize,0.5); numboxes=numboxes>1?numboxes:1; for (i=0; i2.0?2.0:timestep; rat_world_update(world,timestep*0.05,timestep<=1.0?1:0); return true; } bool RatPhysicsExample4::UpdateVisuals() { rat_draw_world(world,show_quadtree,show_arbiters,show_aabbs); return true; } bool RatPhysicsExample4::FreeWorld() { rat_world_free_entities(world); rat_world_destroy(world); return true; }