Jump to content

ObjectARX:.NET:IntersectsWith() ??


Recommended Posts

Posted

I was wondering if anyone knew of any “collision detection” functions predefined in ObjectARX. The closest I can find is:

 

[font=Courier New][size=2]Public virtual unsafe Function IntersectWith([/size][/font]
[font=Courier New][size=2] entityPointer As Entity, [/size][/font]
[font=Courier New][size=2] intersectType As Autodesk.AutoCAD.DatabaseServices.Intersect, [/size][/font]
[font=Courier New][size=2] points As Point3dCollection, [/size][/font]
[font=Courier New][size=2] thisGraphicSystemMarker As Integer, [/size][/font]
[font=Courier New][size=2] otherGraphicSystemMarker As Integer[/size][/font]
[font=Courier New][size=2]) As void[/size][/font]

 

I believe I know how to use this function, though I get interesting results when I use it. I have a rectangular block and wish to insert blocks in a loop until which time they “collide” with the rectangular block…

 

I banged out a function that checks the geometric extents of the inserted block against the geometric extents of the rectangle and this works fine, though I was hoping for something more…native…I guess…

 

In truth this is how I have done collision detection with Python (wrote a ‘breakout’ game a few years ago while I was on medical leave from work)…

 

Anyhow, when I use ‘IntersectsWith()’ I always get atleast 3 Point3d objects in the points collection, no matter what…hrm…is there something happening here that I am missing?

Posted
I was wondering if anyone knew of any “collision detection” functions predefined in ObjectARX. The closest I can find is:

 

[font=Courier New][size=2]Public virtual unsafe Function IntersectWith([/size][/font]
[font=Courier New][size=2] entityPointer As Entity, [/size][/font]
[font=Courier New][size=2] intersectType As Autodesk.AutoCAD.DatabaseServices.Intersect, [/size][/font]
[font=Courier New][size=2] points As Point3dCollection, [/size][/font]
[font=Courier New][size=2] thisGraphicSystemMarker As Integer, [/size][/font]
[font=Courier New][size=2] otherGraphicSystemMarker As Integer[/size][/font]
[font=Courier New][size=2]) As void[/size][/font]

 

I believe I know how to use this function, though I get interesting results when I use it. I have a rectangular block and wish to insert blocks in a loop until which time they “collide” with the rectangular block…

 

Does “block” mean a block reference inserted into the drawing.

 

 

I banged out a function that checks the geometric extents of the inserted block against the geometric extents of the rectangle and this works fine, though I was hoping for something more…native…I guess…

 

 

If the geometry is actually block like, and the geometric extents accurately establish the perimeter, then I imagine your function would be as fast, or faster, than any native “IntersectWith” implementation.

 

 

In truth this is how I have done collision detection with Python (wrote a ‘breakout’ game a few years ago while I was on medical leave from work)…

 

Anyhow, when I use ‘IntersectsWith()’ I always get atleast 3 Point3d objects in the points collection, no matter what…hrm…is there something happening here that I am missing?

 

I suppose if the geometric extents don’t give accurate enough information then the “IntersectWith” would be the next logical choice.

 

Is the IntersectType enum set to “OnBothOperands”

Posted
Does “block” mean a block reference inserted into the drawing.

 

Yup.

 

If the geometry is actually block like, and the geometric extents accurately establish the perimeter, then I imagine your function would be as fast, or faster, than any native “IntersectWith” implementation.

 

Hrm. I assume(d) that a native function would be more efficient..but then again perhaps I do not give MSVS enough credit...

 

 

I suppose if the geometric extents don’t give accurate enough information then the “IntersectWith” would be the next logical choice.

 

Is the IntersectType enum set to “OnBothOperands”

 

The IntersectType enum has indeed been set to OnBothOperands. *shrug* I have moved on with my own functions for the time being. Thanks for the insight.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...