Ovis_3D_Position_Decoration_Set()
Abstract
Defines a position based on a decoration.
Syntax
Ovis_3D_Position_Decoration_Set (pos_ptr, deco_ptr, ratio)
| Argument | Type | Description |
|---|---|---|
pos_ptr |
OvisT_3D_Position * |
Pointer to the position |
deco_ptr |
OvisT_3D_Decoration * |
Pointer to the decoration |
ratio |
unsigned char |
Ratio |
Return Type
OvisT_Compcode
OvisC_Compcode_Success if the position could be set. Otherwise, it returns OvisC_Compcode_Failure.
Header
ovis_decoration.h
Details
This function defines a position based on the specified decoration. For "single" location decorations (such as a sphere, cube, or text), the position corresponds to the location of the decoration. For "dual" location decorations (such as a line or cylinder), the position is defined using the "ratio" argument. A ratio of 0 is the "head" of the decoration, whereas a ratio of 100 is the "tail." Values between 0 and 100 define a corresponding location between head and tail. The position is updated as the associated decoration changes location over time.
Example
OvisT_3D_Position pos;
OvisT_3D_Line * line;
/* … line created at some point */
/* Position is a quarter down the line */
Ovis_3D_Position_Decoration_Set (&pos, line, 25);
Errors
- Position argument is NIL.
- Decoration is NIL.
- Invalid ratio value (
<value>). Valid values are between 0 and 100.
Reference
- Use the function
Ovis_Entity_Position_Get()to set a 3D position to the current position of an entity, but without having the position value updated when the entity moves.