Virtools学习(七)—2D Picking
这个功能比较重要,游戏中的托拽经常要用到,例如,棋类游戏中让棋子走到鼠标指定的位置,还有做模拟城市的游戏中,玩家会将自己选择的建筑物或者植物托拽到某个特定的位置。
In: triggers the process.
True: is activated when the ray intersects an object or a sprite.
False: is activated when the ray doesn't intersect an object.
X: X axis value (Note : this pIn will not be visible if the Use 2D Vector or Use Mouse Coordinates setting is checked.)
Y: Y axis value (Note : this pIn will not be visible if the Use 2D Vector or Use Mouse Coordinates setting is checked.)
Pos: coordinates defined as X and Y axis value (Note : this pIn will only be visible if the Use 2D Vector setting is checked and the Use Mouse Coordinates setting left unchecked.)
Window Relative: Check this parameter if you give coordinates in the render window coordinate system, or leave it uncheck if you give them in the entire screen coordinates (like the values returned by the GetMousePosition behavior). For fullscreen mode, this parameter makes no difference.
Object Picked: The first object in Z order, under the picking.
Intersection Point: exact 3D point coordinates of the intersection point (this point is given in world space coordinates).
Intersection Normal: coordinates of the normal vector on the picked object.
UV Coordinates: coordinates on the 'texel' picked (pixel on the texture).
Distance from The Viewpoint: distance of the exact 3D point from the viewpoint
Face Index: index, on the object, of the picked face
Sprite: picked sprite, if any.
Use 2D Vector: Uncheck to provide coordinates using seperate pIns for X and Y values.
Use Mouse Coordinates: Checked (by default) to use the mouse position to provide coordinates. (Note: Checking this setting hides all pIns)
Local Output: check this if you want Intersection Point and Normal expressed in the picked object referential.