I know this has been asked before because i saw a post about it somewhere but the new setup of the site does not let me find ANYTHING (no im not bitter about the new design of the site :-x ) so im asking again. In the hello physics i am using the cannon ball code to make a bullet. One problem, when the bullet is created it seems to push the player back a bit as it seems to be created INSIDE the player THEN accelerated out of the player. Since most of us dont eat guns and then fire them from within our stomachs this is an issue. How do i add some onto the vector for the set local translation (or the setPhysicsLocation im using local translation and it seems to be ok) so that is starts in front of the player then heads outward towards whatever they are shooting at? This is kind of crucial because bullets for the player and enemies will likely be the same thing and collision checking a bullet will make the player get hurt whenever they shoot. thanks in advance heres the code if you have no idea what post im talking about:
public void shoot()
{
Spatial newbullet = bullet.clone();
rootNode.attachChild(newbullet);
newbullet.setLocalTranslation(cam.getLocation());
bullet_phy = new RigidBodyControl(2F);
newbullet.addControl(bullet_phy);
bulletAppState.getPhysicsSpace().add(bullet_phy);
bullet_phy.setLinearVelocity(cam.getDirection().mult(1000));
}