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
5
Question by Waz · Sep 13, 2010 at 12:25 AM · collideroncollisionenteroncollisionexit

Maintaining the set of contact points.

I'm trying to maintain the set of contact points that a rigidbody has with any objects in the game (in order to exert some custom forces on them in FixedUpdate), however I cannot understand the relationship between OnCollisionEnter and OnCollisionExit events. My rigidbody has multiple colliders and debugging the Collisions I get to enter and exit events, I don't see a one-to-one correspondence (i.e. there is not an Exit for every Enter, neither for every ContactPoint nor for every thisCollider).

The documentation seems extremely terse and gives no precise information about what events will be sent for any sequence of collision events.

Is there better documentation beyond the statement that the contact points are "The contact points generated by the physics engine"?

Ultimately I need, in FixedUpdate to be able to consider all the current contact points between my rigidbody and other rigidbodies and static colliders in the game (I'll actually try to push heavy calculation to the enter and exit events of course).

Note that I do not want to use OnCollisionStay as that doesn't get sent with sleeping rigidbodies, and I don't want to be doing all the calculation every frame, only when contact points change.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by cjmarsh · May 19, 2011 at 05:59 AM

If you were to only use a sum of spherical triggers for the collision calculation, you could use polar geometry to indicate a vector for every contact point. If you let x = < sin a, cos b, c > where a,b are degrees or radians and c is a number representing magnitude ( distance from the origin of the vector ), the collision sphere is represented by the norm of x. As a result, you could simply assign an xn for the number of spheres you need and compare their corresponding vectors for your points of collision. Hope this helps, Chris.

Comment
Add comment · Show 1 · Share
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 Waz · Jun 21, 2011 at 11:37 PM 0
Share

Sorry, I don't see how this is related to my question. $$anonymous$$y problem is to maintain, given enter and exit events, the list of current contact points. Unity has the list - you can even see it in the profiler.

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

2 People are following this question.

avatar image avatar image

Related Questions

Unity3d Arkanoid platform collision problem 1 Answer

Object Reference Not Set 2 Answers

Weird Collision Detection with a Cube and OnCollisionEnter 2 Answers

Problem in Collider 2 Answers

function for colliding without using rigid body's? 1 Answer


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