|
Momentum Scripting v1
|
#include <SceneGraph.h>
Static Public Member Functions | |
| static SceneNodePtr | createAndAdd3DGrid (int resU, int resV, int resW, const Vec3 &origin, const Vec3 &endPointX, const Vec3 &endPointY, const Vec3 &endPointZ, const Vec4 &color, float width) |
| static SceneNodePtr | createAndAddLine (const Vec3 &p1, const Vec3 &p2, const Vec4 &color, float width) |
| static SceneNodePtr | createAndAddPolyline (std::vector< Vec3 > points, const Vec4 &color, float width) |
| static SceneNodePtr | createAndAddText (const std::string &text, const Vec3 &relPosition, const Vec4 &color, float size) |
| static bool | removeNode (SceneNodePtr node) |
The SceneGraph class provides an interface for managing and rendering graphical objects within a scene, such as lines, polylines, grids, and text objects.
Use this to draw graphical objects that doesn't interact with the physics.
The class offers static methods to create these graphical objects, which return pointers to the created SceneNode objects, allowing further manipulation or deletion as required. The created graphical objects doesn't interact with rigid bodies or other objects in the simulation.
Note that the graphical objects are only visible in the Journal Viewer or the External Simulation viewer. They are never displayed inside SpaceClaim, e.g. when running the simulation from inside SpaceClaim. This means that the visual objects may only be seen when running an external simulation or the Journal Viewer.
|
static |
Create a uniform grid and adds it to the scene graph.
Check return value to see if everything was successful.
| resU | The resolution of the grid (in number of lines) in x. |
| resV | The resolution of the grid (in number of lines) in y. |
| resW | The resolution of the grid (in number of lines) in z. |
| origin | The origin of the grid in world coordinates |
| endPointX | The end point of the grid in x coordinates. The distance between this point and the origin gives the length of the grid in x. |
| endPointY | The end point of the grid in y coordinates. The distance between this point and the origin gives the length of the grid in y. |
| endPointZ | The end point of the grid in z coordinates. The distance between this point and the origin gives the length of the grid in z. |
| color | - An RGBt color array, where x is R, y is G, z is B and w is transparency. Values in the interval 0-1. |
| width | The line width of the grid, this is in pixel size. |
|
static |
Create and add a line to the scene graph.
| p1,p2 | - Start, end points in WORLD coordinate system |
| color | - An RGBt color array, where x is R, y is G, z is B and w is transparency. Values in the interval 0-1. |
| width | - This is the number defining the line width in pixels |
|
static |
Create and return a new Polyine to render.
The polyline is added to the scene graph.
| points | - A vector of points, in WORLD coordinate system, defining the polyline. Give at least two points |
| color | - An RGBt color array, where x is R, y is G, z is B and w is transparency. Values in the interval 0-1. |
| width | - This is the number defining the line width in pixels |
|
static |
Create a text object and adds it to the scene graph.
| text | - the text to render |
| relPosition | - relative position to the geometry |
| color | - An RGBt color array, where x is R, y is G, z is B and w is transparency. Values in the interval 0-1. |
| size | - size of the text |
|
static |
Remove the given scene node from the scene graph.