3ds Max C++ API Reference
|
#include "maxheap.h"
#include "geom/geomlib.h"
#include "export.h"
#include "tab.h"
#include "mtl.h"
#include "BaseInterface.h"
#include "HWMesh.h"
#include "MeshFaceFlagConstants.h"
#include "GraphicsConstants.h"
#include "GraphicsTypes.h"
#include "GraphicsViewPortColorConstants.h"
#include "maxtypes.h"
#include "TabTypes.h"
#include "LightTypeEnums.h"
#include "Strip.h"
#include "GraphicsWindow.h"
Classes | |
class | VertexBuffer |
A vertex buffer, containing a Point3 and color. More... | |
class | LineBuffer |
A line buffer, containing a single Point3 and color. More... | |
class | GWFace |
A triangular face, which is represented as indexes into a vertex array. More... | |
class | Light |
Describes lights used in the interactive renderer. More... | |
class | Camera |
Represents the projection matrix and common properties of a perspective or orthographic camera. More... | |
struct | CIRCLE |
Represents a circular region when doing hit testing. More... | |
class | HitRegion |
Describes the properties of a region used for built-in hit testing of items in the interactive renderer. More... | |
class | GWinSetup |
Functions | |
int | ABS (const int x) |
Returns the absolute value of an integer. | |
int | wIsFacingBack (const IPoint3 &v0, const IPoint3 &v1, const IPoint3 &v2, int flip=0) |
Given three points in a windows coordinate system (where the upper-left of the window is origin) returns TRUE if the face is facing backwards, FALSE otherwise. | |
int | hIsFacingBack (const IPoint3 &v0, const IPoint3 &v1, const IPoint3 &v2, int flip=0) |
Given three points in a coordinate system where the lower-left of the window is origin returns TRUE if the face is facing backwards, FALSE otherwise. | |
FacingType | wFacingType (const IPoint3 &v0, const IPoint3 &v1, const IPoint3 &v2, int flip=0) |
Returns the facing of a given triangle relative to the screen. | |
FacingType | hFacingType (const IPoint3 &v0, const IPoint3 &v1, const IPoint3 &v2, int flip=0) |
Returns the facing of a given triangle relative to the screen. | |
DllExport HINSTANCE | GetGraphicsLibHandle (const MCHAR *driverLibName) |
DllExport BOOL | GraphicsSystemIsAvailable (HINSTANCE drv) |
DllExport BOOL | GraphicsSystemCanConfigure (HINSTANCE drv) |
DllExport BOOL | GraphicsSystemConfigure (HWND hWnd, HINSTANCE drv) |
DllExport void | FreeGraphicsLibHandle (HINSTANCE drv) |
DllExport GraphicsWindow * | createGW (HWND hWnd, GWinSetup &gws) |
DllExport void | getRegionRect (HitRegion *hr, RECT *rect) |
Returns a bounding rectangle that encloses the entire hit region. | |
DllExport BOOL | pointInRegion (int x, int y, HitRegion *hr) |
Returns TRUE if the specified point is inside the region hr or FALSE otherwise. | |
DllExport int | distToLine (int x, int y, int *p1, int *p2) |
Returns the signed distance from x , y to the line defined by p1->p2 . | |
DllExport float | distToSegment (int x, int y, int *p1, int *p2) |
Returns the unsigned distance from the 2D point x , y to the 2D line segment defined by p1->p2 . | |
DllExport int | zDepthToLine (int x, int y, int *p1, int *p2) |
Returns z depth at closest point in the line defined by p1->p2 to x,y v = the vector from p1 to p2 w = the vector from p1 to q=(x,y) t = (w dot v) / (v dot v) p1[2] + (p2[2] - p1[2]) * t. | |
DllExport int | zDepthToSegment (int x, int y, int *p1, int *p2) |
Returns z depth at closest point in the segment defined by p1->p2 to x,y v = the vector from p1 to p2 w = the vector from p1 to q=(x,y) t = (w dot v) / (v dot v) t = clamp(t, 0.0, 1.0) p1[2] + (p2[2] - p1[2]) * t. | |
DllExport int | lineCrossesRect (RECT *rc, int *p1, int *p2) |
Returns nonzero if the line defined by p1->p2 crosses into the RECT and 0 otherwise. | |
DllExport int | segCrossesRect (RECT *rc, int *p1, int *p2) |
Returns nonzero if the line-segment defined by p1->p2 crosses into the RECT and 0 otherwise. | |
DllExport int | segCrossesCircle (int cx, int cy, int r, int *p1, int *p2) |
Returns nonzero if the line-segment defined by p1->p2 crosses the circle center at (cx, cy ) with a radius of r 0 otherwise. | |
DllExport BOOL | insideTriangle (IPoint3 &p0, IPoint3 &p1, IPoint3 &p2, IPoint3 &q) |
Returns TRUE if the point passed is inside the specified triangle. | |
DllExport int | getZfromTriangle (IPoint3 &p0, IPoint3 &p1, IPoint3 &p2, IPoint3 &q) |
Returns the z value of where the projected screen point q would intersect the triangle defined by (p0, p1, p2 ). | |
DllExport int | getClosestPowerOf2 (int num) |
Given an integer returns another integer which is the closest power of 2. | |
Window / Crossing Mode Functions | |
| |
DllExport void | setAutoCross (int onOff) |
Set to a non-zero value if crossing mode is used for selections, or zero if windowing mode is used instead. | |
DllExport int | getAutoCross () |
Returns a non-zero value if crossing mode is used for selections, or zero if windowing mode is used instead. | |
DllExport void | setAutoCrossDir (int dir) |
Sets the type of crossing mechanism used in crossing mode of selections. | |
DllExport int | getAutoCrossDir () |
Sets the type of crossing mechanism used in crossing mode of selections. | |
User-Defined Colors | |
Access to customizable colors used to draw viewport, scene and user interface elements (not elements of different color schemes available in 3ds Max). Clients of these methods should consider registering for NOTIFY_COLOR_CHANGE notification in order to ensure that they use the current custom colors. | |
#define | GetSelColor() GetUIColor(COLOR_SELECTION) |
Retrieves the selection color. | |
#define | GetSubSelColor() GetUIColor(COLOR_SUBSELECTION) |
Retrieves the sub-object selection color. | |
#define | GetFreezeColor() GetUIColor(COLOR_FREEZE) |
Retrieves the freeze color. | |
DllExport Point3 | GetUIColor (int which) |
Retrieves the current value of the specified custom color. | |
DllExport void | SetUIColor (int which, Point3 *clr) |
Sets the current value of the specified custom color. | |
DllExport Point3 | GetDefaultUIColor (int which) |
Retrieves the default value of the specified custom color. | |
#define GetSelColor | ( | ) | GetUIColor(COLOR_SELECTION) |
Retrieves the selection color.
#define GetSubSelColor | ( | ) | GetUIColor(COLOR_SUBSELECTION) |
Retrieves the sub-object selection color.
#define GetFreezeColor | ( | ) | GetUIColor(COLOR_FREEZE) |
Retrieves the freeze color.
Set to a non-zero value if crossing mode is used for selections, or zero if windowing mode is used instead.
Returns a non-zero value if crossing mode is used for selections, or zero if windowing mode is used instead.
Sets the type of crossing mechanism used in crossing mode of selections.
Legal values are AC_DIR_RL_CROSS or AC_DIR_LR_CROSS.
Sets the type of crossing mechanism used in crossing mode of selections.
This is either AC_DIR_RL_CROSS or AC_DIR_LR_CROSS.
|
inline |
Given three points in a windows coordinate system (where the upper-left of the window is origin) returns TRUE if the face is facing backwards, FALSE otherwise.
|
inline |
Given three points in a coordinate system where the lower-left of the window is origin returns TRUE if the face is facing backwards, FALSE otherwise.
|
inline |
Returns the facing of a given triangle relative to the screen.
Returns whether a given triangle is front-facing, side-facing, or back-facing relative to the screen. The triangle is passed as three points in screen space. This function is used for "w" format device coordinates.
v0 | The 1st triangle vertex |
v1 | The 2nd triangle vertex |
v2 | The 3rd triangle vertex |
flip | If true, flip the triangle (so backfacing would return frontfacing) |
|
inline |
Returns the facing of a given triangle relative to the screen.
The methods wFacingType() and hFacingType() will return whether a given triangle is front-facing, side-facing, or back-facing relative to the screen. The triangle is passed as three points in screen space. This function is used for "h" format device coordinates.
v0 | The 1st triangle vertex |
v1 | The 2nd triangle vertex |
v2 | The 3rd triangle vertex |
flip | If true, flip the triangle (so backfacing would return frontfacing) |
DllExport BOOL GraphicsSystemIsAvailable | ( | HINSTANCE | drv | ) |
DllExport BOOL GraphicsSystemCanConfigure | ( | HINSTANCE | drv | ) |
DllExport BOOL GraphicsSystemConfigure | ( | HWND | hWnd, |
HINSTANCE | drv | ||
) |
DllExport GraphicsWindow * createGW | ( | HWND | hWnd, |
GWinSetup & | gws | ||
) |
This function is used internally to create a new graphics window.
Returns a bounding rectangle that encloses the entire hit region.
For example if the hit regions was a fence region, this method would return the smallest rectangle that included the entire set of fence region points.
hr | The hit region to check |
rect | Points to the returned bounding rectangle. |
Returns TRUE if the specified point is inside the region hr
or FALSE otherwise.
Returns the signed distance from x
, y
to the line defined by p1->p2
.
Returns the unsigned distance from the 2D point x
, y
to the 2D line segment defined by p1->p2
.
x | The x coordinate of the 2D point. |
y | The y coordinate of the 2D point. |
p1 | The first end point of the 2D line segment. |
p2 | The second end point of the 2D line segment. A line segment is the finite segment between two end points p1 p2 , different from the infinite line used in distToLine. Notice that this routine returns unsigned distance, which means not matter on which side of the line the point is, the returned value is always non-negative. |
Returns z depth at closest point in the line defined by p1->p2 to x,y v = the vector from p1 to p2 w = the vector from p1 to q=(x,y) t = (w dot v) / (v dot v) p1[2] + (p2[2] - p1[2]) * t.
Returns z depth at closest point in the segment defined by p1->p2 to x,y v = the vector from p1 to p2 w = the vector from p1 to q=(x,y) t = (w dot v) / (v dot v) t = clamp(t, 0.0, 1.0) p1[2] + (p2[2] - p1[2]) * t.
Returns nonzero if the line defined by p1->p2
crosses into the RECT and 0 otherwise.
Returns nonzero if the line-segment defined by p1->p2
crosses into the RECT and 0 otherwise.
Returns nonzero if the line-segment defined by p1->p2
crosses the circle center at (cx, cy
) with a radius of r
0 otherwise.
Returns TRUE if the point passed is inside the specified triangle.
p0 | The first point of the triangle |
p1 | The second point of the triangle |
p2 | The third point of the triangle. |
q | The point to check. |
Returns the z value of where the projected screen point q
would intersect the triangle defined by (p0, p1, p2
).
p0 | The first point of the triangle |
p1 | The second point of the triangle |
p2 | The third point of the triangle. |
q | The screen point to check. |
Given an integer returns another integer which is the closest power of 2.
Retrieves the current value of the specified custom color.
which | The identifier of the custom color to retrieve. See ViewportDrawingColors |
Sets the current value of the specified custom color.
which | The identifier of the custom color to retrieve. See ViewportDrawingColors |
clr | Pointer to the new color value object |
Retrieves the default value of the specified custom color.
which | The identifier of the custom color to retrieve. See ViewportDrawingColors |