mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-26 22:53:16 -04:00
bullet: Fix assertion when reconstructing BulletConvexHullShape from bam
Fixes #1251 Closes #1252
This commit is contained in:
parent
3fc579c7d4
commit
33691d72ec
@ -194,7 +194,7 @@ make_from_bam(const FactoryParams ¶ms) {
|
||||
void BulletConvexHullShape::
|
||||
fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
BulletShape::fillin(scan, manager);
|
||||
nassertv(_shape == nullptr);
|
||||
nassertv(_shape);
|
||||
|
||||
_shape->setMargin(scan.get_stdfloat());
|
||||
unsigned int num_points = scan.get_uint32();
|
||||
|
@ -133,6 +133,26 @@ def test_sphere_shape():
|
||||
assert shape.radius == shape2.radius
|
||||
|
||||
|
||||
def test_convex_shape():
|
||||
shape = bullet.BulletConvexHullShape()
|
||||
shape.add_array([
|
||||
(-1.0, -1.0, -1.0),
|
||||
(1.0, -1.0, -1.0),
|
||||
(-1.0, 1.0, -1.0),
|
||||
(-1.0, -1.0, 1.0),
|
||||
(1.0, 1.0, -1.0),
|
||||
(1.0, -1.0, 1.0),
|
||||
(-1.0, 1.0, 1.0),
|
||||
(1.0, 1.0, 1.0),
|
||||
])
|
||||
shape.margin = 0.5
|
||||
|
||||
shape2 = reconstruct(shape)
|
||||
|
||||
assert type(shape) is type(shape2)
|
||||
assert shape.margin == shape2.margin
|
||||
|
||||
|
||||
def test_ghost():
|
||||
node = bullet.BulletGhostNode("some ghost node")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user