Exemplo n.º 1
0
    def OnNodeMouse1Down(self, planar, collEntry):

        # Cheating a bit here. We just need the planar flag taken from the
        # user ctrl-clicking the gizmo, none of the maths that come with it.
        # We'll use the complementary during the transform operation.
        self.complementary = planar
        planar = False

        Base.OnNodeMouse1Down(self, planar, collEntry)
Exemplo n.º 2
0
 def OnNodeMouse1Down( self, planar, collEntry ):
     Base.OnNodeMouse1Down( self, planar, collEntry )
     
     self._s = pm.Vec3( 0 )
     
     # If in planar mode, clear the billboard effect on the center square
     # and make it face the selected axis
     axis = self.GetSelectedAxis()
     if self.planar and not axis.planar:
         self.square.clearBillboard()
         self.square.lookAt( self, pm.Point3( axis.vector ) )
     else:
         self.square.setHpr( pm.Vec3(0, 0, 0) )
         self.square.setBillboardPointEye()
Exemplo n.º 3
0
 def OnNodeMouse1Down( self, planar, collEntry ):
     Base.OnNodeMouse1Down( self, planar, collEntry )
     
     # Store the initial collision entry
     self.initCollEntry = collEntry
     
     # If the selected axis is the camera vector then use a point on the
     # plane whose normal is the camera vector as the starting vector,
     # otherwise use the surface normal from the collision with the sphere
     axis = self.GetSelectedAxis()
     if axis is not None and axis.vector == CAMERA_VECTOR:
         self.startVec = self.getRelativeVector( self.rootNp, self.startAxisPoint - self.getPos() )
     else:
         self.startVec = self.initCollEntry.getSurfaceNormal( self )