Functions | |
HC_KEY | Compute_Swept_Shell (HC_KEY shellkey, const HC_POINT *direction_in, HC_KEY *front_key, HC_KEY *back_key, HC_KEY *side_key, const char *options) |
void | Compute_Swept_Shell_Along_Path (HC_KEY shellkey, int number_of_sweeps, const float *matrices, const char *options) |
HC_KEY Compute_Swept_Shell | ( | HC_KEY | shellkey, | |
const HC_POINT * | direction_in, | |||
HC_KEY * | front_key, | |||
HC_KEY * | back_key, | |||
HC_KEY * | side_key, | |||
const char * | options | |||
) |
Sweeps an existing shell along a defined path to create new shells that containes the swept volume.
shellkey | - Key to the shell to be swept | |
direction_in | - A vector giving the direction and distance to sweep the shell. | |
front_key | - The key to the shell that represents the front portion of the swept shell. Passed by reference. Returned to user. | |
back_key | - The key to the shell that represents the back portion of the swept shell. Passed by reference. Returned to user. | |
side_key | - The key to the shell that represents the side portion of the swept shell. Passed by reference. Returned to user. | |
options | - A string through which a user can set options that affect the sweep. |
void Compute_Swept_Shell_Along_Path | ( | HC_KEY | shellkey, | |
int | number_of_sweeps, | |||
const float * | matrices, | |||
const char * | options | |||
) |
Creates a new set of shells by sweeping a shell along a path.
shellkey | - Key to the shell to be swept. | |
number_of_sweeps | - The number of distinct steps in the sweep. | |
matrices | - An array of 4x4 matrices. | |
options | - A string through which a user can set options that affect the sweep. |
Each matrix in the matrices array consists of 16 floating point values, and each matrix can contain both rotational and translational elements. The first modelling matrix in the array is not included in the sweep, but rather defines the initial starting position of the shell. Also, the modelling matrices are absolute and are not appended to the previous matrix.
There are several important points to be aware of regarding the computed shells. First, the shells that are created are not guaranteed to be watertight and may intersect each other. Second, each individual shell will likely contain redundant vertices, and therefore it is recommended that the user call Compute_Optimized_Shell() on these shells for better rendering performance. Last, the interpolation between each step is linear and may not accurately reflect the desired movement. To reduce the errors developers should increase the number of steps in the sweep.
The options string can be used to control certain properties of the created shells. The following choices for options are recognized:
generate front [= on | off]
When set, the swept shell(s) will include a copy of the original shell at the start location. This effectively closes the 'front' of the volume.
generate back [= on | off]
The swept shell will include a copy of the shell at the final location. This effectively closes the 'back' of the volume.
deviation = x
A radian value controlling the generation of silhouette edges. If the angle between a face plane and an edge vector is less than this angle (in radians) then the edge in question will be regarded as a silhouette edge. Increasing this value will improve quality but may impact performance.
last silhouette = ddd
Integer value that instructs the computation algorithm to include the silhouettes from ddd number of previous steps in the sweep. Since polyline sections will cause different edges to be chosen as "silhouettes" to sweep, the result of this function will in general not be a closed watertight surface. Increasing this value will improve quality (i.e. make it less likely that collisions will be missed if the output of this function is used in a Compute_Selection_By_Shell() call) but will impact performance.
The default setting for options is "generate front, generate back, deviation = 0, last silhouette = 1"