Jump to content

Linepick and entity type


Icare
 Share

Recommended Posts

Hi !

 

who can explain to me why my code doesn't work ?

If I set the entitytype of the sphere to 20, and the filter too, there isn't result of the linepick, if I set it to 0 it's ok....

 

local sphere:tmesh=createsphere()

EntityType(sphere, 20, 1)

 

Print GetEntityType(sphere)

 

Local pick:TPick = LinePick(Vec3(0, 0, -5), Vec3(0, 0, 10), 0, 20)

If pick <> Null Then

Print "ok"

End If

 

thank,

 

Nicolas

Link to comment
Share on other sites

The collision type parameter works as follows: Imagine the pick-ray being a physical body with the specified collision type that flies in the pick direction. It'll stop at the first mesh it hits that has a collision type which would collide with it's type. Therefore, for the pick type parameter to work, Collisions must have been used to set up any type (response type doesn't matter) of collision between the pick's type and the mesh's type. So after calling (for example) Collsions(1,2), a pick of type 2 will hit meshes of type 1 and the other way around.

 

In other words you need to specify which Collisions you want.

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Link to comment
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...