## Public API Reference

- Main Page
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iPcMeshSelect Struct Reference

This is a property class for selecting meshes. More...

`#include <propclass/meshsel.h>`

List of all members.

## Public Member Functions

virtual void | AddMeshSelectListener (iPcMeshSelectListener *listener)=0
| Add a listener to listen to mouse selection.
virtual void | GetDragPlaneNormal (csVector3 &drag_normal, bool &camera_space) const =0
| Get the drag normal and camera space flag.
virtual float | GetMaxSelectionDistance () const =0
| Get the maximum distance to use for mesh selection.
virtual int | GetMouseButtons () const =0
| Get the bit-mask for the supported buttons.
virtual bool | HasDragMode () const =0
| Get value of drag mode.
virtual bool | HasFollowAlwaysMode () const =0
| Get the value of follow always mode.
virtual bool | HasFollowMode () const =0
| Get the value of follow mode.
virtual bool | HasGlobalSelection () const =0
| Get value of global/local selection.
virtual bool | HasSenddownEvent () const =0
| Get the value of send down events.
virtual bool | HasSendmoveEvent () const =0
| Get the value of send move events.
virtual bool | HasSendupEvent () const =0
| Get the value of send up events.
virtual void | RemoveMeshSelectListener (iPcMeshSelectListener *listener)=0
| Remove a mesh selection listener.
virtual void | SetCamera (iPcCamera *camera)=0
| Set the camera to use for mesh selection.
virtual void | SetDragMode (bool drag)=0
| If true then it is possible to drag the selected object.
virtual void | SetDragPlaneNormal (const csVector3 &drag_normal, bool camera_space)=0
| Set the normal of the plane on which the dragged object will move.
virtual void | SetFollowAlwaysMode (bool followalways)=0
| If true then also send move messages when the entity is not selected but the mouse is positioned on top of the entity.
virtual void | SetFollowMode (bool follow)=0
| If true then follow the mouse so that up/down events come through immediatelly when the mouse leaves the object (even if mouse up has not yet happened).
virtual void | SetGlobalSelection (bool glob)=0
| Set global/local selection.
virtual void | SetMaxSelectionDistance (float distance)=0
| Set the maximum distance to use for mesh selection.
virtual void | SetMouseButtons (const char *buttons)=0
| Indicate (with a string) for which buttons this mesh selector will work.
virtual void | SetMouseButtons (int buttons)=0
| Indicate (with a bit-mask) for which buttons this mesh selector will work.
virtual void | SetSenddownEvent (bool sd)=0
| If true then send mouse-down events (message 'selectmesh_down').
virtual void | SetSendmoveEvent (bool mov)=0
| If true then also send messages on mouse move (only between mouse-down and mouse-up (message 'selectmesh_move').
virtual void | SetSendupEvent (bool su)=0
| If true then send mouse-up events (message 'selectmesh_up').

## Detailed Description

This is a property class for selecting meshes.

This property class can send out the following messages to the behaviour (add prefix 'cel.parameter.' to get the ID for parameters):

- pcmeshsel_down: mesh is selected (x,y,button,entity)
- pcmeshsel_up: mesh is unselected (x,y,button,entity)
- pcmeshsel_move: mesh is moved (x,y,button,entity)

This property class supports the following actions (add prefix 'cel.action.' to get the ID of the action and add prefix 'cel.parameter.' to get the ID of the parameter):

- SetCamera: parameters 'entity' (string).
- SetMouseButtons: parameters 'buttons' (string or long). In case of string it should be a string with 'l', 'm', or 'r' (or a combination).
- SetDragPlaneNormal: parameters 'normal' (vector3), 'camera' (bool).

This property class supports the following properties (add prefix 'cel.property.' to get the ID of the property:

- global (bool, read/write): global selection, default false.
- follow (bool, read/write): follow mode, default false.
- followalways (bool, read/write): follow always mode, default false.
- drag (bool, read/write): drag mode, default false.
- sendmove (bool, read/write): send move events, default false.
- sendup (bool, read/write): send up events, default true.
- senddown (bool, read/write): send down events, default true.
- maxdistance (float, read/write): maximum selection distance, default 100000.

Definition at line 97 of file meshsel.h.

## Member Function Documentation

virtual void iPcMeshSelect::AddMeshSelectListener | ( | iPcMeshSelectListener * | listener | ) | `[pure virtual]`

| Add a listener to listen to mouse selection. These listeners are called right before the behaviour is called.

virtual void iPcMeshSelect::GetDragPlaneNormal | ( | csVector3 & | drag_normal,
|  | bool & | camera_space
| ) | const`[pure virtual]`

| Get the drag normal and camera space flag.

virtual float iPcMeshSelect::GetMaxSelectionDistance | ( |  | ) | const`[pure virtual]`

| Get the maximum distance to use for mesh selection.

virtual int iPcMeshSelect::GetMouseButtons | ( |  | ) | const`[pure virtual]`

| Get the bit-mask for the supported buttons.

virtual bool iPcMeshSelect::HasDragMode | ( |  | ) | const`[pure virtual]`

| Get value of drag mode.

virtual bool iPcMeshSelect::HasFollowAlwaysMode | ( |  | ) | const`[pure virtual]`

| Get the value of follow always mode.

virtual bool iPcMeshSelect::HasFollowMode | ( |  | ) | const`[pure virtual]`

| Get the value of follow mode.

virtual bool iPcMeshSelect::HasGlobalSelection | ( |  | ) | const`[pure virtual]`

| Get value of global/local selection.

virtual bool iPcMeshSelect::HasSenddownEvent | ( |  | ) | const`[pure virtual]`

| Get the value of send down events.

virtual bool iPcMeshSelect::HasSendmoveEvent | ( |  | ) | const`[pure virtual]`

| Get the value of send move events.

virtual bool iPcMeshSelect::HasSendupEvent | ( |  | ) | const`[pure virtual]`

| Get the value of send up events.

virtual void iPcMeshSelect::RemoveMeshSelectListener | ( | iPcMeshSelectListener * | listener | ) | `[pure virtual]`

| Remove a mesh selection listener.

virtual void iPcMeshSelect::SetCamera | ( | iPcCamera * | camera | ) | `[pure virtual]`

| Set the camera to use for mesh selection.

virtual void iPcMeshSelect::SetDragMode | ( | bool | drag | ) | `[pure virtual]`

| If true then it is possible to drag the selected object. Note that drag mode is usually used in combination with follow mode. (default false).

virtual void iPcMeshSelect::SetDragPlaneNormal | ( | const csVector3 & | drag_normal,
|  | bool | camera_space
| ) | `[pure virtual]`

| Set the normal of the plane on which the dragged object will move. The actual plane itself will be calculated depending on the current position of the object and that given normal. The normal can be given in camera space or in world space. Default is the 0,0,1 normal in camera space which means that the object will drag according to screen coordinates.

virtual void iPcMeshSelect::SetFollowAlwaysMode | ( | bool | followalways | ) | `[pure virtual]`

| If true then also send move messages when the entity is not selected but the mouse is positioned on top of the entity. Default false.

virtual void iPcMeshSelect::SetFollowMode | ( | bool | follow | ) | `[pure virtual]`

| If true then follow the mouse so that up/down events come through immediatelly when the mouse leaves the object (even if mouse up has not yet happened). Otherwise mouse up event will arrive only when the mouse is released independent of wether or not the mouse is above the object at release time. Default false.

virtual void iPcMeshSelect::SetGlobalSelection | ( | bool | glob | ) | `[pure virtual]`

| Set global/local selection. With local selection the Behaviour will only get messages when it's own mesh entity is selected (default). With global selection the Behaviour will get messages for selection of all mesh entities.

virtual void iPcMeshSelect::SetMaxSelectionDistance | ( | float | distance | ) | `[pure virtual]`

| Set the maximum distance to use for mesh selection. This is the distance in world units from the camera, into the scene.

virtual void iPcMeshSelect::SetMouseButtons | ( | const char * | buttons | ) | `[pure virtual]`

| Indicate (with a string) for which buttons this mesh selector will work. By default this is the left button. Use a combination of the 'l', 'r', or 'm' characters.

virtual void iPcMeshSelect::SetMouseButtons | ( | int | buttons | ) | `[pure virtual]`

| Indicate (with a bit-mask) for which buttons this mesh selector will work. By default this is the left button. Use a combination of CEL_MOUSE_... flags.

virtual void iPcMeshSelect::SetSenddownEvent | ( | bool | sd | ) | `[pure virtual]`

| If true then send mouse-down events (message 'selectmesh_down'). Default true.

virtual void iPcMeshSelect::SetSendmoveEvent | ( | bool | mov | ) | `[pure virtual]`

| If true then also send messages on mouse move (only between mouse-down and mouse-up (message 'selectmesh_move'). Default false.

virtual void iPcMeshSelect::SetSendupEvent | ( | bool | su | ) | `[pure virtual]`

| If true then send mouse-up events (message 'selectmesh_up'). Default true.

The documentation for this struct was generated from the following file:

- propclass/meshsel.h