Naughty Alien Posted July 28, 2010 Posted July 28, 2010 ..simple..why this code doesnt return any pick when i select different pick types, while without pick type definition, everything works..so.. why this works: Local plane:TMesh = createcube() ScaleEntity(plane, Vec3(10, 10, .01)) EntityColor(plane, Vec3(1, 1, 0)) EntityType(plane, 1) Local cube:Tmesh = createcube() MoveEntity(cube, Vec3(0, 0, -5)) EntityColor(cube, Vec3(1, 0, 0)) EntityType(cube, 2) Global pick:TPick While Not KeyHit(KEY_ESCAPE) fw.update() fw.Render() pick = CameraPick(fw.Main.camera, Vec3(MouseX(), MouseY(), 1000)) If pick <> Null If pick.entity = plane DrawText"PLANE PICKED", 10, 10 If pick.entity = cube DrawText"CUBE PICKED", 10, 40 End If Flip(0) Wend End ..and this, entirely same code, just with selection of collision type i want to detect, doesn't ? Local plane:TMesh = createcube() ScaleEntity(plane, Vec3(10, 10, .01)) EntityColor(plane, Vec3(1, 1, 0)) EntityType(plane, 1) Local cube:Tmesh = createcube() MoveEntity(cube, Vec3(0, 0, -5)) EntityColor(cube, Vec3(1, 0, 0)) EntityType(cube, 2) Global pick:TPick While Not KeyHit(KEY_ESCAPE) fw.update() fw.Render() pick = CameraPick(fw.Main.camera, Vec3(MouseX(), MouseY(), 1000),,1)'trying to pick Plane entity, but it doesnt work with cube entity too.. If pick <> Null If pick.entity = plane DrawText"PLANE PICKED", 10, 10 If pick.entity = cube DrawText"CUBE PICKED", 10, 40 End If Flip(0) Wend End ..what the heck im missing here ? Quote
ZioRed Posted July 28, 2010 Posted July 28, 2010 As far as I remember the collision type parameter that you pass to the pick function is not the one of the "pickable entity" but of the raycast itself. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com
macklebee Posted July 29, 2010 Posted July 29, 2010 yep, so that means you would need to set a Collision response for those two things: Collisions(plane Entitytype, raycast Entitytpe, collision response) Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Recommended Posts
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.