DriveInterface
from panda3d.core import DriveInterface
- class DriveInterface
Bases:
Bases:
MouseInterfaceNode
This is a TFormer, similar to Trackball, that moves around a transform matrix in response to mouse input. The basic motion is on a horizontal plane, as if driving a vehicle.
Inheritance diagram
- __init__(param0: DriveInterface)
- __init__(name: str)
- forceDgraph()
This is a special kludge for
DriveInterface
to allow us to avoid the one- frame latency after a collision. It forces an immediate partial data flow for all data graph nodes below this node, causing all data nodes that depend on this matrix to be updated immediately.
- static getClassType() TypeHandle
- getForceMouse() bool
Returns the current setting of the force_mouse flag. See
setForceMouse()
.
- getForwardSpeed() float
Returns the speed of full forward motion, when the mouse is at the very top of the window. This is in units (e.g. feet) per second.
- getHorizontalDeadZone() float
Returns the size of the vertical bar in the center of the screen that represents the “dead zone” of horizontal motion: the region in which the mouse does not report horizontal motion. This is in a fraction of the window width, so 0.5 will set a dead zone as large as half the screen.
- getHorizontalRampDownTime() float
Returns the amount of time, in seconds, it takes between the time a left or right arrow key is released and the time it registers no motion.
- getHorizontalRampUpTime() float
Returns the amount of time, in seconds, it takes between the time a left or right arrow key is pressed and the time it registers full rotation.
- getIgnoreMouse() bool
Returns the current setting of the ignore_mouse flag. See
setIgnoreMouse()
.
- getReverseSpeed() float
Returns the speed of full reverse motion, when the mouse is at the very bottom of the window. This is in units (e.g. feet) per second.
- getRotateSpeed() float
Returns the maximum rate at which the user can rotate left or right, when the mouse is at the very edge of the window. This is in degrees per second.
- getStopThisFrame() bool
Returns the current setting of the stop_this_frame flag. See
setStopThisFrame()
.
- getVerticalDeadZone() float
Returns the size of the horizontal bar in the center of the screen that represents the “dead zone” of vertical motion: the region in which the mouse does not report vertical motion. This is in a fraction of the window height, so 0.5 will set a dead zone as large as half the screen.
- getVerticalRampDownTime() float
Returns the amount of time, in seconds, it takes between the time an up or down arrow key is released and the time it registers no motion.
- getVerticalRampUpTime() float
Returns the amount of time, in seconds, it takes between the time an up or down arrow key is pressed and the time it registers full forward or backward motion.
- reset()
Reinitializes the driver to the origin and resets any knowledge about buttons being held down.
- setForceMouse(force_mouse: bool)
Changes the state of the force_mouse flag. If this flag is true, the mouse button need not be held down in order to drive the avatar around.
- setForceRoll(force_roll: float)
This function is no longer used and does nothing. It will be removed soon.
- setForwardSpeed(speed: float)
Sets the speed of full forward motion, when the mouse is at the very top of the window. This is in units (e.g. feet) per second.
- setHorizontalDeadZone(zone: float)
Sets the size of the vertical bar in the center of the screen that represents the “dead zone” of horizontal motion: the region in which the mouse does not report horizontal motion. This is in a fraction of the window width, so 0.5 will set a dead zone as large as half the screen.
- setHorizontalRampDownTime(ramp_down_time: float)
Sets the amount of time, in seconds, it takes between the time a left or right arrow key is released and the time it registers no motion.
- setHorizontalRampUpTime(ramp_up_time: float)
Sets the amount of time, in seconds, it takes between the time a left or right arrow key is pressed and the time it registers full rotation.
- setIgnoreMouse(ignore_mouse: bool)
Changes the state of the ignore_mouse flag. If this flag is true, the
DriveInterface
will ignore mouse down button events (but still recognize mouse up button events); the user will not be able to start theDriveInterface
going again if it is stopped, but if the user is currently holding down a mouse button it will not stop immediately until the user eventually releases the button.
- setMat(mat: LMatrix4)
Stores the indicated transform in the
DriveInterface
.
- setReverseSpeed(speed: float)
Sets the speed of full reverse motion, when the mouse is at the very bottom of the window. This is in units (e.g. feet) per second.
- setRotateSpeed(speed: float)
Sets the maximum rate at which the user can rotate left or right, when the mouse is at the very edge of the window. This is in degrees per second.
- setStopThisFrame(stop_this_frame: bool)
If stop_this_frame is true, the next time the frame is computed no motion will be allowed, and then the flag is reset to false. This can be used to prevent too much movement when we know a long time has artificially elapsed, for instance when we take a screenshot, without munging the clock for everything else.
- setVerticalDeadZone(zone: float)
Sets the size of the horizontal bar in the center of the screen that represents the “dead zone” of vertical motion: the region in which the mouse does not report vertical motion. This is in a fraction of the window height, so 0.5 will set a dead zone as large as half the screen.
- setVerticalRampDownTime(ramp_down_time: float)
Sets the amount of time, in seconds, it takes between the time an up or down arrow key is released and the time it registers no motion.