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)
force_dgraph()

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 get_class_type() TypeHandle
get_force_mouse() bool

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

get_forward_speed() 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.

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

get_horizontal_ramp_down_time() 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.

get_horizontal_ramp_up_time() 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.

get_hpr() LVecBase3

Returns the driver’s orientation.

get_ignore_mouse() bool

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

get_mat() LMatrix4

Returns the current transform.

get_p() float
get_pos() LPoint3

Returns the driver’s position.

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

get_rot_speed() float

Returns the rot_speed of the previous update in units/sec

get_rotate_speed() 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.

get_speed() float

Returns the speed of the previous update in units/sec

get_stop_this_frame() bool

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

get_vertical_dead_zone() 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.

get_vertical_ramp_down_time() 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.

get_vertical_ramp_up_time() 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.

get_x() float
get_y() float
get_z() float
reset()

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

set_force_mouse(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.

set_force_roll(force_roll: float)

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

set_forward_speed(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.

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

set_horizontal_ramp_down_time(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.

set_horizontal_ramp_up_time(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.

set_hpr(hpr: LVecBase3)

Directly sets the driver’s orientation.

set_hpr(h: float, p: float, r: float)
set_ignore_mouse(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.

set_mat(mat: LMatrix4)

Stores the indicated transform in the DriveInterface.

set_p(p: float)
set_pos(vec: LVecBase3)

Directly sets the driver’s position.

set_pos(x: float, y: float, z: float)
set_r(r: float)
set_reverse_speed(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.

set_rotate_speed(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.

set_stop_this_frame(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.

set_vertical_dead_zone(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.

set_vertical_ramp_down_time(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.

set_vertical_ramp_up_time(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.

set_x(x: float)
set_y(y: float)
set_z(z: float)