Bullet Target Shape for NAIF type 2 DSK models. More...
#include <BulletDskShape.h>


Public Member Functions | |
| BulletDskShape () | |
| Default empty constructor. | |
| BulletDskShape (const QString &dskfile) | |
| Construct a BulletDskShape from a DSK file. | |
| virtual | ~BulletDskShape () |
| Destructor. | |
| int | getNumTriangles () const |
| Return the number of triangles in the shape. | |
| int | getNumVertices () const |
| Return the number of verticies in the shape. | |
| virtual btVector3 | getNormal (const int indexId, const int segment=0) const |
| Return normal for a given triangle index. | |
| virtual btMatrix3x3 | getTriangle (const int index, const int segment=0) const |
| Get the vertices of a triangle in the mesh. | |
| QString | name () const |
| Return name of the target shape. | |
| void | writeBullet (const QString &btName) const |
| Write a serialized version of the target shape to a Bullet file. | |
| btCollisionObject * | body () const |
| Return a pointer to the Bullet target object/shape. | |
| btScalar | maximumDistance () const |
Static Public Member Functions | |
| static BulletTargetShape * | load (const QString &dem, const Pvl *conf=0) |
| Load a DEM file into the target shape. | |
| static BulletTargetShape * | loadPC (const QString &dem, const Pvl *conf=0) |
| Load a point cloud type DEM in Bullet. | |
| static BulletTargetShape * | loadDSK (const QString &dem, const Pvl *conf=0) |
| Load a DSK in Bullet. | |
| static BulletTargetShape * | loadCube (const QString &dem, const Pvl *conf=0) |
| Load an ISIS cube type DEM in Bullet. | |
Protected Member Functions | |
| void | setTargetBody (btCollisionObject *body) |
| Set the Bullet shape object to this object instance. | |
| void | setMaximumDistance () |
| Calculate and save the maximum distance across the body. | |
Static Protected Member Functions | |
| static void | btDelete (btCollisionObject *btbody) |
Private Member Functions | |
| void | loadFromDsk (const QString &dskfile) |
| ! | |
Private Attributes | |
| std::vector< DskSegmentBuffer > | m_buffers |
| std::shared_ptr< btTriangleIndexVertexArray > | m_mesh |
| QString | m_name |
| std::shared_ptr< btCollisionObject > | m_btbody |
| ! | |
| btScalar | m_maximumDistance |
| ! | |
Bullet Target Shape for NAIF type 2 DSK models.
2017-03-17 Kris Becker Original Version
2025-04-17 Kris Becker - Modified for bullet >= 3.25 and configure to use conda-forge bullet feedstock library Float64 double precision build. See Issues #5100.
Definition at line 36 of file BulletDskShape.h.
| Isis::BulletDskShape::BulletDskShape | ( | ) |
Default empty constructor.
Definition at line 36 of file BulletDskShape.cpp.
| Isis::BulletDskShape::BulletDskShape | ( | const QString & | dskfile | ) |
Construct a BulletDskShape from a DSK file.
| dskfile | The DSK file to load into a Bullet target shape. |
Definition at line 44 of file BulletDskShape.cpp.
References loadFromDsk(), and Isis::BulletTargetShape::setMaximumDistance().
|
virtual |
Destructor.
Definition at line 53 of file BulletDskShape.cpp.
|
inherited |
Return a pointer to the Bullet target object/shape.
Definition at line 151 of file BulletTargetShape.cpp.
References m_btbody.
Referenced by Isis::BulletWorldManager::addTarget(), and setTargetBody().
|
staticprotectedinherited |
Definition at line 168 of file BulletTargetShape.cpp.
|
virtual |
Return normal for a given triangle index.
This method is particularly useful to return the normal of a triangle plate in a mesh-based target body.
| indexId | The index of the triangle in the mesh. |
Definition at line 103 of file BulletDskShape.cpp.
References getTriangle().
| int Isis::BulletDskShape::getNumTriangles | ( | ) | const |
Return the number of triangles in the shape.
Definition at line 60 of file BulletDskShape.cpp.
| int Isis::BulletDskShape::getNumVertices | ( | ) | const |
Return the number of verticies in the shape.
Definition at line 78 of file BulletDskShape.cpp.
|
virtual |
Get the vertices of a triangle in the mesh.
| index | The index of the triangle in the mesh. |
Definition at line 120 of file BulletDskShape.cpp.
Referenced by getNormal().
|
staticinherited |
Load a DEM file into the target shape.
| dem | The DEM file to load. |
| conf | PVL config for the DEM load. Currently unused. |
Definition at line 85 of file BulletTargetShape.cpp.
References BulletTargetShape(), loadCube(), loadDSK(), and loadPC().
Referenced by Isis::BulletShapeModel::BulletShapeModel(), and Isis::ShapeModelFactory::create().
|
staticinherited |
Load an ISIS cube type DEM in Bullet.
| dem | The DEM file to load. |
| conf | PVL config for the DEM load. Currently unused. |
Definition at line 131 of file BulletTargetShape.cpp.
References BulletTargetShape().
Referenced by load().
|
staticinherited |
Load a DSK in Bullet.
| dem | The DEM file to load. |
| conf | PVL config for the DEM load. Currently unused. |
Definition at line 118 of file BulletTargetShape.cpp.
References BulletTargetShape().
Referenced by load().
|
private |
!
Load the contents of a NAIF DSK and create a Bullet triangle mesh.
Triangular mesh representation of the target shape. The vertex ordering is the same as in the DSK file, except the DSK uses 1-based indexing and this uses 0-based indexing.
Do realtime validation of Bullet mesh limits. Ensure DSK segment shapes fit properly in mesh Bullet parts to enable quantized optimzation.
Bullet limits in the repo are currently set at 4 parts and 134,217,728 triangles. However, that version has not been released since the Aug 2022 commit. Hence, we must ensure that all DSK segment shapes fit into the Bullet mesh mapping scheme which currently has 1024 parts which supports no more than 2,097,152 triangles. At any rate, loading DSKs must consider these limits when mapping to bullet. So quantized optimization for DSK support is limited to at most 1024 segments where each segment has no more than 2,097,152 facets.
This configuration can change in future Bullet releases and may impact use of quantized optimizations for DSKs. Larger DSKs can still (apparently) be used in Bullet if these limits are exceeded but quantized optimzations of the Bullet mesh is disabled for these types of DSKs.
| dskfile | The DSK file to load. |
NAIF DSK parameter setup
< The DAS file handle of the DSK file.
Definition at line 176 of file BulletDskShape.cpp.
References Isis::bt_MaxBodyParts(), Isis::bt_MaxTriangles(), Isis::NaifStatus::CheckErrors(), and Isis::BulletTargetShape::setTargetBody().
Referenced by BulletDskShape().
|
staticinherited |
Load a point cloud type DEM in Bullet.
| dem | The DEM file to load. |
| conf | PVL config for the DEM load. Currently unused. |
Definition at line 106 of file BulletTargetShape.cpp.
References BulletTargetShape().
Referenced by load().
|
inherited |
Definition at line 164 of file BulletTargetShape.cpp.
|
inherited |
Return name of the target shape.
Definition at line 72 of file BulletTargetShape.cpp.
Referenced by Isis::BulletShapeModel::BulletShapeModel(), BulletTargetShape(), and Isis::BulletWorldManager::getTarget().
|
protectedinherited |
Calculate and save the maximum distance across the body.
This is calculated as the distance from the x, y, z minimum to x, y, z maximum.
Definition at line 55 of file BulletTargetShape.cpp.
References m_btbody, and m_maximumDistance.
Referenced by Isis::BulletDskShape::BulletDskShape(), BulletTargetShape(), and setTargetBody().
|
protectedinherited |
Set the Bullet shape object to this object instance.
Definition at line 157 of file BulletTargetShape.cpp.
References body(), m_btbody, and setMaximumDistance().
Referenced by Isis::BulletDskShape::loadFromDsk().
|
inherited |
Write a serialized version of the target shape to a Bullet file.
| btName | The name of the file to write the target shape to. |
Definition at line 142 of file BulletTargetShape.cpp.
|
privateinherited |
!
The name of the body
Definition at line 63 of file BulletTargetShape.h.
Referenced by body(), BulletTargetShape(), setMaximumDistance(), and setTargetBody().
|
private |
Definition at line 49 of file BulletDskShape.h.
|
privateinherited |
!
The Bullet collision object for the body
Definition at line 65 of file BulletTargetShape.h.
Referenced by BulletTargetShape(), and setMaximumDistance().
|
private |
Definition at line 50 of file BulletDskShape.h.
|
privateinherited |
Definition at line 62 of file BulletTargetShape.h.