What is the correct way to create and set up a phys actor in a custom object class? Here is what I have so far.
In the create function, I use this to set up the actor.
Code:
actor.create(*obj.phys());
actor.obj(this);
Then in the update function, I use this to keep the actor positioned correctly with the mesh.
Code:
actor.matrix(matrix());
So far this seems to be working. If I try drawing the actor, it draws in the correct position with my mesh.
However if I try to create the phys body using any tool other than "Create from Mesh (as Mesh)" (for example, "Create from Mesh (as Convex)" or "Add Box"), then the phys actor doesn't work properly in my game. When my character bumps into the actor, the character is "bounced" very high up into the air.
If I load the object in as a STATIC object (instead of using my custom class), then it works fine then with any phys body. Therefore the Static object class must be doing something different with the phys actor.
Can anyone show me how to set up a phys actor correctly in a custom class?
Perhaps I've found the solution to this problem. Does it have anything to do with the density of the actor. I have tried setting the density to 0 and it has stopped the character from bouncing off the actor. Is this how the Static object class handles it?