Jump to content

Picks


macklebee
 Share

Recommended Posts

Is there a way to relate a camerapick entity to a entity that is found by looping thru the worlds entities? when I do a getkey("name") for example for both, the camerapick returns U3D_MESH and the looped entity returns the user defined name of the model..

 

Also, if I do an entitypick, since the radius parameter doesn't work, how do i know what direction the raytrace is occurring?

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

The entity returned by the CameraPick is the actual mesh itself. You have to call GetMeshModel(pick.entity) to get the TModel that actually has the proper keys for it.

 

Since picks occur only to meshes, and not models or physics, you have to get the Model parent of the picked mesh in order to utilize the key system, message system, etc. on a picked entity.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

The entity returned by the CameraPick is the actual mesh itself. You have to call GetMeshModel(pick.entity) to get the TModel that actually has the proper keys for it.

 

Since picks occur only to meshes, and not models or physics, you have to get the Model parent of the picked mesh in order to utilize the key system, message system, etc. on a picked entity.

 

ah! makes sense... thanks!

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

GetMeshModel does a repeat until parent==nil loop to continuously get the parent until you get the highest level parent of the picked entity.

 

It would be nice to have an engine command like GetMeshModel, or something generic and widely usable like GetRootParent.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

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...