|
For explanation about patches see STATE_polygon_add_patch()
This function is similar to STATE_polygon_add_patch()
only that it is much easier to use. For example if we shoot a wall in a game then we can add a patch polygon to
make it look like a whole in the wall. With this function you just
have to specify the point on the wall where you want the patch to be put,
the size of the patch and the bitmap that it will be using.
The point and the polygon where your bullet hit the wall can be easily obtained
by using STATE_engine_is_movement_possible()
Parameters
----------
father_polygon
The polygon on which we want to place a patch
NOTE: the pach will inherit the father_polygon properties
so if the father polygon is translucent the patch will also be translucent
if the father_polygon is rotated so will be the patch
If you want the patch to have different properties you
have to set them after the patch was created. For example:
double direction[3]={0,0,1};
int rgb[3]={255,0,0} ; red
DWORD patch=STATE_polygon_add_patch_easy(father_polygon, center, radius, direction, bitmap_handle,rgb);
STATE_polygon_set_rotated(patch,NO); making sure that the patch wont be rotated
STATE_polygon_set_translucent(patch,DISABLE_BLENDING); making sure that the patch wont be translucent
A note regarding the function STATE_object_duplicate():
This function will fail if the father_polygon belongs to an object
that was duplicated with the "dont_duplicate_polygons_flag" set
center
A point on the father polygon that will be the center of the patch
radius
Used to specify the size of the patch. Note that the patches are actually
square polygons. This parameter gives the distance between the center of the square and one of the
square edges.
direction
The direction of the patch. For example, if we have a car racing game
and we want the wheels to leave marks then we would like the wheel mark
to be in the direction of the car. So in this case we would give the direction
of the car as the direction of the patch. If you dont know, or if you dont care
about the direction you can give direction={0,0,0}.
texture
The texture that is used to paint the patch.
If NULL then the rgb color will be used
rgb
Used only when texture==NULL. Specifies the color
rgb[0] is red. rgb[1] is green and rgb[2] is blue .
Return value: returns a handle to the created patch polygon.
See also STATE_engine_set_patches_offset()
|