About Store Forum Documentation Contact



Post Reply 
Physics reportTrigger in class
Author Message
loveblade Offline
Member

Post: #1
Physics reportTrigger in class
I'm trying to have custom trigger function for each class instead of looping though each class. Is this possible or do I have to do it some other way?

PHP Code:
class MeshTest Game.Static
{
   
bool  triggered false;
   
virtual void create(Object &obj)
   {
      
super.create(obj);
      
T.actor.trigger(true);
      
Physics.reportTrigger(&ReportTrigger);
      
   }
   
virtual Bool update()
   {
      
super.update();
      if(
triggered)
      {
         
LogN("Triggered");
      }
      return 
true;
   }
   
void ReportTrigger(ActorInfo &triggerActorInfo &actorPHYS_CONTACT contact)
   {
      
triggered=true;
   }
   


This gives C2276: illegal operation on bound member function expression.
(This post was last modified: 08-16-2021 08:30 AM by loveblade.)
08-16-2021 08:12 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Physics reportTrigger in class
there can be only one global function, and if you keep it in a class, then you have to define it as "static".
08-16-2021 08:46 AM
Find all posts by this user Quote this message in a reply
Post Reply