ray intersection information extraction
ray intersection information extraction
(OP)
hi
I am trying to fire ray and find out the intersection wit the parts. However I want to know if the ray is entering or exiting. The help document says that the intersection type that is returned is "OR'd". I am not sure what this means. How can I extract the information from the results? The help description is as follows
"(long) intersectionType type of intersection found. Refer to swRayPtsResults_e . Entry/Exit information (swRayPtsResultsENTER and swRayPtsResultsEXIT) will only be returned when swRayPtsOptsENTRY_EXIT is specified in the options argument in the ModelDoc2::RayIntersections call) If more than one intersection type is found, then the intersectionType will contain an OR'd set of values from the swRayPtsResults_e enumeration.
"
I am trying to fire ray and find out the intersection wit the parts. However I want to know if the ray is entering or exiting. The help document says that the intersection type that is returned is "OR'd". I am not sure what this means. How can I extract the information from the results? The help description is as follows
"(long) intersectionType type of intersection found. Refer to swRayPtsResults_e . Entry/Exit information (swRayPtsResultsENTER and swRayPtsResultsEXIT) will only be returned when swRayPtsOptsENTRY_EXIT is specified in the options argument in the ModelDoc2::RayIntersections call) If more than one intersection type is found, then the intersectionType will contain an OR'd set of values from the swRayPtsResults_e enumeration.
"






RE: ray intersection information extraction
swRayPtsOptsNORMALS - Output of normals requested
swRayPtsOptsTOPOLS - Output of entities hit requested
swRayPtsOptsENTRY_EXIT - Output requested of whether ray was entering or exiting body when it hit
swRayPtsOptsUNBLOCK - Allow the system to respond while waiting
i dont have much experience with this command but i hope this helps a little...
Regards,
Jon
jgbena@yahoo.com
RE: ray intersection information extraction
thanks for your reply. I know I have to concatenate. My question was regarding how to decipher the entry exit points from the reult. I get some result definately. It says it will be "OR'd" I don't know the meaning of this term.
anyways thanks for the reply. If anybody knows how to decipher the result please let me know
thanks
nikhil
RE: ray intersection information extraction
basically, a whole bunch of information is being returned in the long integer. In an Int or long, you can express the number as bits(boolean) where bit 0=1, bit1=2, bit 2=4, bit 3=8, etc, etc.
example: 00000001 binary = 1 decimal
00000011 binary = 3 decimal (bit 0 AND bit 1 are true) (bit 0 OR bit 1 are true)
so, by having each of many values equal to a power of 2, you can get many true/false values from one return number.
RE: ray intersection information extraction
thanks for the tip. However the problem is how to reverse the process. How should I get the booleans out of a long when long is a result of the OR operation on few booleans.
any tips will be helpful
thanks
nikhil