Changeset 572
- Timestamp:
- 05/24/08 16:01:11 (8 months ago)
- Files:
-
- trunk/src/defend/Camera.d (modified) (3 diffs)
- trunk/src/defend/Main.d (modified) (1 diff)
- trunk/src/defend/sim/Core.d (modified) (2 diffs)
- trunk/src/defend/sim/Effector.d (modified) (1 diff)
- trunk/src/defend/sim/civ/Test.d (modified) (1 diff)
- trunk/src/defend/sim/obj/Citizen.d (modified) (1 diff)
- trunk/src/defend/sim/obj/Unit.d (modified) (2 diffs)
- trunk/src/gen/math/BoundingBox.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/defend/Camera.d
r567 r572 98 98 minDistance -= inputSpeed(input); 99 99 100 if(minDistance < 1.1)101 minDistance = 1.1;100 if(minDistance < 2) 101 minDistance = 2; 102 102 } 103 103 … … 152 152 return true; 153 153 }); 154 155 /+foreach(object; gameObjects) 156 { 157 auto bbox = object.sceneNode.boundingBox.expanded(2); 158 159 if(bbox.checkCollision(pos) && bbox.max.y > minDistance) 160 { 161 minDistance = bbox.max.y; 162 return; 163 } 164 }+/ 154 165 } 155 166 … … 268 279 void scroll(vec3 v) 269 280 { 270 pos += right * v.x; 271 pos += dir * v.y; 272 pos += up * v.z; 281 void move(vec3 v) 282 { 283 auto newPos = pos + v; 284 285 /*foreach(object; gameObjects) 286 { 287 auto bbox = object.sceneNode.boundingBox.expanded(2); 288 289 if(bbox.checkCollision(newPos)) 290 return; 291 }*/ 292 293 pos = newPos; 294 } 295 296 move(right * v.x); 297 move(dir * v.y); 298 move(up * v.z); 273 299 } 274 300 trunk/src/defend/Main.d
r567 r572 51 51 52 52 // Spam :P 53 Log.defaultLevel = LogLevel. Info;53 Log.defaultLevel = LogLevel.Spam; 54 54 55 55 // Load the config trunk/src/defend/sim/Core.d
r571 r572 413 413 } 414 414 415 /+final bool isTypeInHierarchy(object_type_t type)416 {417 return objectType == type || hasParent(type) !is null;418 }+/419 420 415 this() 421 416 { … … 934 929 pf = property_value_t.ctFromReal!(1.0); 935 930 931 // dis no good 936 932 _life = cast(int)cast(real)property(Property.MaxLife); 937 933 trunk/src/defend/sim/Effector.d
r570 r572 12 12 alias fixed property_value_t; 13 13 14 fixedobjProp(real r) { return property_value_t.fromReal(r); }14 property_value_t objProp(real r) { return property_value_t.fromReal(r); } 15 15 16 16 struct EffectorInfo trunk/src/defend/sim/civ/Test.d
r570 r572 59 59 with(civ.objectTypes["unit"]) 60 60 { 61 mulPropertyFactor(Unit.Property.MovementSpeed, property_value_t.ctFromReal!(2.0));61 mulPropertyFactor(Unit.Property.MovementSpeed, objProp(2)); 62 62 } 63 63 } trunk/src/defend/sim/obj/Citizen.d
r570 r572 277 277 else 278 278 { 279 //debug(citizen) trace("doing build step");280 281 279 building.oneBuildStep(); 282 280 trunk/src/defend/sim/obj/Unit.d
r571 r572 358 358 vec3 _direction; 359 359 vec3 direction() { return _direction; } 360 void direction(vec3 v) { assert(v.ok); _direction = v; } 361 362 vec3 finalDirection; 360 void direction(vec3 v) { logger.spam("new dir"); assert(v.ok); _direction = v; } 361 362 vec3 _finalDirection; 363 vec3 finalDirection() { return _finalDirection; } 364 void finalDirection(vec3 v) { logger.spam("final dir"); assert(v.ok); _finalDirection = v; } 363 365 364 366 fixed movePercent; // from 0 to 1000 … … 570 572 void localMove(MapPos pos) 571 573 { 574 finalDirection = vec3.zero; // to prevent NaN 572 575 move(pos); 573 576 finalDirection = getDirection(mapPos, pos); trunk/src/gen/math/BoundingBox.d
r561 r572 50 50 max += amount; 51 51 min -= amount; 52 } 53 54 BoundingBox expanded(T amount) 55 { 56 BoundingBox result = *this; 57 result.expand(amount); 58 59 return result; 52 60 } 53 61
