|
pXent_addshape ( entity1, entity2, var hull ); |
This function adds a new shape to an actor, using the size of the entity2. If you want to create more complex, but static Actors, use pXent_settype with PH_CONVEX.
|
Parameters: |
|
entity1 |
registered Entity pointer (Actor) |
|
entity2 |
Entity (added shape size) or NULL. ( if NULL, entity1's size is used ) |
|
hull |
PH_BOX, PH_SPHERE or PH_CAPSULE |
|
Returns: |
1 if successful, 0 otherwise.
|
Speed: |
Fast
...
pXent_addshape( my, box, PH_BOX, vector(0,0,40)); // adds a box-Actor with the size of the you entity to the my-entity-Actor. pXent_RemoveShapeFromActor( my, 1); //removes the added box
... function compound_test() { ENTITY* ceiling = ent_create("tor.mdl",vector(-40,100,40),NULL); ceiling.pan=90; ENTITY* shell_top = ent_create("shell2.mdl",vector(-40,100,80),NULL); shell_top.roll = 90; shell_top.scale_x = shell_top.scale_y = 0.4; shell_top.scale_z = 3; ENTITY* shell_left = ent_create("shell2.mdl",vector(-40,147,40),NULL); shell_left.scale_x = shell_left.scale_y = 0.4; shell_left.scale_z = 6; ENTITY* shell_right = ent_create("shell2.mdl",vector(-40,53,40),NULL); shell_right.scale_x = shell_right.scale_y = 0.4; shell_right.scale_z = 6; ENTITY* sphere_left = ent_create("earth.mdl",vector(-40,147,80),NULL); ENTITY* sphere_right = ent_create("earth.mdl",vector(-40,53,80),NULL); set(ceiling,POLYGON); pXent_settype(ceiling,3,PH_BOX); pXent_addshape(ceiling, shell_top, PH_BOX); pXent_addshape(ceiling, shell_left, PH_CAPSULE); pXent_addshape(ceiling, shell_right, PH_CAPSULE); pXent_addshape(ceiling, sphere_left, PH_SPHERE); pXent_addshape(ceiling, sphere_right, PH_SPHERE); ptr_remove(shell_top); ptr_remove(shell_left); ptr_remove(shell_right); ptr_remove(sphere_left); ptr_remove(sphere_right); wait(2); pXent_RemoveShapeFromActor(ceiling, 0); }