mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -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))
|
assert self.notify.debugCall(id(self))
|
||||||
controls = self.controls.get(name)
|
controls = self.controls.get(name)
|
||||||
|
|
||||||
if controls is not None:
|
if controls is not None:
|
||||||
if controls is not self.currentControls:
|
if controls is not self.currentControls:
|
||||||
if self.currentControls is not None:
|
if self.currentControls is not None:
|
||||||
|
@ -186,10 +186,9 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
|||||||
return
|
return
|
||||||
assert not avatarNodePath.isEmpty()
|
assert not avatarNodePath.isEmpty()
|
||||||
|
|
||||||
if not hasattr(self,'actorNode'):
|
if 0:
|
||||||
|
|
||||||
# Connect to Physics Manager:
|
# Connect to Physics Manager:
|
||||||
self.actorNode=ActorNode("ship physicsActor")
|
self.actorNode=ActorNode("ship-physicsActor")
|
||||||
self.actorNode.getPhysicsObject().setOriented(1)
|
self.actorNode.getPhysicsObject().setOriented(1)
|
||||||
self.actorNode.getPhysical(0).setViscosity(0.1)
|
self.actorNode.getPhysical(0).setViscosity(0.1)
|
||||||
physicsActor=render.attachNewNode(self.actorNode)
|
physicsActor=render.attachNewNode(self.actorNode)
|
||||||
@ -199,6 +198,14 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
|||||||
avatarNodePath.setPos(Vec3(0))
|
avatarNodePath.setPos(Vec3(0))
|
||||||
avatarNodePath.setHpr(Vec3(0))
|
avatarNodePath.setHpr(Vec3(0))
|
||||||
avatarNodePath.assign(physicsActor)
|
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()
|
self.phys=PhysicsManager.PhysicsManager()
|
||||||
|
|
||||||
fn=ForceNode("ship gravity")
|
fn=ForceNode("ship gravity")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user