Panda3D
Loading...
Searching...
No Matches
direct.directtools.DirectManipulation Namespace Reference

Classes

class  DirectManipulationControl
 
class  ObjectHandles
 

Functions

 addTag (self, tag)
 
 disableManipulation (self, allowSelectionOnly=False)
 
 disableWidgetMove (self)
 
 drawBox (lines, center, sideLength)
 
 drawMarquee (self, startX, startY)
 
 enableManipulation (self)
 
 enableWidgetMove (self)
 
 followSelectedNodePathTask (self, state)
 
 getEditTypes (self, objects)
 
 gridSnapping (self, nodePath, offset)
 
 manipulateObject (self)
 
 manipulateObjectCleanup (self)
 
 manipulateObjectTask (self, state)
 
 manipulationStart (self, modifiers)
 
 manipulationStop (self)
 
 plantSelectedNodePath (self)
 Utility functions ##.
 
 removeManipulateObjectTask (self)
 
 removeTag (self, tag)
 
 rotate1D (self, state)
 
 rotate2D (self, state)
 
 rotateAboutViewVector (self, state)
 
 scale1D (self, state)
 
 scale3D (self, state)
 
 scaleWidget (self, factor)
 
 spawnFollowSelectedNodePathTask (self)
 
 spawnManipulateObjectTask (self)
 
 supportMultiView (self)
 
 switchToLocalSpaceMode (self)
 
 switchToMoveMode (self, state)
 
 switchToWorldSpaceMode (self)
 
 toggleObjectHandlesMode (self)
 
 watchMarqueeTask (self, state)
 
 watchMouseTask (self, state)
 
 widgetCheck (self, type)
 
 xlate1D (self, state)
 WIDGET MANIPULATION METHODS ###.
 
 xlate2D (self, state)
 
 xlateCamXY (self, state)
 
 xlateCamXZ (self, state)
 FREE MANIPULATION METHODS ###.
 

