Jump to content
  • Advertisement
shintiger

From OBB-OBB intersection test to Sweep OBB test?

Recommended Posts

I understand what stationary OBB intersection test is get min/max scalar in 15 axises, when all overlap, then minimum interval overlapping is the axis that used to push away 2 OBBs to "just touch". I have complete this.

So in sweep test, how to choose the right axis projecting and how every projection transform? I only need a ratio of current velocity when start intersect from disjoint.

I have read Ron Levine's post:

http://www.realtimecollisiondetection.net/files/levine_swept_sat.txt

 

And oliii's:

I get the code but cannot get it works as expect when port to my project, even I don't clearly know what params refer to.

 

For further optimization, I wish somebody can teach me how velocity part works conceptually instead of just code.

My case is DOBB-OBB only(dynamic to stationary).

Edited by shintiger

Share this post


Link to post
Share on other sites
Advertisement

You cannot form a simple equation and solve it if your OBBs carry angular velocity.

Otherwise, conceptually, finding a time of impact (TOI) along a given axis can be done by simple linear interpolation. For example, say we have a point A traveling along a velocity V at a plane P. It is possible to do:

d0 = Distance(A, P);
d1 = Distance(A + V * dt, P);

Then d0 and d1 can be used to lerp from A to A * V + dt by forming the interpolant: d0 / (d0 - d1).

The same concept can apply to any axis and any given point, even axes and points on the surface of OBBs.

Edited by Randy Gaul

Share this post


Link to post
Share on other sites

I got it now, sweep OBB is almost as same as sweep AABB, except two things:

1. 15 axis rather than xyz

2. each axis test may using scalar representation rather than simple xyz diff

 

And I have just finish this part, thanks Randy.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
  • Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By scullsold
      Hi I read some tutorials on STL as many people on this forum say it's faster than the most selfwritten container classes and somehow i can't even declare a list in VC .net 2003...the compiler says: Compiling... VertexManager.cpp c:\Dokumente und Einstellungen\gregor\Eigene Dateien\nGin\VertexManager.h(33) : error C2143: syntax error : missing ';' before '<' c:\Dokumente und Einstellungen\gregor\Eigene Dateien\nGin\VertexManager.h(33) : error C2501: 'CVertexManager::list' : missing storage-class or type specifiers c:\Dokumente und Einstellungen\gregor\Eigene Dateien\nGin\VertexManager.h(33) : error C2238: unexpected token(s) preceding ';' c:\Dokumente und Einstellungen\gregor\Eigene Dateien\nGin\VertexManager.h(34) : error C2143: syntax error : missing ';' before '<' c:\Dokumente und Einstellungen\gregor\Eigene Dateien\nGin\VertexManager.h(34) : error C2501: 'CVertexManager::list' : missing storage-class or type specifiers c:\Dokumente und Einstellungen\gregor\Eigene Dateien\nGin\VertexManager.h(34) : error C2238: unexpected token(s) preceding ';' c:\Dokumente und Einstellungen\gregor\Eigene Dateien\nGin\VertexManager.h(35) : error C2143: syntax error : missing ';' before '<' c:\Dokumente und Einstellungen\gregor\Eigene Dateien\nGin\VertexManager.h(35) : error C2501: 'CVertexManager::list' : missing storage-class or type specifiers my code: class CVertexManager { private: list<VertListEntry> VertList; list<VertGroup> VertGroup; list<int> TextureChange; CVertexManager(); public: ~CVertexManager(); void addEntry(VertListEntry Entry); static CVertexManager& Instance() { static CVertexManager TheOneAndOnly; return CVertexManager; } }; btw what does the list.insert function want as the first parameter? it says something with iterator...what is that? can i just pass an int as the number where i want to have the new entry? regards, m4gnus  
    • By Xerath Dragons
      This is my first experiment use for create my original character little cute dragon chibi use zbrush and blender and use unity3d assest free for enviroment scene you have feedback?
       


    • By CocoaColetto
      I am basically brand new to the gaming industry business wise although I have been a gamer for years. I officially started my game publishing company, and being as though I am only 20, I have no connects to the gaming industry. Of course, I'm still going to do more internet research, but I thought why not ask folks who may have business hands in the gaming community? If anyone is questioning, my game prototype is basically done (I designed it myself) and its very detailed and I am going to start searching for a team to help me build it. Thank you. 
    • By recp
      Hello,
      How can I get center of scene or node or model? What is best way to do this? Scene structure:
      Scene   |   o - Node[s]            |            o - Model[s] // Mesh                       |                       o - Primitive[s] // Sub-Mesh                                    |                                    o local AABB and world AABB I'm using AABB's center as center of primitive and I'm combining all AABB boxes to build an AABB for scene. When I visualized the boxes it seems work as expected. 
      But I need to get center of scene, node or model for apply rotation around center. Because I'm using a trackball for rotating attached node or model. Currently I'm using scene's AABB's center as rotation point (pivot), for single object it is working. After rotation is completed center of primitive remains same which it should be, I think. But if I load a scene which contains multiple models or primitives, after rotation is completed center of scene's AABB is moving (I'm using that as center of scene). Because every time rotation is completed, new AABB is calculated for scene by combining all sub AABB boxes. I think this may be a normal because there is no balance between AABB boxes while rotating. For instance if I use two same CUBE without rotations center of new scene's AABB remains same.
      My solution (it seems work for now):
      I created new center member (vec3) in scene struct:
      scene->center    = vec3(0); scene->primCount = 0; for prim in primitivesInFrustum    scene->center += prim->aabb->center;    scene->primCount++; scene->center = scene->center / scene->primCount Now I'm using this center as center of scene instead of scene->aabb->center and it seems work.
      My question is that what is best way to get center of scene, node or model? How do you get the center for rotation? Any suggestions? Am I doing right? 
      Thanks
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!