You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solution File: Collider.cpp
Wrap results calculation in if(...) {}:
bool Collider::raycast(const Ray& ray, RaycastInfo& raycastInfo) {
...
// Convert the raycast info into world-space
if (isHit)
{
raycastInfo.worldPoint = localToWorldTransform * raycastInfo.worldPoint;
raycastInfo.worldNormal = localToWorldTransform.getOrientation() * raycastInfo.worldNormal;
raycastInfo.worldNormal.normalize();
}
...
}
The text was updated successfully, but these errors were encountered:
VitorioK
changed the title
RigidBody::raycast incorrect result in raycastInfo + solution
RigidBody::raycast gives incorrect result in raycastInfo for body with multiply colliders + solution
Sep 30, 2023
VitorioK
changed the title
RigidBody::raycast gives incorrect result in raycastInfo for body with multiply colliders + solution
RigidBody::raycast gives incorrect result in raycastInfo for body with multiple colliders + solution
Sep 30, 2023
Hello. Thanks for your feedback.
I am not sure I understand. Do you mean that the Body::raycast() method returns the raycast result in local-space of the body instead of world-space?
bool isHit = body->raycast(ray, raycastInfo); - gives incorrect results in raycastInfo
Solution
File: Collider.cpp
Wrap results calculation in if(...) {}:
bool Collider::raycast(const Ray& ray, RaycastInfo& raycastInfo) {
...
// Convert the raycast info into world-space
if (isHit)
{
raycastInfo.worldPoint = localToWorldTransform * raycastInfo.worldPoint;
raycastInfo.worldNormal = localToWorldTransform.getOrientation() * raycastInfo.worldNormal;
raycastInfo.worldNormal.normalize();
}
...
}
The text was updated successfully, but these errors were encountered: