mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-18 10:16:47 +02:00
Check mesh extend before going through triangles
This commit is contained in:
parent
99fd590a90
commit
bda72025af
2 changed files with 5 additions and 1 deletions
|
@ -1060,7 +1060,7 @@ float EntityItem::getRadius() const {
|
|||
return 0.5f * glm::length(_dimensions);
|
||||
}
|
||||
|
||||
bool EntityItem::contains(const glm::vec3 &point) const {
|
||||
bool EntityItem::contains(const glm::vec3& point) const {
|
||||
switch (getShapeType()) {
|
||||
case SHAPE_TYPE_BOX: {
|
||||
// Transform point to be in a space where the box is a 1m cube centered on the origin.
|
||||
|
|
|
@ -127,6 +127,10 @@ Extents FBXGeometry::getUnscaledMeshExtents() const {
|
|||
|
||||
// TODO: Move to model::Mesh when Sam's ready
|
||||
bool FBXGeometry::convexHullContains(const glm::vec3& point) const {
|
||||
if (!getUnscaledMeshExtents().containsPoint(point)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto checkEachPrimitive = [=](FBXMesh& mesh, QVector<int> indices, int primitiveSize) -> bool {
|
||||
// Check whether the point is "behind" all the primitives.
|
||||
for (unsigned int j = 0; j < indices.size(); j += primitiveSize) {
|
||||
|
|
Loading…
Reference in a new issue