14 #ifndef CollisionHandlerGravity_H 15 #define CollisionHandlerGravity_H 32 INLINE
void set_offset(PN_stdfloat offset);
33 INLINE PN_stdfloat get_offset()
const;
35 INLINE
void set_reach(PN_stdfloat reach);
36 INLINE PN_stdfloat get_reach()
const;
38 INLINE PN_stdfloat get_airborne_height()
const;
39 INLINE
bool is_on_ground()
const;
40 INLINE PN_stdfloat get_impact_velocity()
const;
41 INLINE
const LVector3 &get_contact_normal()
const;
43 INLINE
void add_velocity(PN_stdfloat velocity);
44 INLINE
void set_velocity(PN_stdfloat velocity);
45 INLINE PN_stdfloat get_velocity()
const;
47 INLINE
void set_gravity(PN_stdfloat gravity);
48 INLINE PN_stdfloat get_gravity()
const;
50 INLINE
void set_max_velocity(PN_stdfloat max_vel);
51 INLINE PN_stdfloat get_max_velocity()
const;
53 INLINE
void set_legacy_mode(
bool legacy_mode);
54 INLINE
bool get_legacy_mode()
const;
57 MAKE_PROPERTY(offset, get_offset, set_offset);
58 MAKE_PROPERTY(reach, get_reach, set_reach);
59 MAKE_PROPERTY(airborne_height, get_airborne_height);
60 MAKE_PROPERTY(on_ground, is_on_ground);
61 MAKE_PROPERTY(impact_velocity, get_impact_velocity);
62 MAKE_PROPERTY(contact_normal, get_contact_normal);
63 MAKE_PROPERTY(velocity, get_velocity, set_velocity);
64 MAKE_PROPERTY(gravity, get_gravity, set_gravity);
65 MAKE_PROPERTY(max_velocity, get_max_velocity, set_max_velocity);
68 PN_stdfloat set_highest_collision(
const NodePath &target_node_path,
const NodePath &from_node_path,
const Entries &entries);
69 virtual bool handle_entries();
70 virtual void apply_linear_force(ColliderDef &def,
const LVector3 &force);
75 PN_stdfloat _airborne_height;
76 PN_stdfloat _impact_velocity;
78 PN_stdfloat _current_velocity;
79 PN_stdfloat _max_velocity;
80 LVector3 _contact_normal;
88 static void init_type() {
89 CollisionHandlerPhysical::init_type();
91 CollisionHandlerPhysical::get_class_type());
94 return get_class_type();
96 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
A specialized kind of CollisionHandler that sets the Z height of the collider to a fixed linear offse...
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The abstract base class for a number of CollisionHandlers that have some physical effect on their mov...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...