Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by NoUJoe · Apr 11, 2015 at 02:43 PM · physicsnormalsnormalspherecast

SphereCast hitting edge of collider, returning "random" normal directions

alt text

The green line represents the centre of the spherecast, the radius of the spherecast is currently 0.2. The pink line is the hit normal, coming out from the hit point. As you can see, the hit point on the edge of the collider and the direction returned is not perpendicular to any of the sides of the box collider. The only time it returns a "correct" direction is when the whole of the spherecast intersects with one of the faces. The closer the center of the cast (green) is to the edge, the more the direction (pink) faces the floor.

Now I do get it, I get why it would be hitting the edge, but come on, that's terrible, The point of a surface normal is to return the normal of the surface, aka the polygon.

This is a huge problem and if this is an intended feature of physx then shame on them. Anyone had this problem hold them back? Any solutions? I need to spherecast, I cannot use a raycast.

spherecast-problem.png (217.6 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image NoUJoe · Apr 13, 2015 at 02:05 PM 0
Share

No one? :( a very sad day

avatar image hexagonius · Apr 13, 2015 at 03:54 PM 0
Share

The hit.normal is kind of the opposite direction of where the collision came from. Since you're spherecasting into or near an edge it seem's it's getting interpolated because of the volumetric nature of a sphere and a cube. It's about choice what one would define as "THE" contact point or surface normal when there's volumes and not points.

The only way I could do this was to get one contactpoint, or the center in between all of them and raycast against that point on the hit collider the get the surface normal for that particular point.

So solution: Raycast only for surface normals. (Or comparing adjacent mesh normals with localized collision point yourself ;) )

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Spherecast Arguments 1 Answer

RaycastHit.normal - what does it really return? 4 Answers

2D 360 degress platformer example needed 0 Answers

How do I obtain the surface normal for a point on a collider (can't use RaycastHit.normal)? 3 Answers

SphereCastAll return individual surface normals 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges