Search in sources :

Example 16 with SpatialInertia

use of maspack.spatialmotion.SpatialInertia in project artisynth_core by artisynth.

the class RigidCompositeBody method addMeshInertia.

protected void addMeshInertia(MeshBase base, double density) {
    if (base == null) {
        throw new IllegalStateException("Mesh has not been set");
    }
    if (base instanceof PolygonalMesh) {
        PolygonalMesh mesh = (PolygonalMesh) base;
        SpatialInertia M = mesh.createInertia(density);
        mySpatialInertia.add(M);
    } else if (base instanceof PointMesh) {
    // XXX to implement
    } else if (base instanceof PolylineMesh) {
    // XXX to implement
    }
}
Also used : PointMesh(maspack.geometry.PointMesh) PolylineMesh(maspack.geometry.PolylineMesh) PolygonalMesh(maspack.geometry.PolygonalMesh) SpatialInertia(maspack.spatialmotion.SpatialInertia)

Aggregations

SpatialInertia (maspack.spatialmotion.SpatialInertia)16 Point3d (maspack.matrix.Point3d)4 Twist (maspack.spatialmotion.Twist)4 Wrench (maspack.spatialmotion.Wrench)4 PolygonalMesh (maspack.geometry.PolygonalMesh)3 Point (artisynth.core.mechmodels.Point)2 Quaternion (maspack.matrix.Quaternion)2 Vector3d (maspack.matrix.Vector3d)2 PointMesh (maspack.geometry.PointMesh)1 PolylineMesh (maspack.geometry.PolylineMesh)1 Matrix3x3Block (maspack.matrix.Matrix3x3Block)1 Matrix3x6Block (maspack.matrix.Matrix3x6Block)1 Matrix6dBlock (maspack.matrix.Matrix6dBlock)1 Matrix6x3Block (maspack.matrix.Matrix6x3Block)1 MatrixBlock (maspack.matrix.MatrixBlock)1 RigidTransform3d (maspack.matrix.RigidTransform3d)1 RotationMatrix3d (maspack.matrix.RotationMatrix3d)1 SymmetricMatrix3d (maspack.matrix.SymmetricMatrix3d)1