Raycast method with feedback information Note that only the first triangle hit by the ray in the mesh will be returned, even if the ray hits many triangles.
| 74 | /// Note that only the first triangle hit by the ray in the mesh will be returned, even if |
| 75 | /// the ray hits many triangles. |
| 76 | bool HeightFieldShape::raycast(const Ray& ray, RaycastInfo& raycastInfo, Collider* collider, MemoryAllocator& allocator) const { |
| 77 | |
| 78 | RP3D_PROFILE("HeightFieldShape::raycast()", mProfiler); |
| 79 | |
| 80 | // Apply the collision shape inverse scaling factor because the height-field is stored without scaling |
| 81 | // inside the dynamic AABB tree |
| 82 | const Vector3 inverseScale(decimal(1.0) / mScale.x, decimal(1.0) / mScale.y, decimal(1.0) / mScale.z); |
| 83 | Ray scaledRay(ray.point1 * inverseScale, ray.point2 * inverseScale, ray.maxFraction); |
| 84 | |
| 85 | return mHeightField->raycast(scaledRay, raycastInfo, collider, getRaycastTestType(), allocator, mScale); |
| 86 | } |
| 87 | |
| 88 | // Return the string representation of the shape |
| 89 | std::string HeightFieldShape::to_string() const { |
nothing calls this directly
no outgoing calls
no test coverage detected