mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
bounds should be computed around animated vertices
This commit is contained in:
parent
96571d412f
commit
54ed185526
@ -1017,12 +1017,15 @@ compute_internal_bounds(Thread *current_thread) const {
|
|||||||
PT(BoundingVolume) bound = new BoundingSphere;
|
PT(BoundingVolume) bound = new BoundingSphere;
|
||||||
GeometricBoundingVolume *gbv = DCAST(GeometricBoundingVolume, bound);
|
GeometricBoundingVolume *gbv = DCAST(GeometricBoundingVolume, bound);
|
||||||
|
|
||||||
|
// Get the vertex data, after animation.
|
||||||
|
CPT(GeomVertexData) vertex_data =
|
||||||
|
get_vertex_data(current_thread)->animate_vertices(current_thread);
|
||||||
|
|
||||||
// Now actually compute the bounding volume. We do this by using
|
// Now actually compute the bounding volume. We do this by using
|
||||||
// calc_tight_bounds to determine our minmax first.
|
// calc_tight_bounds to determine our minmax first.
|
||||||
LPoint3f points[2];
|
LPoint3f points[2];
|
||||||
bool found_any = false;
|
bool found_any = false;
|
||||||
do_calc_tight_bounds(points[0], points[1], found_any,
|
do_calc_tight_bounds(points[0], points[1], found_any, vertex_data,
|
||||||
get_vertex_data(current_thread),
|
|
||||||
false, LMatrix4f::ident_mat(), current_thread);
|
false, LMatrix4f::ident_mat(), current_thread);
|
||||||
if (found_any) {
|
if (found_any) {
|
||||||
// Then we put the bounding volume around both of those points.
|
// Then we put the bounding volume around both of those points.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user