Player sprite can move into physics bodys with apply impulse

In my game I have two basic types of objects. Player, and Level.

The player is a single sprite that moves around with

                         phys->setVelocity(Vect(0, 0));

			if(1 == 1) //CHECK THAT SPRING IS NOT CONECTED
			{
				phys->applyImpulse(Vect(vx, vy));
			}

The teeth get their physics bodies like so (eventually this will be a path node)

void genPhysics(bool top, PhysicsInfo* physy)
	{
		auto size = image->getBoundingBox().size;
		auto mat = PhysicsMaterial(1.0, 0.2, 0.2);
		auto anchor = image->getAnchorPoint();
		PhysicsBody* phys;
		if (top)
		{
			phys = PhysicsBody::createBox(size, mat,  Vec2(0, (size.height) * -(anchor.y - 0.5)));//size.height));
		}
		else
		{
			phys = PhysicsBody::createBox(size, mat,  Vec2(0, (size.height) * -(anchor.y - 0.5) - size.height));
		}
		phys->setDynamic(false);

		phys->setCategoryBitmask(physy->category_tooth);
		phys->setCollisionBitmask(physy->contact_tooth);

		this->addComponent(phys);
	}

And the player gets its physics like so

auto phys = PhysicsBody::createCircle(size.width / 2, playerMat);
	phys->setAngularVelocityLimit(0.0);
	Charecter->setPhysicsBody(phys);
	phys->setCategoryBitmask(physicsi->category_player);
	phys->setCollisionBitmask(physicsi->contact_player);

Here is the PhysicsInfo class it keeps referencing

class PhysicsInfo
{
public:
	int category_player = (0x1 << 2);
	int category_tooth = (0x1 << 3);
	int category_wall = (0x1 << 4);
	int category_sensor = (0x1 << 5);

	int contact_player = (0x1 << 2) | (0x1 << 3) | (0x1 << 4);
	int contact_tooth =  (0x1 << 2);
	int contact_wall =  (0x1 << 2);
	int contact_sensor = 0x0;
};

Some things to note:

  • Any collision with level geometry causes sprite to go in, and gradually be pushed out.
  • Debug drawing does show a collision
  • Although rotation is locked the sprite does somehow find a way to rotate
  • The level edges physics bodies do not behave like this, they are 4 boxes that extend from the edge, then out abit.
  • The level geometry is constantly intersecting.

If I sent my cocos project folder would that help me get a response? I am still stuck on this.

Do I need to reword my question? Is the answer really obious or something? I still havent gotten feedback!

I think you could probably try to explain what you mean by ‘sprite can move into physics bodies with apply impulse’ - maybe a video or some screen shots?

Here is a video

I have a few physics based projects and I am not seeing what you are seeing. Is there a way for you to send me your project and I can try and debug it a bit?

My artist wants me to be careful with the assets, I pm’ed you a copy.