thanks for the answer rbd! I’ll try it out.
is the ship object you are referring to a mesh or node or a nested bullet node NODENAME1.node()?
EDIT - i’m trying this in my input event ahndeler section’
vector = self.rocket1.node().getParent().getRelativeVector(self.rocket1.node(), force)
self.rocket1.node().setActive(True)
#self.rocket1.node().applyCentralForce(force)
self.rocket1.node().applyCentralForce(vector)
self.rocket1.node().applyTorque(torque)
but have error AttributeError: ‘libpandabullet.BulletRigidBodyNode’ object has no attribute ‘getRelativeVector’
agian my lack of knowledge
edit 2 solved it.
def processInput(self,dt):
moveto=[]
force = Vec3(0, 0, 0) # Forward
torque = Vec3(0,0,0)
if inputState.isSet('forward'):
force.setY(-10.0)
if inputState.isSet('back'):
force.setY(10.0)
if inputState.isSet('right'):
torque.setZ(-3.0)
if inputState.isSet('left'):
torque.setZ(3.0)
if inputState.isSet('up'):
torque.setX(-3.0)
if inputState.isSet('down'):
torque.setX(3.0)
if inputState.isSet('shoot'):
print ("camera pos is", self.camX, self.camY , self.camZ)
if inputState.isSet('movehere'):
moveto = self.getMouseXY()
print ("mouse is at",moveto)
spaceS = self.make_space_station(moveto[0],moveto[1],0)
#spaceS.setPos(moveto[0],moveto[1],0)
self.rocket1.node().setActive(True)
force = render.getRelativeVector(self.rocket1, force)
self.rocket1.node().applyCentralForce(force)
self.rocket1.node().applyTorque(torque)
based on your exampe, which i used in google and found this awesome post by ennox. helped a ton.