esp::assets::CollisionMeshData struct

Provides references to geometry and topology for an individual component of an asset for use in generating collision shapes for simulation.

Contents

Usage: (1) for creating collision mesh/convex in physics::BulletPhysicsManager and physics::BulletRigidObject

Public variables

Magnum::MeshPrimitive primitive
Primitive type (has to be triangle for Bullet to work).
Corrade::Containers::ArrayView<Magnum::Vector3> positions
Reference to vertex positions.
Corrade::Containers::ArrayView<Magnum::UnsignedInt> indices
Reference to vertex indices.

Variable documentation

Magnum::MeshPrimitive esp::assets::CollisionMeshData::primitive

Primitive type (has to be triangle for Bullet to work).

See BulletRigidObject::constructBulletCompoundFromMeshes.

Corrade::Containers::ArrayView<Magnum::Vector3> esp::assets::CollisionMeshData::positions

Reference to vertex positions.

Bullet requires positions to be stored in a contiguous array, but MeshData usually doesn't store them like that (and moreover the data might be packed to smaller type). Thus the data are unpacked into a contiguous array which is then referenced here.

Corrade::Containers::ArrayView<Magnum::UnsignedInt> esp::assets::CollisionMeshData::indices

Reference to vertex indices.

If a MeshData already stores indices in desired type, this view references them. If not (for example because indices are packed to a smaller type), the data are unpacked to an internal data store and this view references that instead.