mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 23:09:52 +02:00
removed dead code
This commit is contained in:
parent
1a1fb18ba1
commit
08092e7abe
1 changed files with 0 additions and 39 deletions
|
@ -478,11 +478,6 @@ bool EntityTreeElement::findDetailedRayIntersection(const glm::vec3& origin, con
|
||||||
void** intersectedObject, bool precisionPicking, float distanceToElementCube) {
|
void** intersectedObject, bool precisionPicking, float distanceToElementCube) {
|
||||||
|
|
||||||
// only called if we do intersect our bounding cube, but find if we actually intersect with entities...
|
// only called if we do intersect our bounding cube, but find if we actually intersect with entities...
|
||||||
|
|
||||||
//qDebug() << "EntityTreeElement::findDetailedRayIntersection()....";
|
|
||||||
//qDebug() << " origin:" << origin;
|
|
||||||
//qDebug() << " distance:" << distance;
|
|
||||||
//qDebug() << " number of entities:" << _entityItems->size();
|
|
||||||
int entityNumber = 0;
|
int entityNumber = 0;
|
||||||
|
|
||||||
QList<EntityItem*>::iterator entityItr = _entityItems->begin();
|
QList<EntityItem*>::iterator entityItr = _entityItems->begin();
|
||||||
|
@ -498,16 +493,9 @@ bool EntityTreeElement::findDetailedRayIntersection(const glm::vec3& origin, con
|
||||||
float localDistance;
|
float localDistance;
|
||||||
BoxFace localFace;
|
BoxFace localFace;
|
||||||
|
|
||||||
//qDebug() << "EntityTreeElement::findDetailedRayIntersection()....";
|
|
||||||
//qDebug() << " checking entity[" << entityNumber << "]:" << entity->getEntityItemID() << "-" << qPrintable(EntityTypes::getEntityTypeName(entity->getType()));
|
|
||||||
//qDebug() << " checking the AABox:" << entityBox;
|
|
||||||
|
|
||||||
// if the ray doesn't intersect with our cube, we can stop searching!
|
// if the ray doesn't intersect with our cube, we can stop searching!
|
||||||
if (entityBox.findRayIntersection(origin, direction, localDistance, localFace)) {
|
if (entityBox.findRayIntersection(origin, direction, localDistance, localFace)) {
|
||||||
|
|
||||||
//qDebug() << " AABox for entity intersects!";
|
|
||||||
//qDebug() << " localDistance:" << localDistance;
|
|
||||||
|
|
||||||
// extents is the entity relative, scaled, centered extents of the entity
|
// extents is the entity relative, scaled, centered extents of the entity
|
||||||
glm::mat4 rotation = glm::mat4_cast(entity->getRotation());
|
glm::mat4 rotation = glm::mat4_cast(entity->getRotation());
|
||||||
glm::mat4 translation = glm::translate(entity->getPosition());
|
glm::mat4 translation = glm::translate(entity->getPosition());
|
||||||
|
@ -525,51 +513,27 @@ bool EntityTreeElement::findDetailedRayIntersection(const glm::vec3& origin, con
|
||||||
|
|
||||||
// we can use the AABox's ray intersection by mapping our origin and direction into the entity frame
|
// we can use the AABox's ray intersection by mapping our origin and direction into the entity frame
|
||||||
// and testing intersection there.
|
// and testing intersection there.
|
||||||
//qDebug() << " checking the entityFrameBox:" << entityFrameBox;
|
|
||||||
|
|
||||||
if (entityFrameBox.findRayIntersection(entityFrameOrigin, entityFrameDirection, localDistance, localFace)) {
|
if (entityFrameBox.findRayIntersection(entityFrameOrigin, entityFrameDirection, localDistance, localFace)) {
|
||||||
//qDebug() << " entityFrameBox intersects!";
|
|
||||||
//qDebug() << " localDistance:" << localDistance;
|
|
||||||
|
|
||||||
if (localDistance < distance) {
|
if (localDistance < distance) {
|
||||||
//qDebug() << " localDistance < distance... continue...";
|
|
||||||
|
|
||||||
// now ask the entity if we actually intersect
|
// now ask the entity if we actually intersect
|
||||||
if (entity->supportsDetailedRayIntersection()) {
|
if (entity->supportsDetailedRayIntersection()) {
|
||||||
|
|
||||||
//qDebug() << " entity->supportsDetailedRayIntersection()....";
|
|
||||||
|
|
||||||
if (entity->findDetailedRayIntersection(origin, direction, keepSearching, element, localDistance,
|
if (entity->findDetailedRayIntersection(origin, direction, keepSearching, element, localDistance,
|
||||||
localFace, intersectedObject, precisionPicking)) {
|
localFace, intersectedObject, precisionPicking)) {
|
||||||
|
|
||||||
//qDebug() << " localDistance (detailed):" << localDistance;
|
|
||||||
|
|
||||||
if (localDistance < distance) {
|
if (localDistance < distance) {
|
||||||
|
|
||||||
//qDebug() << " localDistance < distance...";
|
|
||||||
//qDebug() << " CHOOSING THIS ONE ---> " << entity->getEntityItemID() << "-" << qPrintable(EntityTypes::getEntityTypeName(entity->getType()));
|
|
||||||
|
|
||||||
distance = localDistance;
|
distance = localDistance;
|
||||||
face = localFace;
|
face = localFace;
|
||||||
*intersectedObject = (void*)entity;
|
*intersectedObject = (void*)entity;
|
||||||
somethingIntersected = true;
|
somethingIntersected = true;
|
||||||
} else {
|
|
||||||
//qDebug() << " localDistance >= distance... TOO FAR AWAY";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if the entity type doesn't support a detailed intersection, then just return the non-AABox results
|
// if the entity type doesn't support a detailed intersection, then just return the non-AABox results
|
||||||
if (localDistance < distance) {
|
if (localDistance < distance) {
|
||||||
|
|
||||||
//qDebug() << " localDistance < distance...";
|
|
||||||
//qDebug() << " CHOOSING THIS ONE ---> " << entity->getEntityItemID() << "-" << qPrintable(EntityTypes::getEntityTypeName(entity->getType()));
|
|
||||||
|
|
||||||
distance = localDistance;
|
distance = localDistance;
|
||||||
face = localFace;
|
face = localFace;
|
||||||
*intersectedObject = (void*)entity;
|
*intersectedObject = (void*)entity;
|
||||||
somethingIntersected = true;
|
somethingIntersected = true;
|
||||||
} else {
|
|
||||||
//qDebug() << " localDistance >= distance... TOO FAR AWAY";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -579,9 +543,6 @@ bool EntityTreeElement::findDetailedRayIntersection(const glm::vec3& origin, con
|
||||||
++entityItr;
|
++entityItr;
|
||||||
entityNumber++;
|
entityNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//qDebug() << " EntityTreeElement::findDetailedRayIntersection().... returning somethingIntersected:" << somethingIntersected << "keepSearching:" << keepSearching;
|
|
||||||
|
|
||||||
return somethingIntersected;
|
return somethingIntersected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue