esp::geo namespace

Classes

class CoordinateFrame
class OBB
struct Ray
class VoxelGrid
struct VoxelVertex
class VoxelWrapper
When an object is voxelized, it is given a VoxelWrapper which points to an underlying VoxelGrid and the scene node of the object. This class handles object-specific functionality. Multiple objects will each have there own VoxelWrapper, but each of those VoxelWrappers could share a VoxelGrid if they have the same underlying RenderAssetHandle and Voxel resolution.

Enums

enum class ColorSpace { RGBA, sRGBA, HSV, XYZ }
This enum describes the various colorspaces that colors in Habitat can occupy. This is currently governed by the supported color space conversions built into the Magnum Color types. This is provided for easy user access to these conversion mechansims.
enum class VoxelGridType { Bool, Int, Float, Vector3 }

Functions

void initGeoBindings(pybind11::module& m)
auto espLoggingSubsystem() -> logging::Subsystem
auto operator==(const CoordinateFrame& a, const CoordinateFrame& b) -> bool
auto operator!=(const CoordinateFrame& a, const CoordinateFrame& b) -> bool
auto operator<<(std::ostream& os, const CoordinateFrame& c) -> std::ostream&
auto convexHull2D(const std::vector<vec2f>& points) -> std::vector<vec2f>
auto getTransformedBB(const Magnum::Range3D& range, const Magnum::Matrix4& xform) -> Magnum::Range3D
Compute the axis-aligned bounding box which results from applying a transform to an existing bounding box.
auto getPointDistsAlongTrajectory(const std::vector<Mn::Vector3>& pts) -> std::vector<float>
Return a vector of L2/Euclidean distances of points along a trajectory. First point will always be 0, and last point will give length of trajectory.
auto interp2Points(const Mn::Vector3& a, float ta, const Mn::Vector3& b, float tb, float t) -> Mn::Vector3
Interpolate between two points to find a third at a specified t between them.
auto calcWeightedDistance(const Mn::Vector3& a, const Mn::Vector3& b, float alpha = .5f) -> float
Determine the weighted distance of point b from point a. Used to derive relative knot value for point b as a function of distance from point a for Catmull-Rom spline derivation.
auto buildCatmullRomTrajOfPoints(const std::vector<Mn::Vector3>& pts, int numInterp, float alpha = .5f) -> std::vector<Mn::Vector3>
Build a smooth trajectory of interpolated points from key points along a path using Catmull-Rom Spline of type determined by chosen alpha.
auto buildTrajectoryTubeSolid(const std::vector<Mn::Vector3>& pts, const std::vector<Mn::Color3>& interpColors, int numSegments, float radius, bool smooth, int numInterp, ColorSpace clrSpace = ColorSpace::HSV) -> Mn::Trade::MeshData
Build a mesh representing a tube of given radius around the trajectory given by the passed points. Will either build cylinders between each pair of points in pts, or between sequential points in a smoothed trajectory derived using centripetal Catmull-Rom spline between points in pts.
auto getColorAsString(const Magnum::Color3ub& color) -> std::string
Returns a nicely formatted hex string representation of color.
template<class T>
auto getValueAsUInt(T color) -> uint32_t
Return an unsigned int encoding of passed color value.
auto getValueAsUInt(const Mn::Color3ub& color) -> uint32_t
Return an unsigned int encoding of passed color for type Mn::Color3ub.
auto getValueAsUInt(const Mn::Color4ub& color) -> uint32_t
Return an unsigned int encoding of passed color for type Mn::Color4ub.
auto getValueAsUInt(int color) -> uint32_t
Return an unsigned int encoding of passed color for type int - provided to support vector of per-vertex IDs .
auto buildAdjList(int numVerts, const std::vector<uint32_t>& indexBuffer) -> std::vector<std::set<uint32_t>>
Build an adjacency list using the passed index buffer. Assumes each sequence of 3 indices describesd a poly.
template<class T>
void conditionalDFS(const std::vector<std::set<uint32_t>>& adjList, const std::vector<T>& clrVec, uint32_t vIDX, std::vector<bool>& visited, const T& clr, std::set<uint32_t>& setOfVerts)
Build a connected component recursively on an unconnected graph (i.e. mesh vertices), building from passed vIDX from adjecent verts that match the passed clr value, which can be any per-vertex identifier or tag.
template<class T>
auto findCCsByGivenColor(const std::vector<std::set<uint32_t>>& adjList, const std::vector<T>& clrVec) -> std::unordered_map<uint32_t, std::vector<std::set<uint32_t>>>
Find and return all connected components in a graph (represented by the adjList ), that match some specified per-vertex tag/"color".
template<typename T>
auto clamp(const T& n, const T& low, const T& high) -> T
auto operator<<(std::ostream& os, const OBB& obb) -> std::ostream&
auto computeGravityAlignedMOBB(const vec3f& gravity, const std::vector<vec3f>& points) -> OBB
void generateInteriorExteriorVoxelGrid(std::shared_ptr<esp::geo::VoxelWrapper>& voxelWrapper)
Generates an integer grid registered under "InteriorExterior" which stores +inf for exterior cells, -inf for interior cells, and 0 for Boundary cells.
void generateManhattanDistanceSDF(std::shared_ptr<esp::geo::VoxelWrapper>& voxelWrapper, const std::string& gridName)
Generates a signed distance field using manhattan distance as a distance metric.
void generateEuclideanDistanceSDF(std::shared_ptr<esp::geo::VoxelWrapper>& voxelWrapper, const std::string& gridName)
Generates a signed distance field using euclidean distance as a distance metric. Also created a "ClosestBoundaryCell" vector3 grid which holds the index of the closest Boundary grid.
void generateScalarGradientField(std::shared_ptr<esp::geo::VoxelWrapper>& voxelWrapper, const std::string& scalarGridName, const std::string& gradientGridName)
Generates a Vector3 field where each vector of a cell is the gradient of how the scalar field changes.
template<typename T>
void generateScalarGradientField(std::shared_ptr<esp::geo::VoxelWrapper>& voxelWrapper, const std::string& scalarGridName, const std::string& gradientGridName)
Generates a Vector3 field where each vector of a cell is the gradient of how the scalar field changes.
auto getVoxelSetFromBoolGrid(std::shared_ptr<esp::geo::VoxelWrapper>& voxelWrapper, const std::string& boolGridName) -> std::vector<Mn::Vector3i>
Returns a vector of all filled/true voxels.
auto getVoxelSetFromIntGrid(std::shared_ptr<esp::geo::VoxelWrapper>& voxelWrapper, const std::string& intGridName, int lb, int ub) -> std::vector<Mn::Vector3i>
Fills a vector with voxel indices that meet some criteria.
auto getVoxelSetFromFloatGrid(std::shared_ptr<esp::geo::VoxelWrapper>& voxelWrapper, const std::string& floatGridName, float lb, float ub) -> std::vector<Mn::Vector3i>
Fills a vector with voxel indices that meet some criteria.

Variables

static const vec3f ESP_UP
global/world up direction
static const vec3f ESP_GRAVITY
global/world gravity (down) direction
static const vec3f ESP_FRONT
global/world front direction
static const vec3f ESP_BACK
global/world back direction