![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
08-01-12, 02:41 PM
|
#1 | |
|
Ace of the Deep
![]() Join Date: Sep 2010
Location: LA Area, Central coast, California
Posts: 1,023
Downloads: 827
Uploads: 0
|
Quote:
__________________
Dogfish40 |
|
|
|
08-01-12, 03:40 PM
|
#2 |
|
Black Magic
![]() |
|
|
|
08-01-12, 04:12 PM
|
#3 |
|
Captain
![]() Join Date: May 2011
Posts: 489
Downloads: 106
Uploads: 0
|
|
|
|
08-01-12, 04:43 PM
|
#4 |
|
Ocean Warrior
![]() |
Hello, TDW, sir!
What about new Sub on bottom fix issue? EDIT: I ask because you didn't answer my previous question..
__________________
. Where does human stupidity end? . ![]() ![]() El sueño de la razón produce monstruos © - and for some people awakening will be cruel Last edited by volodya61; 08-01-12 at 05:15 PM. |
|
|
08-01-12, 07:40 PM
|
#5 | |
|
Black Magic
![]() |
Quote:
![]() Collision routine (and supporting functions) in a nutshell for torpedo: Iterare over every unit: -clear flag -check bouding box of item with bounding box of potential collidee -if intersection found then: --iterate over every 3D node in collidee: ---test for intersection of item's bounding box to 3D node bounding box ---if intersection flag it and EXIT ---if no intersection found keep checking 3D nodes --if flag not set then check next unit -if flag not set check next unit -if flag set EXIT if flag not set: EXIT - no collision if flag set: Iterate over every unit: -Check for collision with magnetic detonator: --Check magnetic detonator installed and active --Check magnetic detonator range --Get pointer to collidee (item torpedo collided into) --Iterate over each zone (box) of collidee: ---get the closest x,y,z points of the box to the impact point ---calculate distance from impact point to points found above (D sub i) ---get magnetic detonator range and square it MDR2 ---compare D sub i to MDR2 ---if less than keep checking --if no collision found exit -convert magnetic detonator range into real units -breakdown unit's lattitude and longitude into it's component parts -get collidee's max depth for it's location -compare component parts to magnetic detonator range (in real units) -if magnetic detonator range (in real units) > all component parts range then no collision - EXIT if not flagged: no collision found - EXIT if flagged: - iterate over every zone (box) of the collidee --get axis values of the zone(box) --calculate distance from impact point to zone (box) --square zone (box) axis value --compare calculated distance to square of zone (box) axis value --if before or equal then check next zone (box) --if after: ---take lazy square root of calculated distance ---subtract lazy square root of calculated distance from square of magnetic detonator range and store this value on stack ---flag this zone (box) ---check next zone (box) when done checking all zones (boxes): -compare magnetic detonator range to value saved on stack -see if value saved to stack was flagged or not --if flagged: ---normalize all the zone (box) coordinates ---save pointer to item collided with to stack ---EXIT --if not flagged: EXIT if pointer to item collided with not null: -get distance from collider to item -get zone (box) coordinates and subtract collider's bounding box coordinates from it -normalize the result To be continued.... |
|
|
|
08-01-12, 11:25 PM
|
#6 |
|
Black Magic
![]() |
Finally found the routine that updates all the zones (boxes) damage level, flooding level, and checks to see if damage level >= critical floatation value (when flooding starts)
![]() For a little test I set the damage greater than value for critical floatation level in some zones. I fully expected flooding to start increasing in these zones.....but no, the flooding level was constantly being reset to 0.... Houston, we have a problem!
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
