44class EXPCL_PANDAPHYSX PhysxActor :
public PhysxObject,
public PhysxEnums {
94 PhysxForceMode mode=FM_force,
bool wakeup=
true);
96 PhysxForceMode mode=FM_force,
bool wakeup=
true);
98 PhysxForceMode mode=FM_force,
bool wakeup=
true);
100 PhysxForceMode mode=FM_force,
bool wakeup=
true);
102 PhysxForceMode mode=FM_force,
bool wakeup=
true);
104 PhysxForceMode mode=FM_force,
bool wakeup=
true);
106 PhysxForceMode mode=FM_force,
bool wakeup=
true);
108 PhysxForceMode mode=FM_force,
bool wakeup=
true);
167 void wake_up(
float wakeCounterValue=NX_SLEEP_INTERVAL);
175 INLINE
void ls()
const;
176 INLINE
void ls(std::ostream &out,
int indent_level=0)
const;
185 INLINE NxActor *ptr()
const {
return _ptr; };
188 void link(NxActor *ptr);
203 static void init_type() {
204 PhysxObject::init_type();
206 PhysxObject::get_class_type());
208 virtual TypeHandle get_type()
const {
209 return get_class_type();
211 virtual TypeHandle force_init_type() {
213 return get_class_type();
217 static TypeHandle _type_handle;
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Descriptor for PhysxActor.
LPoint3f get_c_mass_global_pos() const
Returns the center of mass position in world space.
void set_c_mass_global_orientation(const LMatrix3f &mat)
Moves the actor by setting the orientation of the center of mass.
void set_name(const char *name)
Sets a name string for the object that can be retrieved with get_name().
void move_global_mat(const LMatrix4f &mat)
The move_global_* calls serve to move kinematically controlled dynamic actors through the game world.
NodePath get_node_path() const
Retrieves a previously attached NodePath.
const char * get_name() const
Retrieves the name string.
void add_local_torque(const LVector3f torque, PhysxForceMode mode=FM_force, bool wakeup=true)
Applies an impulsive torque defined in the actor local coordinate frame to the actor.
void save_to_desc(PhysxActorDesc &actorDesc) const
Saves the state of the actor to the passed descriptor.
LMatrix3f get_global_inertia_tensor_inverse() const
Returns the inverse of the inertia tensor of the actor relative to the world coordinate frame.
void put_to_sleep()
Forces the actor to sleep.
void set_linear_momentum(const LVector3f &momentum)
Sets the linear momentum of the actor.
void add_force_at_local_pos(const LVector3f force, const LPoint3f &pos, PhysxForceMode mode=FM_force, bool wakeup=true)
Applies a force (or impulse) defined in the global coordinate frame, acting at a particular point in ...
void set_body_flag(PhysxBodyFlag flag, bool value)
Raise or lower individual BodyFlag flags.
void set_contact_report_threshold(float threshold)
Sets the force threshold for contact reports.
void add_local_force(const LVector3f force, PhysxForceMode mode=FM_force, bool wakeup=true)
Applies a force (or impulse) defined in the actor local coordinate frame to the actor.
void update_transform(const LMatrix4f &m)
Updates the transform of an assigned NodePath.
PhysxShape * get_shape_by_name(const char *name) const
Retrieves an individual shape from the actor's array of shapes.
LVector3f get_angular_momentum() const
Retrieves the angular momentum of an actor.
void set_c_mass_offset_local_pos(const LPoint3f &pos)
Sets the position of the center of mass relative to the actor.
void set_group(unsigned int group)
Assigns the actor to a user defined group of actors.
void set_linear_velocity(const LVector3f &linVel)
Sets the linear velocity of the actor.
void set_dominance_group(unsigned int group)
Assigns dynamic actors a dominance group identifier.
void add_torque(const LVector3f torque, PhysxForceMode mode=FM_force, bool wakeup=true)
Applies an impulsive torque defined in the global coordinate frame to the actor.
void move_global_hpr(float h, float p, float r)
The move_global_* calls serve to move kinematically controlled dynamic actors through the game world.
void set_angular_damping(float angDamp)
Sets the angular damping coefficient.
LMatrix3f get_c_mass_local_orientation() const
Returns the center of mass orientation relative to the actor.
void set_shape_group(unsigned int group)
Sets the collision group for all shapes of this actor.
get_num_shapes
Returns the number of shapes assigned to the actor.
float get_angular_damping() const
Returns the angular damping coefficient.
void set_c_mass_global_mat(const LMatrix4f &mat)
Moves the actor by setting the transform of the center of mass.
LMatrix3f get_global_inertia_tensor() const
Returns the inertia tensor of the actor relative to the world coordinate frame.
bool is_sleeping() const
Returns true if this body is sleeping.
void set_c_mass_offset_local_mat(const LMatrix4f &mat)
Sets the matrix of the center of mass relative to the actor.
void set_c_mass_offset_global_orientation(const LMatrix3f &mat)
Sets the orientation of the center of mass relative to world space.
float get_mass() const
Returns the mass of the actor.
void set_sleep_linear_velocity(float threshold)
Sets the linear velocity below which an actor may go to sleep.
bool update_mass_from_shapes(float density, float totalMass)
Recomputes a dynamic actor's mass properties from its shapes.
LPoint3f get_global_pos() const
Retrieves the actors world space position.
void attach_node_path(const NodePath &np)
Attaches a node path to this actor.
unsigned int get_group() const
Retrieves the actor group this actor is assigned to.
void wake_up(float wakeCounterValue=NX_SLEEP_INTERVAL)
Wakes up the actor if it is sleeping.
void add_local_force_at_pos(const LVector3f force, const LPoint3f &pos, PhysxForceMode mode=FM_force, bool wakeup=true)
Applies a force (or impulse) defined in the actor local coordinate frame, acting at a particular poin...
float get_max_angular_velocity() const
Returns the maximum angular velocity permitted for this actor.
PhysxScene * get_scene() const
Retrieves the scene which this actor belongs to.
void add_force(const LVector3f force, PhysxForceMode mode=FM_force, bool wakeup=true)
Applies a force (or impulse) defined in the global coordinate frame to the actor.
float get_sleep_energy_threshold() const
Returns the energy below which an actor may go to sleep.
LMatrix4f get_c_mass_local_mat() const
Returns the center of mass transform relative to the actor.
void add_force_at_pos(const LVector3f force, const LPoint3f &pos, PhysxForceMode mode=FM_force, bool wakeup=true)
Applies a force (or impulse) defined in the global coordinate frame, acting at a particular point in ...
PhysxShape * create_shape(PhysxShapeDesc &desc)
Creates a new shape and adds it to the list of shapes of this actor.
bool get_actor_flag(PhysxActorFlag flag) const
Return the specified ActorFlag flag.
bool is_dynamic() const
Returns true if the actor is dynamic.
LVector3f get_linear_momentum() const
Retrieves the linear momentum of an actor.
get_shape
Retrieves an individual shape from the actor's array of shapes.
LVector3f get_linear_velocity() const
Returns the linear velocity of an actor.
float get_sleep_angular_velocity() const
Returns the angular velocity below which an actor may go to sleep.
LMatrix4f get_global_mat() const
Retrieves the actors world space transform.
void set_global_hpr(float h, float p, float r)
Method for setting a dynamic actor's orientation in the world.
void set_max_angular_velocity(float maxAngVel)
Lets you set the maximum angular velocity permitted for this actor.
void add_local_force_at_local_pos(const LVector3f force, const LPoint3f &pos, PhysxForceMode mode=FM_force, bool wakeup=true)
Applies a force (or impulse) defined in the actor local coordinate frame, acting at a particular poin...
void set_actor_flag(PhysxActorFlag flag, bool value)
Raise or lower individual ActorFlag flags.
LPoint3f get_c_mass_local_pos() const
Returns the center of mass position relative to the actor.
void set_c_mass_offset_global_pos(const LPoint3f &pos)
Sets the position of the center of mass relative to world space.
void set_c_mass_global_pos(const LPoint3f &pos)
Moves the actor by setting the position of the center of mass.
LVector3f get_angular_velocity() const
Returns the angular velocity of the actor.
void set_c_mass_offset_local_orientation(const LMatrix3f &mat)
Sets the orientation of the center of mass relative to the actor.
LVector3f get_point_velocity(const LPoint3f &point) const
Computes the velocity of a point given in world coordinates if it were attached to the actor and movi...
LVector3f get_local_point_velocity(const LPoint3f &point) const
Computes the velocity of a point given in body local coordinates as if it were attached to the actor ...
void set_mass(float mass)
Sets the mass of a dynamic actor.
bool get_body_flag(PhysxBodyFlag flag) const
Return the specified BodyFlag flag.
LQuaternionf get_global_quat() const
Retrieves the actors world space orientation.
void detach_node_path()
Detaches a previously assigned NodePath from this actor.
LMatrix4f get_c_mass_global_mat() const
Returns the center of mass transform in world space.
void set_linear_damping(float linDamp)
Sets the linear damping coefficient.
void set_contact_report_flag(PhysxContactPairFlag flag, bool value)
Sets the actor's contact report flags.
float get_sleep_linear_velocity() const
Returns the linear velocity below which an actor may go to sleep.
void set_c_mass_offset_global_mat(const LMatrix4f &mat)
Sets the matrix of the center of mass relative to world space.
void set_angular_momentum(const LVector3f &momentum)
Sets the angular momentum of the actor.
bool save_body_to_desc(PhysxBodyDesc &bodyDesc) const
Saves the body information of a dynamic actor to the passed body descriptor.
float compute_kinetic_energy() const
Computes the total kinetic (rotational and translational) energy of the object.
void set_sleep_angular_velocity(float threshold)
Sets the angular velocity below which an actor may go to sleep.
void set_angular_velocity(const LVector3f &angVel)
Sets the angular velocity of the actor.
unsigned int get_dominance_group() const
Retrieves the dominance group of this actor.
LVector3f get_mass_space_inertia_tensor() const
Returns the diagonal inertia tensor of the actor relative to the mass coordinate frame.
void set_global_pos(const LPoint3f &pos)
Method for setting a dynamic actor's position in the world.
void set_global_mat(const LMatrix4f &mat)
Method for setting a dynamic actor's transform matrix in the world.
LMatrix3f get_c_mass_global_orientation() const
Returns the center of mass orientation in world space.
void set_sleep_energy_threshold(float threshold)
Sets the energy threshold below which an actor may go to sleep.
void set_mass_space_inertia_tensor(const LVector3f &m)
Sets the inertia tensor, using a parameter specified in mass space coordinates.
void move_global_pos(const LPoint3f &pos)
The move_global_* calls serve to move kinematically controlled dynamic actors through the game world.
float get_linear_damping() const
Retrieves the linear damping coefficient.
Descriptor for the optional rigid body dynamic state of PhysxActor.
Abstract base class for character controllers.
This class exists just to provide scoping for the enums shared by PhysX classes.
A scene is a collection of bodies, constraints, and effectors which can interact.
Abstract base class for shape descriptors.
Abstract base class for shapes.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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(),...