Browse Source

Make RayQueryResult::subObject_ signed

1vanK 3 years ago
parent
commit
11e6d453d1

+ 2 - 2
Source/Urho3D/AngelScript/Generated_Members.h

@@ -3836,8 +3836,8 @@ template <class T> void RegisterMembers_RayQueryResult(asIScriptEngine* engine,
     // float RayQueryResult::distance_
     engine->RegisterObjectProperty(className, "float distance", offsetof(T, distance_));
 
-    // unsigned RayQueryResult::subObject_
-    engine->RegisterObjectProperty(className, "uint subObject", offsetof(T, subObject_));
+    // i32 RayQueryResult::subObject_
+    engine->RegisterObjectProperty(className, "int subObject", offsetof(T, subObject_));
 
     #ifdef REGISTER_MEMBERS_MANUAL_PART_RayQueryResult
         REGISTER_MEMBERS_MANUAL_PART_RayQueryResult();

+ 1 - 1
Source/Urho3D/Graphics/AnimatedModel.cpp

@@ -156,7 +156,7 @@ void AnimatedModel::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQuery
     const Vector<Bone>& bones = skeleton_.GetBones();
     Sphere boneSphere;
 
-    for (unsigned i = 0; i < bones.Size(); ++i)
+    for (i32 i = 0; i < bones.Size(); ++i)
     {
         const Bone& bone = bones[i];
         if (!bone.node_)

+ 1 - 1
Source/Urho3D/Graphics/BillboardSet.cpp

@@ -130,7 +130,7 @@ void BillboardSet::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQueryR
     Matrix3x4 billboardTransform = relative_ ? worldTransform : Matrix3x4::IDENTITY;
     Vector3 billboardScale = scaled_ ? worldTransform.Scale() : Vector3::ONE;
 
-    for (unsigned i = 0; i < billboards_.Size(); ++i)
+    for (i32 i = 0; i < billboards_.Size(); ++i)
     {
         if (!billboards_[i].enabled_)
             continue;

+ 2 - 2
Source/Urho3D/Graphics/CustomGeometry.cpp

@@ -80,7 +80,7 @@ void CustomGeometry::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQuer
         {
             distance = M_INFINITY;
 
-            for (unsigned i = 0; i < batches_.Size(); ++i)
+            for (i32 i = 0; i < batches_.Size(); ++i)
             {
                 Geometry* geometry = batches_[i].geometry_;
                 if (geometry)
@@ -104,7 +104,7 @@ void CustomGeometry::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQuer
             result.distance_ = distance;
             result.drawable_ = this;
             result.node_ = node_;
-            result.subObject_ = M_MAX_UNSIGNED;
+            result.subObject_ = NINDEX;
             results.Push(result);
         }
     }

+ 1 - 1
Source/Urho3D/Graphics/Drawable.cpp

@@ -102,7 +102,7 @@ void Drawable::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQueryResul
         result.distance_ = distance;
         result.drawable_ = this;
         result.node_ = GetNode();
-        result.subObject_ = M_MAX_UNSIGNED;
+        result.subObject_ = NINDEX;
         results.Push(result);
     }
 }

+ 1 - 1
Source/Urho3D/Graphics/Light.cpp

@@ -195,7 +195,7 @@ void Light::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQueryResult>&
     result.distance_ = distance;
     result.drawable_ = this;
     result.node_ = node_;
-    result.subObject_ = M_MAX_UNSIGNED;
+    result.subObject_ = NINDEX;
     results.Push(result);
 }
 

+ 1 - 1
Source/Urho3D/Graphics/OctreeQuery.h

@@ -201,7 +201,7 @@ struct URHO3D_API RayQueryResult
     /// Scene node.
     Node* node_;
     /// Drawable specific subobject if applicable.
-    unsigned subObject_{};
+    i32 subObject_{};
 };
 
 /// Raycast octree query.

+ 1 - 1
Source/Urho3D/Graphics/RibbonTrail.cpp

@@ -120,7 +120,7 @@ void RibbonTrail::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQueryRe
         return;
 
     // Approximate the tails as spheres for raycasting
-    for (unsigned i = 0; i < points_.Size() - 1; ++i)
+    for (i32 i = 0; i < points_.Size() - 1; ++i)
     {
         Vector3 center = (points_[i].position_ + points_[i+1].position_) * 0.5f;
         Vector3 scale = width_ * Vector3::ONE;

+ 2 - 2
Source/Urho3D/Graphics/StaticModel.cpp

@@ -70,13 +70,13 @@ void StaticModel::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQueryRe
         float distance = localRay.HitDistance(boundingBox_);
         Vector3 normal = -query.ray_.direction_;
         Vector2 geometryUV;
-        unsigned hitBatch = M_MAX_UNSIGNED;
+        i32 hitBatch = NINDEX;
 
         if (level >= RAY_TRIANGLE && distance < query.maxDistance_)
         {
             distance = M_INFINITY;
 
-            for (unsigned i = 0; i < batches_.Size(); ++i)
+            for (i32 i = 0; i < batches_.Size(); ++i)
             {
                 Geometry* geometry = batches_[i].geometry_;
                 if (geometry)

+ 1 - 1
Source/Urho3D/Graphics/StaticModelGroup.cpp

@@ -99,7 +99,7 @@ void StaticModelGroup::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQu
     if (query.ray_.HitDistance(GetWorldBoundingBox()) >= query.maxDistance_)
         return;
 
-    for (unsigned i = 0; i < numWorldTransforms_; ++i)
+    for (i32 i = 0; i < numWorldTransforms_; ++i)
     {
         // Initial test using AABB
         float distance = query.ray_.HitDistance(boundingBox_.Transformed(worldTransforms_[i]));

+ 1 - 1
Source/Urho3D/Graphics/TerrainPatch.cpp

@@ -84,7 +84,7 @@ void TerrainPatch::ProcessRayQuery(const RayOctreeQuery& query, Vector<RayQueryR
                 result.distance_ = distance;
                 result.drawable_ = this;
                 result.node_ = node_;
-                result.subObject_ = M_MAX_UNSIGNED;
+                result.subObject_ = NINDEX;
                 results.Push(result);
             }
         }