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

Inheritance diagram of DriveInterface

__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.

getH() float
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.

getHpr() LVecBase3

Returns the driver’s orientation.

getIgnoreMouse() bool

Returns the current setting of the ignore_mouse flag. See setIgnoreMouse().

getMat() LMatrix4

Returns the current transform.

getP() float
getPos() LPoint3

Returns the driver’s position.

getR() float
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.

getRotSpeed() float

Returns the rot_speed of the previous update in units/sec

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.

getSpeed() float

Returns the speed of the previous update in units/sec

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.

getX() float
getY() float
getZ() float
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.

setH(h: float)
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.

setHpr(hpr: LVecBase3)

Directly sets the driver’s orientation.

setHpr(h: float, p: float, r: float)
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 the DriveInterface 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.

setP(p: float)
setPos(vec: LVecBase3)

Directly sets the driver’s position.

setPos(x: float, y: float, z: float)
setR(r: float)
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.

setVerticalRampUpTime(ramp_up_time: float)

Sets 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.

setX(x: float)
setY(y: float)
setZ(z: float)