Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
DriveInterface Class Reference

This is a TFormer, similar to Trackball, that moves around a transform matrix in response to mouse input. More...

Inheritance diagram for DriveInterface:
MouseInterfaceNode DataNode PandaNode TypedWritable Namable LinkedListNode ReferenceCount TypedObject

List of all members.

Public Member Functions

 DriveInterface (string name)
 DriveInterface ()
 forceDgraph ()
 This is a special kludge for DriveInterface to allow us to avoid the one-frame latency after a collision.
bool getForceMouse ()
 Returns the current setting of the force_mouse flag.
float getForwardSpeed ()
 Returns the speed of full forward motion, when the mouse is at the very top of the window.
float getH ()
float getHorizontalDeadZone ()
 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.
float getHorizontalRampDownTime ()
 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.
float getHorizontalRampUpTime ()
 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.
VBase3 const getHpr ()
 Returns the driver's orientation.
bool getIgnoreMouse ()
 Returns the current setting of the ignore_mouse flag.
Mat4 const getMat ()
 Returns the current transform.
float getP ()
Point3 const getPos ()
 Returns the driver's position.
float getR ()
float getReverseSpeed ()
 Returns the speed of full reverse motion, when the mouse is at the very bottom of the window.
float getRotateSpeed ()
 Returns the maximum rate at which the user can rotate left or right, when the mouse is at the very edge of the window.
float getRotSpeed ()
 Returns the rot_speed of the previous update in units/sec.
float getSpeed ()
 Returns the speed of the previous update in units/sec.
bool getStopThisFrame ()
 Returns the current setting of the stop_this_frame flag.
float getVerticalDeadZone ()
 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.
float getVerticalRampDownTime ()
 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.
float getVerticalRampUpTime ()
 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.
float getX ()
float getY ()
float getZ ()
 reset ()
 Reinitializes the driver to the origin and resets any knowledge about buttons being held down.
 setForceMouse (bool force_mouse)
 Changes the state of the force_mouse flag.
 setForceRoll (float force_roll)
 This function is no longer used and does nothing.
 setForwardSpeed (float speed)
 Sets the speed of full forward motion, when the mouse is at the very top of the window.
 setH (float h)
 setHorizontalDeadZone (float zone)
 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.
 setHorizontalRampDownTime (float ramp_down_time)
 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 (float ramp_up_time)
 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 (VBase3 const hpr)
 Directly sets the driver's orientation.
 setHpr (float h, float p, float r)
 setIgnoreMouse (bool ignore_mouse)
 Changes the state of the ignore_mouse flag.
 setMat (Mat4 const mat)
 Stores the indicated transform in the DriveInterface.
 setP (float p)
 setPos (VBase3 const vec)
 Directly sets the driver's position.
 setPos (float x, float y, float z)
 setR (float r)
 setReverseSpeed (float speed)
 Sets the speed of full reverse motion, when the mouse is at the very bottom of the window.
 setRotateSpeed (float speed)
 Sets the maximum rate at which the user can rotate left or right, when the mouse is at the very edge of the window.
 setStopThisFrame (bool stop_this_frame)
 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.
 setVerticalDeadZone (float zone)
 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.
 setVerticalRampDownTime (float ramp_down_time)
 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 (float ramp_up_time)
 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 (float x)
 setY (float y)
 setZ (float z)

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

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.


Constructor & Destructor Documentation

DriveInterface ( string  name)

Member Function Documentation

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 TypeHandle getClassType ( ) [static]

Reimplemented from MouseInterfaceNode.

bool getForceMouse ( )

Returns the current setting of the force_mouse flag.

See set_force_mouse().

float getForwardSpeed ( )

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.

float getH ( )

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.

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.

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.

VBase3 const getHpr ( )

Returns the driver's orientation.

bool getIgnoreMouse ( )

Returns the current setting of the ignore_mouse flag.

See set_ignore_mouse().

Mat4 const getMat ( )

Returns the current transform.

float getP ( )
Point3 const getPos ( )

Returns the driver's position.

float getR ( )
float getReverseSpeed ( )

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.

float getRotateSpeed ( )

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.

float getRotSpeed ( )

Returns the rot_speed of the previous update in units/sec.

float getSpeed ( )

Returns the speed of the previous update in units/sec.

bool getStopThisFrame ( )

Returns the current setting of the stop_this_frame flag.

See set_stop_this_frame().

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.

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.

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.

float getX ( )
float getY ( )
float getZ ( )
reset ( )

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

setForceMouse ( bool  force_mouse)

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 ( float  force_roll)

This function is no longer used and does nothing.

It will be removed soon.

setForwardSpeed ( float  speed)

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 ( float  h)
setHorizontalDeadZone ( float  zone)

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 ( float  ramp_down_time)

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 ( float  ramp_up_time)

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 ( VBase3 const  hpr)

Directly sets the driver's orientation.

setHpr ( float  h,
float  p,
float  r 
)
setIgnoreMouse ( bool  ignore_mouse)

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 ( Mat4 const  mat)

Stores the indicated transform in the DriveInterface.

setP ( float  p)
setPos ( VBase3 const  vec)

Directly sets the driver's position.

setPos ( float  x,
float  y,
float  z 
)
setR ( float  r)
setReverseSpeed ( float  speed)

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 ( float  speed)

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 ( bool  stop_this_frame)

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 ( float  zone)

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 ( float  ramp_down_time)

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 ( float  ramp_up_time)

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 ( float  x)
setY ( float  y)
setZ ( float  z)
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties