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 Foam · Feb 06, 2013 at 04:13 PM · physicscollision detectionphysx

PhysX with own Collision Detection

I have my own collision detection algorithm as using the colliders with Unity on the fly is not acceptable(generating MeshColliders on the fly with complex geometry is pretty slow). This is fine. Standard AABB sweep and all.

However, I don't want to write my own Physics engine as well. Is there a good way to integrate my own collision engine with PhysX? I noticed RigidBodies have an addForce() method but I'm not sure this is going to be sufficient. What I'd really like to hand off a bunch of collisions to the physics engine during each frame with info like interpenetration, mass, etc., and have it handle the physics from there.

Any suggestions?

/edit Anyone? Right now I'm thinking that the physics (that is, velocity and acceleration) could be passed off to PhysX easily enough by using the Unity components and the collision detection portion would handle that PLUS interpenetration resolution.

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 flaviusxvii · Feb 11, 2013 at 09:41 PM 0
Share

I don't think this is possible. Also, you really think you can write collision detection that out performs what's built into PhysX substantially? I actually spent a considerable amount of effort at my last job doing just that, I could beat the Bullet engine by about 15% but could only outdo PhysX by 5-7% or so. And that was disallowing PhysX to offload physics to the GPU. It just seems like you're barking up the wrong tree.

avatar image Foam · Feb 12, 2013 at 12:29 AM 0
Share

flavius, It is not the speed of the collision detection that I am concerned about. Almost all of my meshes are procedurealy generated and can be quite diverse. Using the PhysX collision detection in these cases requires using a $$anonymous$$eshCollider (as far as I can tell) which is extremely slow to generate. Enough to cause a good-sized stutter every time I instantiate a $$anonymous$$esh. I cannot use simpler collision objects as then I'd end up with millions.

With my own custom bounding volume heirarchy I can speed this up by a huge amount in this particular case.

So I figured by doing my own collision detection (easy and fast to do, even if it's not as efficient as PhysX) I can avoid using $$anonymous$$eshColliders.

See what I am getting at?

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

10 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

Related Questions

Physic based golf game - ball bouncing off the connection of colliders on flat surface 2 Answers

The Physics of Ball Spin in Tennis, Topspin and Backspin 3 Answers

OnCollisionEnter isnt called when player lands on object 1 Answer

Collision with rigidbody inside a gameobject 0 Answers

add torque at position 2 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