panda3d.core.DriveInterface

from panda3d.core import DriveInterface
class DriveInterface

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) → None
__init__(name: str) → None
setForwardSpeed(speed: float) → None

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.

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.

setReverseSpeed(speed: float) → None

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.

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.

setRotateSpeed(speed: float) → None

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.

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.

setVerticalDeadZone(zone: float) → None

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.

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.

setHorizontalDeadZone(zone: float) → None

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.

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.

setVerticalRampUpTime(ramp_up_time: float) → None

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.

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.

setVerticalRampDownTime(ramp_down_time: float) → None

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.

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.

setHorizontalRampUpTime(ramp_up_time: float) → None

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.

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.

setHorizontalRampDownTime(ramp_down_time: float) → None

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.

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.

getSpeed() → float

Returns the speed of the previous update in units/sec

getRotSpeed() → float

Returns the rot_speed of the previous update in units/sec

reset() → None

Reinitializes the driver to the origin and resets any knowledge about buttons being held down.

getPos() → LPoint3

Returns the driver’s position.

Return type

LPoint3

getX() → float
getY() → float
getZ() → float
setPos(vec: LVecBase3) → None

Directly sets the driver’s position.

setPos(x: float, y: float, z: float) → None
setX(x: float) → None
setY(y: float) → None
setZ(z: float) → None
getHpr() → LVecBase3

Returns the driver’s orientation.

Return type

LVecBase3

getH() → float
getP() → float
getR() → float
setHpr(hpr: LVecBase3) → None

Directly sets the driver’s orientation.

setHpr(h: float, p: float, r: float) → None
setH(h: float) → None
setP(p: float) → None
setR(r: float) → None
setForceRoll(force_roll: float) → None

This function is no longer used and does nothing. It will be removed soon.

setIgnoreMouse(ignore_mouse: bool) → None

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.

getIgnoreMouse() → bool

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

setForceMouse(force_mouse: bool) → None

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.

getForceMouse() → bool

Returns the current setting of the force_mouse flag. See setForceMouse().

setStopThisFrame(stop_this_frame: bool) → None

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.

getStopThisFrame() → bool

Returns the current setting of the stop_this_frame flag. See setStopThisFrame().

setMat(mat: LMatrix4) → None

Stores the indicated transform in the DriveInterface.

getMat() → LMatrix4

Returns the current transform.

Return type

LMatrix4

forceDgraph() → None

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
Return type

TypeHandle