Hello,
Using Bullet engine and I all I need is to getPos, and getHpr but from a bullet object (My helicopter), which from my understanding is not possible. When I attach the helicopter and call the ‘getHpr’ or the ‘getPos’ it returns 0’s even though my object is moving with the bullet object it is attached too. I guess my question is, if there is some work around like attaching a emptyNode or something just to get the object orientation?
Here is some reference code;
# SHIP
boundBox = BulletBoxShape(Vec3(3, 2, .5))
self.aircraftNP = BulletRigidBodyNode('Box')
self.aircraftNP.setMass(800)
self.aircraftNP.addShape(boundBox)
airNP = render.attachNewNode(self.aircraftNP)
self.world.attachRigidBody(self.aircraftNP)
self.aircraft = loader.loadModel('models/drone.gltf')
self.aircraft.flattenLight()
self.aircraft.reparentTo(airNP)
self.cam.setY(-20)
self.cam.setZ(5)
self.cam.lookAt(airNP)
self.cam.reparentTo(airNP)
So self.cam.getPos() or self.cam.getHpr() returns nothing
neither does self.aircraft.getPos() …
Doing something like;
self.aircraftNP.getInertia())
self.aircraftNP.getLinearVelocity())
self.aircraftNP.getTotalForce())
That works great but all I want in the world POS ???
Any pointers would be greatly appreciated. If I get all this to work then I will start posting content on www.shenko.org
Thank You, for your time