| 913 | // CONSTRAINT REMAPPING << |
| 914 | |
| 915 | void afxChoreographer::remapObjectConstraint(SceneObject* object, const char* cons_name) |
| 916 | { |
| 917 | if (!object || !cons_name) |
| 918 | return; |
| 919 | |
| 920 | // must be a constraint-def with a matching name in the list |
| 921 | dynConstraintDef* dyn_def = find_cons_def_by_name(cons_name); |
| 922 | if (!dyn_def) |
| 923 | { |
| 924 | Con::errorf("afxChoreographer::remapObjectConstraint() -- failed to find constraint name [%s].", cons_name); |
| 925 | return; |
| 926 | } |
| 927 | |
| 928 | // constraint-def must have matching name constraint-type |
| 929 | if (dyn_def->cons_type != OBJECT_CONSTRAINT) |
| 930 | { |
| 931 | Con::errorf("afxChoreographer::remapObjectConstraint() -- remapped contraint type does not match existing constraint type."); |
| 932 | return; |
| 933 | } |
| 934 | |
| 935 | // nothing to do if new object is same as old |
| 936 | if (dyn_def->cons_obj.object == object) |
| 937 | { |
| 938 | #ifdef TORQUE_DEBUG |
| 939 | Con::warnf("afxChoreographer::remapObjectConstraint() -- remapped contraint object is same as existing object."); |
| 940 | #endif |
| 941 | return; |
| 942 | } |
| 943 | |
| 944 | dyn_def->cons_obj.object = object; |
| 945 | deleteNotify(object); |
| 946 | |
| 947 | constraint_mgr->setReferenceObject(StringTable->insert(cons_name), object); |
| 948 | |
| 949 | #if defined(AFX_CAP_SCOPE_TRACKING) |
| 950 | if (isServerObject() && object->isScopeable()) |
| 951 | constraint_mgr->addScopeableObject(object); |
| 952 | #endif |
| 953 | |
| 954 | if (isServerObject()) |
| 955 | { |
| 956 | if (remapped_cons_sent) |
| 957 | { |
| 958 | remapped_cons_defs.clear(); |
| 959 | remapped_cons_sent = false; |
| 960 | } |
| 961 | remapped_cons_defs.push_back(dyn_def); |
| 962 | setMaskBits(RemapConstraintMask); |
| 963 | } |
| 964 | } |
| 965 | |
| 966 | void afxChoreographer::remapObjectConstraint(U16 scope_id, const char* cons_name, bool is_shape) |
| 967 | { |
nothing calls this directly
no test coverage detected