Comparison for LOD type should be a uint rather than float precision errors.

This commit is contained in:
jaynus 2015-05-15 21:16:16 -07:00
parent c91dcc8cc6
commit 10075c0d9e
5 changed files with 42 additions and 92 deletions

View File

@ -11,8 +11,8 @@ namespace ace {
model_info::model_info(std::istream & stream_, const uint32_t lod_count, uint32_t version) model_info::model_info(std::istream & stream_, const uint32_t lod_count, uint32_t version)
: raw_resolutions(nullptr), u_floats_1(nullptr), default_indicators(nullptr) { : raw_resolutions(nullptr), u_floats_1(nullptr), default_indicators(nullptr) {
raw_resolutions = new float[lod_count]; raw_resolutions = new uint32_t[lod_count];
stream_.read((char *)raw_resolutions, sizeof(float) * lod_count); stream_.read((char *)raw_resolutions, sizeof(uint32_t) * lod_count);
// Get them to parsable int values // Get them to parsable int values
for (int x = 0; x < lod_count; x++) { for (int x = 0; x < lod_count; x++) {
resolutions.push_back(*(int *)&raw_resolutions[x]); resolutions.push_back(*(int *)&raw_resolutions[x]);

View File

@ -17,7 +17,7 @@ namespace ace {
public: public:
std::vector<int> resolutions; std::vector<int> resolutions;
float *raw_resolutions;//LodTypes[Header.NoOfLods];// alias resolutions uint32_t *raw_resolutions;//LodTypes[Header.NoOfLods];// alias resolutions
uint32_t index; // appears to be a bit flag, 512, 256 eg uint32_t index; // appears to be a bit flag, 512, 256 eg
float lod_sphere_mem; float lod_sphere_mem;
float lod_sphere_geo; // mostly same as MemLodSphere float lod_sphere_geo; // mostly same as MemLodSphere

View File

@ -1,110 +1,60 @@
//model.cfg
class CfgSkeletons class CfgSkeletons
{ {
class Default class Default
{ {
isDiscrete = 1; isDiscrete=1;
skeletonInherit = ""; skeletonInherit="";
skeletonBones[] = {}; skeletonBones[]={};
}; };
class test_anim_skeleton: Default
class test_anim_skeleton : Default { {
skeletonBones[] = skeletonBones[]=
{ {
"a_pos","", "a_pos",
"pedestal","", "",
"turret","pedestal", "pedestal",
"rotation_drum","turret", "",
"barrel","rotation_drum" "turret",
"pedestal",
"rotation_drum",
"turret",
"barrel",
"rotation_drum"
}; };
pivotsModel = ""; pivotsModel="";
}; };
}; };
class CfgModels class CfgModels
{ {
class Default class Default
{ {
sectionsInherit = ""; sectionsInherit="";
sections[] = {}; sections[]={};
}; };
class anim_test: Default
class anim_test : Default { {
sectionsInherit = ""; sectionsInherit="";
sections[] = sections[]={};
{ skeletonName="test_anim_skeleton";
};
skeletonName = "test_anim_skeleton";
class Animations class Animations
{ {
class turret class turret
{ {
type = "rotationY"; type="rotationY";
axis = "turret_rotation_axis"; axis="turret_rotation_axis";
source = "turret"; source="turret";
selection = "turret"; selection="turret";
animPeriod = 0.0001; animPeriod=9.9999997e-005;
minValue = "0"; minValue="0";
maxValue = "4"; maxValue="4";
angle0 = "0"; angle0="0";
angle1 = "rad 360"; angle1="rad 360";
sourceAddress = "loop"; sourceAddress="loop";
}; };
/* class turret_1
class a_pos
{ {
type = "rotationY"; selection="turret";
axis = "turret_rotation_axis";
source = "a_pos";
selection = "a_pos";
animPeriod = 0.0001;
minValue = "0";
maxValue = "4";
angle0 = "0";
angle1 = "rad 360";
sourceAddress = "loop";
}; };
class rotation_drum {
type = "rotationX";
source = "rotation_drum";
selection = "rotation_drum";
axis = "barrel_elevation_axis";
animPeriod = 0.0001;
minValue = "0";
maxValue = "4";
angle0 = "0";
angle1 = "rad 360";
sourceAddress = "loop";
};
class barrel_recoil
{
type = "translationZ";
source = "barrel_recoil";
selection = "barrel";
axis = "barrel_recoil_axis";
offset0 = 0;
offset1 = -2;
animPeriod = 0.0001;
minValue = 0;
maxValue = 0.5;
sourceAddress = "mirror";
};
class barrel_hide
{
type = "hide";
source = "barrel_hide";
selection = "barrel";
axis = "barrel_recoil_axis";
hideValue = 0.5;
minValue = "0";
maxValue = "1";
sourceAddress = "mirror";
};
*/
}; };
}; };
}; };

View File

@ -2,7 +2,7 @@
init: init:
debug_render: debug_render:
register_vehicle:\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d, 1, 4046.21;3902.56;5.075 register_vehicle:\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d, 1, 4046.21;3902.56;5.075
set_animation_state:1,damageHide, 0, Wheel_kolL1, 0, Wheel_koloL1, 0, Wheel_podkoloL1, 1, Wheel_kolP1, 0, Wheel_koloP1, 0, Wheel_podkoloP1, 1, Wheel_kolL2, 0, Wheel_kolP2, 0, Wheel_koloL2, 0, Wheel_koloL3, 0, Wheel_koloL4, 0, Wheel_koloL5, 0, Wheel_koloL6, 0, Wheel_koloL7, 0, Wheel_koloP2, 0, Wheel_koloP3, 0, Wheel_koloP4, 0, Wheel_koloP5, 0, Wheel_koloP6, 0, Wheel_koloP7, 0, Wheel_podkoloL2, 1, Wheel_podkoloL3, 1, Wheel_podkoloL4, 1, Wheel_podkoloL5, 0, Wheel_podkoloL6, 0, Wheel_podkoloP2, 1, Wheel_podkoloP3, 1, Wheel_podkoloP4, 1, Wheel_podkoloP5, 0, Wheel_podkoloP6, 1, podkoloL1_hide_damage, 0, podkoloL2_hide_damage, 0, podkoloL3_hide_damage, 0, podkoloL4_hide_damage, 0, podkoloL5_hide_damage, 0, podkoloL6_hide_damage, 0, podkoloL7_hide_damage, 0, podkoloL8_hide_damage, 0, podkoloP1_hide_damage, 0, podkoloP2_hide_damage, 0, podkoloP3_hide_damage, 0, podkoloP4_hide_damage, 0, podkoloP5_hide_damage, 0, podkoloP6_hide_damage, 0, podkoloP7_hide_damage, 0, podkoloP8_hide_damage, 0, damageVez, 0, MainTurret, -3, MainGun, 0, Recoil, 0, ObsTurret, -0, ObsGun, 0, MainGunOptics, 0, Wheel_podkoloP7, 0, Wheel_podkoloL7, 0, HatchDriver, 0, HatchCommander, 0, HatchGunner, 0, damageVezVelitele, 0, poklop_commander_damage, 0, poklop_gunner_damage, 0, poklop_driver_damage, 0, zaslehROT_HMG, 101, zaslehROT_coax, 16, cannon_muzzle_flash, 0, zaslehROT_cannon, 956, HideHull, 1, HideTurret, 1, LockMuzzle, 0 #set_animation_state:1,damageHide, 0, Wheel_kolL1, 0, Wheel_koloL1, 0, Wheel_podkoloL1, 1, Wheel_kolP1, 0, Wheel_koloP1, 0, Wheel_podkoloP1, 1, Wheel_kolL2, 0, Wheel_kolP2, 0, Wheel_koloL2, 0, Wheel_koloL3, 0, Wheel_koloL4, 0, Wheel_koloL5, 0, Wheel_koloL6, 0, Wheel_koloL7, 0, Wheel_koloP2, 0, Wheel_koloP3, 0, Wheel_koloP4, 0, Wheel_koloP5, 0, Wheel_koloP6, 0, Wheel_koloP7, 0, Wheel_podkoloL2, 1, Wheel_podkoloL3, 1, Wheel_podkoloL4, 1, Wheel_podkoloL5, 0, Wheel_podkoloL6, 0, Wheel_podkoloP2, 1, Wheel_podkoloP3, 1, Wheel_podkoloP4, 1, Wheel_podkoloP5, 0, Wheel_podkoloP6, 1, podkoloL1_hide_damage, 0, podkoloL2_hide_damage, 0, podkoloL3_hide_damage, 0, podkoloL4_hide_damage, 0, podkoloL5_hide_damage, 0, podkoloL6_hide_damage, 0, podkoloL7_hide_damage, 0, podkoloL8_hide_damage, 0, podkoloP1_hide_damage, 0, podkoloP2_hide_damage, 0, podkoloP3_hide_damage, 0, podkoloP4_hide_damage, 0, podkoloP5_hide_damage, 0, podkoloP6_hide_damage, 0, podkoloP7_hide_damage, 0, podkoloP8_hide_damage, 0, damageVez, 0, MainTurret, -3, MainGun, 0, Recoil, 0, ObsTurret, -0, ObsGun, 0, MainGunOptics, 0, Wheel_podkoloP7, 0, Wheel_podkoloL7, 0, HatchDriver, 0, HatchCommander, 0, HatchGunner, 0, damageVezVelitele, 0, poklop_commander_damage, 0, poklop_gunner_damage, 0, poklop_driver_damage, 0, zaslehROT_HMG, 101, zaslehROT_coax, 16, cannon_muzzle_flash, 0, zaslehROT_cannon, 956, HideHull, 1, HideTurret, 1, LockMuzzle, 0
#set_vehicle_state:1,0;-20;0,0;0;0,0;0;0 #set_vehicle_state:1,0;-20;0,0;0;0,0;0;0
hit:1,\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d,BALLS,0.984803;0.173649;-0.00285841,0.0029445;-0.000238176;0.999996,2,Sh_120mm_APFSDS_Tracer_Yellow,65,27,19100,2,50,10,0.995217;0.0976774;-0.00161879,-2.42871;-2.42871;-0.794659,-0.0660895;0.997809;-0.00319795,0.997566;0.0697239;-0.00105289,2.16772;-2.94727;4.19943,0.99515;0.0983533;-0.00194169,A3\data_f\Penetration\armour_plate_7mm.bisurf,7840,2 hit:1,\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d,BALLS,0.984803;0.173649;-0.00285841,0.0029445;-0.000238176;0.999996,2,Sh_120mm_APFSDS_Tracer_Yellow,65,27,19100,2,50,10,0.995217;0.0976774;-0.00161879,-2.42871;-2.42871;-0.794659,-0.0660895;0.997809;-0.00319795,0.997566;0.0697239;-0.00105289,2.16772;-2.94727;4.19943,0.99515;0.0983533;-0.00194169,A3\data_f\Penetration\armour_plate_7mm.bisurf,7840,2
hit:1,\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d,BALLS,0.984803;0.173649;-0.00285841,0.0029445;-0.000238176;0.999996,2,Sh_120mm_APFSDS_Tracer_Yellow,65,27,19100,2,50,10,0.995217;0.0976774;-0.00161879,-2.42871;-2.42871;-0.794659,-0.0660895;0.997809;-0.00319795,0.997566;0.0697195;-0.00105303,-2.08813;-2.48047;4.18355,0.995188;0.0979676;-0.00189929,A3\data_f\Penetration\armour_plate_7mm.bisurf,7840,2 hit:1,\A3\Armor_F_EPB\MBT_03\MBT_03_cannon_F.p3d,BALLS,0.984803;0.173649;-0.00285841,0.0029445;-0.000238176;0.999996,2,Sh_120mm_APFSDS_Tracer_Yellow,65,27,19100,2,50,10,0.995217;0.0976774;-0.00161879,-2.42871;-2.42871;-0.794659,-0.0660895;0.997809;-0.00319795,0.997566;0.0697195;-0.00105303,-2.08813;-2.48047;4.18355,0.995188;0.0979676;-0.00189929,A3\data_f\Penetration\armour_plate_7mm.bisurf,7840,2

View File

@ -20,7 +20,7 @@ namespace ace {
} }
} }
if (fire_lod == -1) // @TODO: fallback on geo LOD if (fire_lod == -1) // @TODO: fallback on geo LOD
fire_lod = 11; fire_lod = 0;
//fire_lod = 0; //fire_lod = 0;
assert(fire_lod != -1); assert(fire_lod != -1);