|
|
| SimObject (SimObject &)=delete |
|
SimObject & | operator= (const SimObject &)=delete |
|
| SimObject (SimObject &&)=default |
|
SimObject & | operator= (SimObject &&)=default |
| virtual void | display (JMGraphics *gr) |
|
double | sizex () const |
| | Returns object/bounding box size on the X axis.
|
|
double | sizey () const |
| | Returns object/bounding box size on the Y axis.
|
|
double | sizez () const |
| | Returns object/bounding box size on the Z axis.
|
|
glm::dvec3 | size () const |
| | Returns object/bounding box size as a vector.
|
|
double | posx () const |
| | Returns the objects position on the X axis.
|
|
double | posy () const |
| | Returns the objects position on the Y axis.
|
|
double | posz () const |
| | Returns the objects position on the Z axis.
|
|
glm::dvec3 | pos () const |
| | Returns the objects position as a vector. Position is at the center of the bounding box.
|
|
double | rotx () const |
| | Returns the objects Euler angle on the X axis.
|
|
double | roty () const |
| | Returns the objects Euler angle on the Y axis.
|
|
double | rotz () const |
| | Returns the objects Euler angle on the Z axis.
|
|
glm::dvec3 | rot () const |
| | Returns the objects Euler angle as a vector. Euler angles are always applied in XYZ order.
|
|
glm::dquat | rotq () const |
| | Returns the objects angle as a quaternion.
|
|
glm::dmat4 | positionMatrix () const |
| | Returns a matrix containing the objects position and rotation transformations.
|
|
bool | setSize (double x, double y, double z) |
| | Set the object/bounding box size. Returns true if allowed.
|
|
bool | setSize (glm::dvec3 size) |
| | Set the object/bounding box size. Returns true if allowed.
|
|
bool | setPos (double x, double y, double z) |
| | Set the objects position. Position is the center of the bounding box. Returns true if allowed.
|
|
bool | setPos (glm::dvec3 pos) |
| | Set the objects position. Position is the center of the bounding box. Returns true if allowed.
|
|
bool | setRot (double x, double y, double z) |
| | Set the objects rotation from Euler angles. Angles are applied in XYZ order. Returns true if allowed.
|
|
bool | setRot (glm::dvec3 rot) |
| | Set the objects rotation from Euler angles. Angles are applied in XYZ order. Returns true if allowed.
|
|
bool | setRot (glm::dquat rot) |
| | Set the objects angle from a quaternion. Returns true if allowed.
|
|
SimObject * | clone () |
| | Returns a copy of this object.
|
|
virtual void | setupMenu1 (TabbedMenu *tabbedMenu) |
| | Override this to set up the first properties menu.
|
|
virtual void | setupMenu2 (TabbedMenu *tabbedMenu) |
| | Override this to set up the second properties menu.
|
|
void | setupGeneralMenu (TabbedMenu *tabbedMenu) |
| | Sets up the general settings menu.
|
|
void | setupDataWindowInternal (JMwindow *window, float dataX, float dataY) |
| | Is called by the object handler. Calls setupDataWindow if needed.
|
| virtual void | setupDataWindow (JMwindow *window, float dataX, float dataY) |
|
virtual void | displayDataWindow (JMwindow *window, float localMouseX, float localMouseY, float dataX, float dataY) |
| | Is called by the object handler to display the data window.
|
|
std::string | objectCategory () const |
| | Returns the object category string.
|
|
void | setupMenus (TabbedMenu *tabbedMenu) |
| | is called by the object handler if the properties menus are needed.
|
|
void | save (std::ostream &stream) |
| | Writes this objects data to a stream. Used to save to a file.
|
|
void | load (std::istream &stream) |
| | Reads object data from a stream. Used to load from a file.
|
|
void | linkObject (SimObject *obj) |
| | Establishes a two way link with a specific sim object.
|
|
void | unlinkObject (SimObject *obj) |
| | Removes the two way link with a specific sim object.
|
|
std::vector< SimObject * > | allLinkedOjects () |
| | Returns all sim objects that are linked with this one.
|
| void | reestablishLinks () |
|
void | unlinkAll () |
| | Removes all sim object links.
|
|
| glm::mat4 | renderMatrix = glm::mat4(1.0f) |
|
std::string | name = "Object - 001" |
| | The name that's displayed on the screen and can be set by the user.
|
|
std::string | menu1Name = "Properties" |
| | This name is used to label the tabs on the propertiesMenu.
|
|
std::string | menu2Name = "Properties 2" |
| | This name is used to label the tabs on the propertiesMenu.
|
|
bool | isSelected = false |
| | Is set to true by the SimEnvironment if this is the primary selection. Avoid seting this yourself.
|
|
bool | isSecondSelected = false |
| | Is set to true by the SimEnvironment if this is a secondary selection. Avoid seting this yourself.
|
|
bool | hide = false |
| | If set to true, the object can't be selected in the viewer and is not rendered.
|
|
bool | viewportSelectable = true |
| | Set to false to disable selection in the viewport.
|
|
GuiElementHandler * | generalMenu = nullptr |
| | This is displayed in tbe SimEnvironments properties menu if it is set up and displayed. It is created and set up by the SimObject base class.
|
|
GuiElementHandler * | menu1 = nullptr |
|
GuiElementHandler * | menu2 = nullptr |
|
SimEnvironment * | handler = nullptr |
| | A pointer to the SimEnvironment instance containing this SimObject.
|
A base class for sim objects. These can be added to a SimEnvironment. If you want the object to be rendered as anything other than a cube, override display(JMGraphics* gr). If you want settings menus besides the general settings, override setupMenu1(TabbedMenu* tabbedMenu) or setupMenu2(TabbedMenu* tabbedMenu). In these functions, make sure to initialize the correct GuiElementHandler objects (menu1 or menu2). A pointer to the TabbedMenu object that they will appear in is passed as a parameter by the SimEnvironment so that your gui elements can be scaled/position appropriately.
The cloneInternal function must be overridden if you want undo-redo, duplicating and save-load to work correctly. It needs to return a pointer to a copy of itself, only set the copies data that is specific to the subclass, base class data is handled by a wrapper function.
For saving and loading from a file to work, the objectType string must be set in the constructor to something unique to the derived class, and it must be added using the simEnvironments registerDerivedSimObject function. readData() and writeData() functions must be overriden to read and write data unique to the derived class in order to save and load from a file. Saving and loading base data is handled by the save and load wrapper functions.