I'm making a custom class that extends Unigine's WorldTrigger. I find that two of the constructors below cannot "coexist". These would be the second and third constructors - TriggerObject(vec3 size), TriggerObject(string callback). The interpreter does not throw a correct error in the first place, which took me quite some time to figure out that the class can only work with one constructor but not the other.
#ifndef MY_OBJECT_H
#define MY_OBJECT_H
class TriggerObject : WorldTrigger {
public:
TriggerObject() : WorldTrigger(vec3_one * 2) {
setEnterCallback("OnTriggerEnter", this);
setLeaveCallback("OnTriggerExit", this);
}
TriggerObject (vec3 size) : WorldTrigger(size) {
}
TriggerObject(string callback) : WorldTrigger(vec3_one * 2) {
}
~TriggerObject () {
delete extern;
}
void OnTriggerEnter (Node node, TriggerObject instance) {
log.message(node.getName() + " entered.\n");
}
void OnTriggerExit (Node node, TriggerObject instance) {
log.message(node.getName() + " exited.\n");
}
};
#endif
Has anybody else experienced this? What is wrong with my code?