mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 00:54:08 +02:00
Syntax fixes
This commit is contained in:
parent
d01dda9c81
commit
8d39f9c760
6 changed files with 16 additions and 16 deletions
examples/painting/whiteboard
libraries
entities-renderer/src
entities/src
octree/src
|
@ -52,7 +52,7 @@
|
|||
origin: handPosition,
|
||||
direction: Quat.getUp(this.getHandRotation())
|
||||
};
|
||||
this.intersection = Entities.findRayIntersection(pickRay, true);
|
||||
this.intersection = Entities.findRayIntersection(pickRay, true, [this.entityID]);
|
||||
if (this.intersection.intersects) {
|
||||
if(JSON.stringify(this.intersection.entityID) === JSON.stringify(this.entityID)) {
|
||||
print('YAAAAA')
|
||||
|
|
|
@ -482,7 +482,7 @@ void EntityTreeRenderer::deleteReleasedModels() {
|
|||
}
|
||||
|
||||
RayToEntityIntersectionResult EntityTreeRenderer::findRayIntersectionWorker(const PickRay& ray, Octree::lockType lockType,
|
||||
bool precisionPicking) {
|
||||
bool precisionPicking, const QVector<QUuid>& entityIdsToInclude) {
|
||||
RayToEntityIntersectionResult result;
|
||||
if (_tree) {
|
||||
EntityTreePointer entityTree = std::static_pointer_cast<EntityTree>(_tree);
|
||||
|
@ -490,7 +490,7 @@ RayToEntityIntersectionResult EntityTreeRenderer::findRayIntersectionWorker(cons
|
|||
OctreeElementPointer element;
|
||||
EntityItemPointer intersectedEntity = NULL;
|
||||
result.intersects = entityTree->findRayIntersection(ray.origin, ray.direction, element, result.distance,
|
||||
result.face, result.surfaceNormal,
|
||||
result.face, result.surfaceNormal, entityIdsToInclude,
|
||||
(void**)&intersectedEntity, lockType, &result.accurate,
|
||||
precisionPicking);
|
||||
if (result.intersects && intersectedEntity) {
|
||||
|
|
|
@ -130,7 +130,7 @@ private:
|
|||
|
||||
QList<Model*> _releasedModels;
|
||||
RayToEntityIntersectionResult findRayIntersectionWorker(const PickRay& ray, Octree::lockType lockType,
|
||||
bool precisionPicking);
|
||||
bool precisionPicking, const QVector<QUuid>& entityIdsToInclude = QVector<QUuid>());
|
||||
|
||||
EntityItemID _currentHoverOverEntityID;
|
||||
EntityItemID _currentClickingOnEntityID;
|
||||
|
|
|
@ -279,17 +279,17 @@ QVector<QUuid> EntityScriptingInterface::findEntitiesInBox(const glm::vec3& corn
|
|||
return result;
|
||||
}
|
||||
|
||||
RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersection(const PickRay& ray, const QVector<QUuid>& entityIdsToIgnore, bool precisionPicking) {
|
||||
return findRayIntersectionWorker(ray, Octree::TryLock, entityIdsToIgnore, precisionPicking);
|
||||
RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersection(const PickRay& ray, bool precisionPicking, const QVector<QUuid>& entityIdsToInclude) {
|
||||
return findRayIntersectionWorker(ray, Octree::TryLock, precisionPicking, entityIdsToInclude);
|
||||
}
|
||||
|
||||
RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionBlocking(const PickRay& ray, const QVector<QUuid>& entityIdsToIgnore, bool precisionPicking) {
|
||||
return findRayIntersectionWorker(ray, Octree::Lock, entityIdsToIgnore, precisionPicking);
|
||||
RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionBlocking(const PickRay& ray, bool precisionPicking, const QVector<QUuid>& entityIdsToInclude) {
|
||||
return findRayIntersectionWorker(ray, Octree::Lock, precisionPicking, entityIdsToInclude);
|
||||
}
|
||||
|
||||
RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorker(const PickRay& ray,
|
||||
Octree::lockType lockType, const QVector<QUuid>& entityIdsToIgnore,
|
||||
bool precisionPicking) {
|
||||
Octree::lockType lockType,
|
||||
bool precisionPicking, const QVector<QUuid>& entityIdsToInclude) {
|
||||
|
||||
|
||||
RayToEntityIntersectionResult result;
|
||||
|
@ -297,7 +297,7 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorke
|
|||
OctreeElementPointer element;
|
||||
EntityItemPointer intersectedEntity = NULL;
|
||||
result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, element, result.distance, result.face,
|
||||
result.surfaceNormal, (void**)&intersectedEntity, lockType, &result.accurate,
|
||||
result.surfaceNormal, entityIdsToInclude, (void**)&intersectedEntity, lockType, &result.accurate,
|
||||
precisionPicking);
|
||||
if (result.intersects && intersectedEntity) {
|
||||
result.entityID = intersectedEntity->getEntityItemID();
|
||||
|
|
|
@ -111,11 +111,11 @@ public slots:
|
|||
/// If the scripting context has visible entities, this will determine a ray intersection, the results
|
||||
/// may be inaccurate if the engine is unable to access the visible entities, in which case result.accurate
|
||||
/// will be false.
|
||||
Q_INVOKABLE RayToEntityIntersectionResult findRayIntersection(const PickRay& ray, const QVector<QUuid>& entityIdsToInclude, bool precisionPicking = false);
|
||||
Q_INVOKABLE RayToEntityIntersectionResult findRayIntersection(const PickRay& ray, bool precisionPicking = false, const QVector<QUuid>& entityIdsToInclude = QVector<QUuid>());
|
||||
|
||||
/// If the scripting context has visible entities, this will determine a ray intersection, and will block in
|
||||
/// order to return an accurate result
|
||||
Q_INVOKABLE RayToEntityIntersectionResult findRayIntersectionBlocking(const PickRay& ray, const QVector<QUuid>& entityIdsToInclude, bool precisionPicking = false);
|
||||
Q_INVOKABLE RayToEntityIntersectionResult findRayIntersectionBlocking(const PickRay& ray, bool precisionPicking = false, const QVector<QUuid>& entityIdsToInclude = QVector<QUuid>());
|
||||
|
||||
Q_INVOKABLE void setLightsArePickable(bool value);
|
||||
Q_INVOKABLE bool getLightsArePickable() const;
|
||||
|
@ -185,8 +185,8 @@ private:
|
|||
|
||||
|
||||
/// actually does the work of finding the ray intersection, can be called in locking mode or tryLock mode
|
||||
RayToEntityIntersectionResult findRayIntersectionWorker(const PickRay& ray, Octree::lockType lockType, const QVector<QUuid>& entityIdsToInclude,
|
||||
bool precisionPicking);
|
||||
RayToEntityIntersectionResult findRayIntersectionWorker(const PickRay& ray, Octree::lockType lockType,
|
||||
bool precisionPicking, const QVector<QUuid>& entityIdsToInclude);
|
||||
|
||||
EntityTreePointer _entityTree;
|
||||
EntitiesScriptEngineProvider* _entitiesScriptEngine = nullptr;
|
||||
|
|
|
@ -300,7 +300,7 @@ public:
|
|||
|
||||
bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||
OctreeElementPointer& node, float& distance, BoxFace& face, glm::vec3& surfaceNormal,
|
||||
const QVector<QUuid>& entityIdsToInclude,
|
||||
const QVector<QUuid>& entityIdsToInclude = QVector<QUuid>(),
|
||||
void** intersectedObject = NULL,
|
||||
Octree::lockType lockType = Octree::TryLock,
|
||||
bool* accurateResult = NULL,
|
||||
|
|
Loading…
Reference in a new issue