Variables

 actionEvents
 
 bb = geom.getBounds()
 
 bbc = bb.makeCopy()
 
 boundingSphereTest = marqueeFrustum.contains(bbc)
 
 constraint = entry.getIntoNodePath().getName()
 
 currEditTypes = editTypes
 
 defaultSkipFlags
 ['.
 
 deltaNearX = coaCenter[0] - base.direct.dr.nearVec[0]
 
 entry = base.direct.iRay.pickGeom(skipFlags = skipFlags)
 
 fAllowMarquee
 
int fAllowSelectionOnly
 
 fGridSnap
 
int fHitInit = 1
 
 fll = Point3(min[0], max[1], min[2])
 
 flr = Point3(max[0], max[1], min[2])
 
int fManip = 1
 
int fMovable
 
int fMultiView
 
 frontViewWidget = ObjectHandles('frontViewWidget')
 
int fScaleInit = 1
 
int fScaleInit1 = 1
 
int fScaling1D = 0:
 
int fScaling3D = 0
 
int fSetCoa = 1 - self.fSetCoa
 
 ful = Point3(min[0], max[1], max[2])
 
 fur = max
 
 fWidgetTop = self.widgetCheck('top?')
 
 hitPt = 0
 
 hitPtDist
 
 hitPtScale = self.objectHandles.getMat().xformVec(self.hitPtScale)
 
 initScale = base.direct.widget.getScale()
 
 initScaleMag = Vec3(self.objectHandles.getAxisIntersectPt(self.constraint[:1])).length()
 
 lastCrankAngle = getCrankAngle(self.rotationCenter)
 
 leftViewWidget = ObjectHandles('leftViewWidget')
 
 manipulationStart = allowSelectionOnly
 
 manipulationStop
 
 marquee
 
tuple marqueeInfo = (startX, startY, endX, endY)
 
 max = Point3(0)
 
 min = Point3(0)
 
str mode
 
 moveDir = None
 
 nll = min
 
 nlr = Point3(max[0], min[1], min[2])
 
 nodePath = findTaggedNodePath(geom)
 elif (skipFlags & SKIP_BACKFACE) and base.direct.iRay.isEntryBackfacing():
 
 nul = Point3(min[0], min[1], max[2])
 
 nur = Point3(max[0], min[1], max[2])
 
 optionalSkipFlags
 
 origScale = base.direct.widget.getScale()
 
str rotateAxis = self.constraint[:1]
 
 rotationCenter = getScreenXY(base.direct.widget)
 
 switchToMoveMode = None
 
 tbb = BoundingHexahedron(fll, flr, fur, ful, nll, nlr, nur, nul)
 
 tightBoundTest = marqueeFrustum.contains(tbb)
 
 tMat = Mat4(geom.getMat())
 
 topViewWidget = ObjectHandles('topViewWidget')
 
 unmovableTagList
 
 useSeparateScaleHandles = self.constraint[2:]
 
list widgetList = [self.topViewWidget, self.frontViewWidget, self.leftViewWidget, self.objectHandles]
 
bool worldSpaceManip = True
 
 xlateSF = Vec3(vWidget2Camera).length()
 

Function Documentation

◆ addTag()

addTag ( self,
tag )

◆ disableManipulation()

disableManipulation ( self,
allowSelectionOnly = False )

◆ disableWidgetMove()

disableWidgetMove ( self)

◆ drawBox()

drawBox ( lines,
center,
sideLength )

◆ drawMarquee()

drawMarquee ( self,
startX,
startY )

◆ enableManipulation()

enableManipulation ( self)

◆ enableWidgetMove()

enableWidgetMove ( self)

◆ followSelectedNodePathTask()

followSelectedNodePathTask ( self,
state )

◆ getEditTypes()

getEditTypes ( self,
objects )

◆ gridSnapping()

gridSnapping ( self,
nodePath,
offset )

◆ manipulateObject()

manipulateObject ( self)

◆ manipulateObjectCleanup()

manipulateObjectCleanup ( self)

◆ manipulateObjectTask()

manipulateObjectTask ( self,
state )

◆ manipulationStart()

manipulationStart ( self,
modifiers )

◆ manipulationStop()

manipulationStop ( self)

◆ plantSelectedNodePath()

plantSelectedNodePath ( self)

Utility functions ##.

 Move selected object to intersection point of cursor on scene 

◆ removeManipulateObjectTask()

removeManipulateObjectTask ( self)

◆ removeTag()

removeTag ( self,
tag )

◆ rotate1D()

rotate1D ( self,
state )

◆ rotate2D()

rotate2D ( self,
state )
 Virtual trackball rotation of widget 

◆ rotateAboutViewVector()

rotateAboutViewVector ( self,
state )

◆ scale1D()

scale1D ( self,
state )

◆ scale3D()

scale3D ( self,
state )

◆ scaleWidget()

scaleWidget ( self,
factor )

◆ spawnFollowSelectedNodePathTask()

spawnFollowSelectedNodePathTask ( self)

◆ spawnManipulateObjectTask()

spawnManipulateObjectTask ( self)

◆ supportMultiView()

supportMultiView ( self)

◆ switchToLocalSpaceMode()

switchToLocalSpaceMode ( self)

◆ switchToMoveMode()

switchToMoveMode ( self,
state )

◆ switchToWorldSpaceMode()

switchToWorldSpaceMode ( self)

◆ toggleObjectHandlesMode()

toggleObjectHandlesMode ( self)

◆ watchMarqueeTask()

watchMarqueeTask ( self,
state )

◆ watchMouseTask()

watchMouseTask ( self,
state )

◆ widgetCheck()

widgetCheck ( self,
type )

◆ xlate1D()

xlate1D ( self,
state )

WIDGET MANIPULATION METHODS ###.

◆ xlate2D()

xlate2D ( self,
state )

◆ xlateCamXY()

xlateCamXY ( self,
state )
Constrained 2D motion perpendicular to camera's image plane
This moves the object in the camera's XY plane if shift is held
Moves object toward camera if control is held

◆ xlateCamXZ()

xlateCamXZ ( self,
state )

FREE MANIPULATION METHODS ###.

Constrained 2D motion parallel to the camera's image plane
This moves the object in the camera's XZ plane

Variable Documentation

◆ actionEvents

actionEvents

◆ bb

bb = geom.getBounds()

◆ bbc

bbc = bb.makeCopy()

◆ boundingSphereTest

boundingSphereTest = marqueeFrustum.contains(bbc)

◆ constraint

constraint = entry.getIntoNodePath().getName()

◆ currEditTypes

currEditTypes = editTypes

◆ defaultSkipFlags

defaultSkipFlags

['.

', self.objectHandles.multiplyScalingFactorBy, 2.0], ['>', self.objectHandles.multiplyScalingFactorBy, 2.0], [',', self.objectHandles.multiplyScalingFactorBy, 0.5], ['<', self.objectHandles.multiplyScalingFactorBy, 0.5],

◆ deltaNearX

deltaNearX = coaCenter[0] - base.direct.dr.nearVec[0]

◆ entry

entry = base.direct.iRay.pickGeom(skipFlags = skipFlags)

◆ fAllowMarquee

fAllowMarquee

◆ fAllowSelectionOnly

int fAllowSelectionOnly

◆ fGridSnap

fGridSnap

◆ fHitInit

int fHitInit = 1

◆ fll

fll = Point3(min[0], max[1], min[2])

◆ flr

flr = Point3(max[0], max[1], min[2])

◆ fManip

int fManip = 1

◆ fMovable

int fMovable

◆ fMultiView

int fMultiView

◆ frontViewWidget

frontViewWidget = ObjectHandles('frontViewWidget')

◆ fScaleInit

int fScaleInit = 1

◆ fScaleInit1

int fScaleInit1 = 1

◆ fScaling1D

int fScaling1D = 0:

◆ fScaling3D

fScaling3D = 0

◆ fSetCoa

int fSetCoa = 1 - self.fSetCoa

◆ ful

ful = Point3(min[0], max[1], max[2])

◆ fur

fur = max

◆ fWidgetTop

fWidgetTop = self.widgetCheck('top?')

◆ hitPt

hitPt = 0

◆ hitPtDist

hitPtDist

◆ hitPtScale

hitPtScale = self.objectHandles.getMat().xformVec(self.hitPtScale)

◆ initScale

initScale = base.direct.widget.getScale()

◆ initScaleMag

initScaleMag = Vec3(self.objectHandles.getAxisIntersectPt(self.constraint[:1])).length()

◆ lastCrankAngle

lastCrankAngle = getCrankAngle(self.rotationCenter)

◆ leftViewWidget

leftViewWidget = ObjectHandles('leftViewWidget')

◆ manipulationStart

manipulationStart = allowSelectionOnly

◆ manipulationStop

manipulationStop

◆ marquee

marquee

◆ marqueeInfo

tuple marqueeInfo = (startX, startY, endX, endY)

◆ max

max = Point3(0)

◆ min

min = Point3(0)

◆ mode

str mode

◆ moveDir

moveDir = None

◆ nll

nll = min

◆ nlr

nlr = Point3(max[0], min[1], min[2])

◆ nodePath

nodePath = findTaggedNodePath(geom)

elif (skipFlags & SKIP_BACKFACE) and base.direct.iRay.isEntryBackfacing():

Skip, if backfacing poly

pass

◆ nul

nul = Point3(min[0], min[1], max[2])

◆ nur

nur = Point3(max[0], min[1], max[2])

◆ optionalSkipFlags

optionalSkipFlags

◆ origScale

origScale = base.direct.widget.getScale()

◆ rotateAxis

str rotateAxis = self.constraint[:1]

◆ rotationCenter

rotationCenter = getScreenXY(base.direct.widget)

◆ switchToMoveMode

switchToMoveMode = None

◆ tbb

tbb = BoundingHexahedron(fll, flr, fur, ful, nll, nlr, nur, nul)

◆ tightBoundTest

tightBoundTest = marqueeFrustum.contains(tbb)

◆ tMat

tMat = Mat4(geom.getMat())

◆ topViewWidget

topViewWidget = ObjectHandles('topViewWidget')

◆ unmovableTagList

unmovableTagList

◆ useSeparateScaleHandles

useSeparateScaleHandles = self.constraint[2:]

◆ widgetList

list widgetList = [self.topViewWidget, self.frontViewWidget, self.leftViewWidget, self.objectHandles]

◆ worldSpaceManip

bool worldSpaceManip = True

◆ xlateSF

xlateSF = Vec3(vWidget2Camera).length()