mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
fix issues animation 1-transform geometry
This commit is contained in:
parent
117a89358d
commit
62e0ca3d4f
@ -36,7 +36,8 @@ munge_format_impl(const GeomVertexFormat *orig,
|
|||||||
if (dxgsg8_cat.is_debug()) {
|
if (dxgsg8_cat.is_debug()) {
|
||||||
if (animation.get_animation_type() != AT_none) {
|
if (animation.get_animation_type() != AT_none) {
|
||||||
dxgsg8_cat.debug()
|
dxgsg8_cat.debug()
|
||||||
<< "preparing animation type " << animation << "\n";
|
<< "preparing animation type " << animation << " for " << *orig
|
||||||
|
<< "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// We have to build a completely new format that includes only the
|
// We have to build a completely new format that includes only the
|
||||||
@ -135,15 +136,10 @@ munge_format_impl(const GeomVertexFormat *orig,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_array_format->is_data_subset_of(*orig->get_array(0))) {
|
// Make sure the FVF-style array we just built up is first in the
|
||||||
// If the new array format we have built is essentially the same
|
// list.
|
||||||
// as the first data array anyway, go ahead and keep the original.
|
|
||||||
return orig;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use the new format; make sure the FVF-style array we just built
|
|
||||||
// up is first in the list.
|
|
||||||
new_format->insert_array(0, new_array_format);
|
new_format->insert_array(0, new_array_format);
|
||||||
|
|
||||||
return GeomVertexFormat::register_format(new_format);
|
return GeomVertexFormat::register_format(new_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,7 +788,13 @@ begin_draw_primitives(const Geom *geom, const GeomMunger *munger,
|
|||||||
// Set up vertex blending.
|
// Set up vertex blending.
|
||||||
switch (animation.get_num_transforms()) {
|
switch (animation.get_num_transforms()) {
|
||||||
case 1:
|
case 1:
|
||||||
_d3d_device->SetRenderState(D3DRS_VERTEXBLEND, D3DVBF_0WEIGHTS);
|
// The MSDN docs suggest we should use D3DVBF_0WEIGHTS here, but
|
||||||
|
// that doesn't seem to work at all. On the other hand,
|
||||||
|
// D3DVBF_DISABLE *does* work, because it disables special
|
||||||
|
// handling, meaning only the world matrix affects these
|
||||||
|
// vertices--and by accident or design, the first matrix,
|
||||||
|
// D3DTS_WORLDMATRIX(0), *is* the world matrix.
|
||||||
|
_d3d_device->SetRenderState(D3DRS_VERTEXBLEND, D3DVBF_DISABLE);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
_d3d_device->SetRenderState(D3DRS_VERTEXBLEND, D3DVBF_1WEIGHTS);
|
_d3d_device->SetRenderState(D3DRS_VERTEXBLEND, D3DVBF_1WEIGHTS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user