Removed the helper function from the header.

Also fixed a missing const
Fixed layertransform with rigidbody objects