comparison orz.d @ 7:2217fd1fe384

added angular and linear velocity limit
author zzzzrrr <mason.green@gmail.com>
date Sat, 21 Mar 2009 19:34:20 -0400
parents eb6059f7035a
children 4ee9e4a0c03b
comparison
equal deleted inserted replaced
6:eb6059f7035a 7:2217fd1fe384
44 float scale = 0.025; 44 float scale = 0.025;
45 45
46 this(bzWorld world) { 46 this(bzWorld world) {
47 47
48 super(world); 48 super(world);
49 super.engineForce = bzVec2(300, 0); 49 engineForce = bzVec2(500, 0);
50 super.turnForce = bzVec2(0, 10000); 50 turnForce = bzVec2(0, 5000);
51 super.rightTurnPoint = bzVec2(-0.1, 0); 51 rightTurnPoint = bzVec2(-0.5, 0);
52 super.leftTurnPoint = bzVec2(0.1, 0); 52 leftTurnPoint = bzVec2(0.5, 0);
53 53
54 auto bodyDef = new bzBodyDef; 54 auto bodyDef = new bzBodyDef;
55 //bodyDef.isBullet = true;
55 bodyDef.position = bzVec2(10,10); 56 bodyDef.position = bzVec2(10,10);
56 bodyDef.angle = PI/2; 57 bodyDef.angle = PI/2;
57 bodyDef.allowFreeze = false; 58 bodyDef.allowFreeze = false;
58 59
59 rBody = world.createBody(bodyDef); 60 rBody = world.createBody(bodyDef);
60 float density = 2.0f; 61 float density = 5.0f;
61 62
62 // Body 63 // Body
63 auto b = new bzPolyDef(density); 64 auto b = new bzPolyDef(density);
64 b.vertices.length = 4; 65 b.vertices.length = 4;
65 b.vertices[0] = bzVec2(42,14) * scale; 66 b.vertices[0] = bzVec2(42,14) * scale;