|
pX_selectgroup ( unsigned int bitmask ); |
Deletes all Actors that are not matching the provided bitmask. All physical entities ( Actors ) that were deleted by this function will be recreated in time, if their group ID matches to the bitmask. When your player moves out of viewing range of a physical entity (group) you can delete these objects so they don't need to be updated anymore, upon return you can then recreate the group. This function will only recreate / delete registered entities ( Actors ), non physical entities get ignored.
|
Parameters: |
|
bitmask |
all registered physical entities with a group_id matching the bitmask will become active, those not matching the bitmask are deleted. The bitmask is 21 bits; value 2097151 enables all objects. |
|
Returns: |
1 if successful, 0 otherwise.
|
Remarks: |
Here's a sample bitmask for pX_selectgroup( 6 ), where 6 corresponds to the bits 0110:
|
0 |
1 |
1 |
0 |
<- Bitmask (6), first four bits of 21 shown |
Enabled ? |
|
0 |
0 |
0 |
1 |
<- Ent1 group ID (1) |
No |
|
0 |
0 |
1 |
0 |
<- Ent2 group ID (2) |
Yes |
|
0 |
1 |
0 |
0 |
<- Ent3 group ID (4) |
Yes |
|
1 |
0 |
0 |
0 |
<- Ent4 and Ent5 group ID (8) |
No |
when you delete Joints/Wheels with this function, you have to recreate them manual with pXcon_add or pXcon_add6djoint.
pX_selectgroup doesn't affect character controllers (PH_CHAR).
pX_selectgroup must be updated manual.
it is not recommended to run this function frequently.
|
Speed: |
Medium
pXent_settype(earth,1,PH_SPHERE);
pXent_setgroup( earth, 2 );
pX_selectgroup(1); // activates group1, all others are disabled/paused (earth entity) ... while(1){ if(key_f && earth.group!=1){
pXent_setgroup( earth, 1 ); // set entity to group1 -> entity gets enabled/activated
} wait(1);
}