gamecreator Posted February 27, 2012 Share Posted February 27, 2012 Is there a way to use GetEntityKey on a picked entity? I've set the key on an entity and can successfully get it back if I ask for it directly, but trying to use CameraPick and the following code GetEntityKey(pick.entity,"id") returns an empty string (NULL?). Am I doing anything wrong or is that not meant to work? (If I do HideEntity(pick.entity) it works fine too so I know I've selected the right entity.) Quote Link to comment Share on other sites More sharing options...
Rick Posted February 27, 2012 Share Posted February 27, 2012 It's something with the model vs the mesh. Try getting the entities parent or child and passing that to GetEntityKey(). I always forget which direction it goes. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted February 27, 2012 Author Share Posted February 27, 2012 This works: GetEntityKey(GetParent(pick.entity),"id") Thank you Rick. Quote Link to comment Share on other sites More sharing options...
macklebee Posted February 27, 2012 Share Posted February 27, 2012 because when you set the key, you probably set it to the model... whereas raycasting only works with meshes and terrains... the pick entity is a mesh and is a child of the model... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
gamecreator Posted February 27, 2012 Author Share Posted February 27, 2012 That makes sense but it's not immediately intuitive. Thank you. Quote Link to comment Share on other sites More sharing options...
Flexman Posted February 27, 2012 Share Posted February 27, 2012 This one I get confused over: what does ForEachEntityInAABBDo(..) return? Meshes or Models? Both? Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Pixel Perfect Posted February 27, 2012 Share Posted February 27, 2012 I'd assume it's for every entity within a given AABB volume so Models, Meshes, Bodies in fact anything that derives its pointer from a TEntity type. But I don't know for a fact, I've never actually tried this as I seem to recollect it calls a user defined callback for the returned targets. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
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.