|
modelinterp.cpp.patch (1,667 bytes)
Index: code/model/modelinterp.cpp
===================================================================
--- code/model/modelinterp.cpp (revision 9354)
+++ code/model/modelinterp.cpp (working copy)
@@ -3201,7 +3201,27 @@
//set to true since D3d and OGL need the api matrices set
g3_start_instance_matrix(pos, orient, true);
+ bool set_autocen = false;
+ vec3d auto_back = ZERO_VECTOR;
+ if (Interp_flags & MR_AUTOCENTER) {
+ // standard autocenter using data in model
+ if (pm->flags & PM_FLAG_AUTOCEN) {
+ auto_back = pm->autocenter;
+ vm_vec_scale(&auto_back, -1.0f);
+ set_autocen = true;
+ }
+ // fake autocenter if we are a missile and don't already have autocen info
+ else if (Interp_flags & MR_IS_MISSILE) {
+ auto_back.xyz.x = -( (pm->submodel[pm->detail[Interp_detail_level]].max.xyz.x + pm->submodel[pm->detail[Interp_detail_level]].min.xyz.x) / 2.0f );
+ auto_back.xyz.y = -( (pm->submodel[pm->detail[Interp_detail_level]].max.xyz.y + pm->submodel[pm->detail[Interp_detail_level]].min.xyz.y) / 2.0f );
+ auto_back.xyz.z = -( (pm->submodel[pm->detail[Interp_detail_level]].max.xyz.z + pm->submodel[pm->detail[Interp_detail_level]].min.xyz.z) / 2.0f );
+ set_autocen = true;
+ }
+ if (set_autocen)
+ g3_start_instance_matrix(&auto_back, NULL, true);
+ }
+
if (is_outlines_only_htl) {
gr_set_fill_mode( GR_FILL_MODE_WIRE );
@@ -3322,7 +3342,8 @@
if ( !(Interp_flags & MR_NO_LIGHTING ) ) {
light_filter_pop();
}
-
+ if (set_autocen)
+ g3_done_instance(true);
g3_done_instance(true);
// turn off fog after each model renders, RT This fixes HUD being fogged when debris is in target box
|
|
|
Attached patch that fixes; Test for side effects. |
|
|
Have been running with this patch for some time, no side effects were noticeable. |
|
|
Want one more comment about TBP ships still having this issue. I think it's an asset problem but without specifics i cant investigate. |
|
|
Did you get the model/table I linked for you to test? |
|
|
Fix for retail committed to Trunk @ 9391
TBP was confirmed asset issue. |
|