mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
let ship setup actorNode on it's own
This commit is contained in:
parent
579febfb12
commit
f3148f3fc0
@ -107,6 +107,7 @@ class ControlManager:
|
||||
"""
|
||||
assert self.notify.debugCall(id(self))
|
||||
controls = self.controls.get(name)
|
||||
|
||||
if controls is not None:
|
||||
if controls is not self.currentControls:
|
||||
if self.currentControls is not None:
|
||||
|
@ -186,10 +186,9 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
||||
return
|
||||
assert not avatarNodePath.isEmpty()
|
||||
|
||||
if not hasattr(self,'actorNode'):
|
||||
|
||||
if 0:
|
||||
# Connect to Physics Manager:
|
||||
self.actorNode=ActorNode("ship physicsActor")
|
||||
self.actorNode=ActorNode("ship-physicsActor")
|
||||
self.actorNode.getPhysicsObject().setOriented(1)
|
||||
self.actorNode.getPhysical(0).setViscosity(0.1)
|
||||
physicsActor=render.attachNewNode(self.actorNode)
|
||||
@ -199,6 +198,14 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
||||
avatarNodePath.setPos(Vec3(0))
|
||||
avatarNodePath.setHpr(Vec3(0))
|
||||
avatarNodePath.assign(physicsActor)
|
||||
else:
|
||||
print "doing getPhysicsObject"
|
||||
physicsActor = avatarNodePath
|
||||
self.actorNode = physicsActor.node()
|
||||
self.actorNode.getPhysicsObject().setOriented(1)
|
||||
self.actorNode.getPhysical(0).setViscosity(0.1)
|
||||
|
||||
if not hasattr(self, "phys"):
|
||||
self.phys=PhysicsManager.PhysicsManager()
|
||||
|
||||
fn=ForceNode("ship gravity")
|
||||
|
Loading…
x
Reference in New Issue
Block a user