14#ifndef CollisionHandlerGravity_H
15#define CollisionHandlerGravity_H
27class EXPCL_PANDA_COLLIDE CollisionHandlerGravity :
public CollisionHandlerPhysical {
29 CollisionHandlerGravity();
30 virtual ~CollisionHandlerGravity();
41 INLINE
const LVector3 &get_contact_normal()
const;
62 MAKE_PROPERTY(contact_normal, get_contact_normal);
71 PN_stdfloat set_highest_collision(
const NodePath &target_node_path,
const NodePath &from_node_path,
const Entries &entries);
72 virtual bool handle_entries();
73 virtual void apply_linear_force(ColliderDef &def,
const LVector3 &force);
78 PN_stdfloat _airborne_height;
79 PN_stdfloat _impact_velocity;
81 PN_stdfloat _current_velocity;
82 PN_stdfloat _max_velocity;
83 LVector3 _contact_normal;
91 static void init_type() {
92 CollisionHandlerPhysical::init_type();
94 CollisionHandlerPhysical::get_class_type());
96 virtual TypeHandle get_type()
const {
97 return get_class_type();
99 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
102 static TypeHandle _type_handle;
void read_datagram(DatagramIterator &source)
Restores the object state from the given datagram, previously obtained using __getstate__.
void write_datagram(Datagram &destination) const
Serializes this object, to implement pickle support.
set_velocity
Sets the current vertical velocity.
get_max_velocity
Retrieves the maximum speed at which the object will be allowed to descend towards a floor below it,...
set_max_velocity
Sets the maximum speed at which the object will be allowed to descend towards a floor below it,...
get_impact_velocity
How hard did the object hit the ground.
is_on_ground
Is the object at rest?
bool get_legacy_mode() const
returns true if legacy mode is enabled
get_airborne_height
Return the height of the object from the ground.
get_reach
Returns the reach to add to (or subtract from) the highest collision point.
get_offset
Returns the linear offset to add to (or subtract from) the highest detected collision point to determ...
void set_legacy_mode(bool legacy_mode)
Enables old behavior required by Toontown (Sellbot Factory lava room is good test case,...
set_reach
Sets the reach to add to (or subtract from) the highest collision point.
set_gravity
Sets the linear gravity force (always plumb).
set_offset
Sets the linear offset to add to (or subtract from) the highest detected collision point to determine...
get_gravity
Gets the linear gravity force (always plumb).
void add_velocity(PN_stdfloat velocity)
Adds the sepcified amount to the current velocity.
get_velocity
Gets the current vertical velocity.
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...