Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PhysxActor Class Reference

Actors are the main simulation objects. More...

`#include "physxActor.h"`

Inheritance diagram for PhysxActor:

## Public Member Functions
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.
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 local coordinates, 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 global coordinates, to the actor.
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 | 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 point in local coordinates, to the actor.
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 point in global coordinates, to the actor.
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 | 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 | attach_node_path (const NodePath &np)
| Attaches a node path to this actor.
float | compute_kinetic_energy () const
| Computes the total kinetic (rotational and translational) energy of the object.
PhysxShape * | create_shape (PhysxShapeDesc &desc)
| Creates a new shape and adds it to the list of shapes of this actor.
void | detach_node_path ()
| Detaches a previously assigned NodePath from this actor.
virtual TypeHandle | force_init_type ()
bool | get_actor_flag (PhysxActorFlag flag) const
| Return the specified ActorFlag flag.
float | get_angular_damping () const
| Returns the angular damping coefficient.
LVector3f | get_angular_momentum () const
| Retrieves the angular momentum of an actor.
LVector3f | get_angular_velocity () const
| Returns the angular velocity of the actor.
bool | get_body_flag (PhysxBodyFlag flag) const
| Return the specified BodyFlag flag.
LMatrix4f | get_c_mass_global_mat () const
| Returns the center of mass transform in world space.
LMatrix3f | get_c_mass_global_orientation () const
| Returns the center of mass orientation in world space.
LPoint3f | get_c_mass_global_pos () const
| Returns the center of mass position in world space.
LMatrix4f | get_c_mass_local_mat () const
| Returns the center of mass transform relative to the actor.
LMatrix3f | get_c_mass_local_orientation () const
| Returns the center of mass orientation relative to the actor.
LPoint3f | get_c_mass_local_pos () const
| Returns the center of mass position relative to the actor.
unsigned int | get_dominance_group () const
| Retrieves the dominance group of this actor.
LMatrix3f | get_global_inertia_tensor () const
| Returns the inertia tensor of the actor relative to the world coordinate frame.
LMatrix3f | get_global_inertia_tensor_inverse () const
| Returns the inverse of the inertia tensor of the actor relative to the world coordinate frame.
LMatrix4f | get_global_mat () const
| Retrieves the actors world space transform.
LPoint3f | get_global_pos () const
| Retrieves the actors world space position.
LQuaternionf | get_global_quat () const
| Retrieves the actors world space orientation.
unsigned int | get_group () const
| Retrieves the actor group this actor is assigned to.
float | get_linear_damping () const
| Retrieves the linear damping coefficient.
LVector3f | get_linear_momentum () const
| Retrieves the linear momentum of an actor.
LVector3f | get_linear_velocity () const
| Returns the linear velocity of an actor.
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 and moving with it.
float | get_mass () const
| Returns the mass of the actor.
LVector3f | get_mass_space_inertia_tensor () const
| Returns the diagonal inertia tensor of the actor relative to the mass coordinate frame.
float | get_max_angular_velocity () const
| Returns the maximum angular velocity permitted for this actor.
const char * | get_name () const
| Retrieves the name string.
NodePath | get_node_path () const
| Retrieves a previously attached NodePath.
unsigned int | get_num_shapes () const
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 moving with it.
PhysxScene * | get_scene () const
| Retrieves the scene which this actor belongs to.
PhysxShape * | get_shape (unsigned int idx) const
PhysxShape * | get_shape_by_name (const char *name) const
| Retrieves an individual shape from the actor's array of shapes.
float | get_sleep_angular_velocity () const
| Returns the angular velocity below which an actor may go to sleep.
float | get_sleep_energy_threshold () const
| Returns the energy below which an actor may go to sleep.
float | get_sleep_linear_velocity () const
| Returns the linear velocity below which an actor may go to sleep.
virtual TypeHandle | get_type () const
bool | is_dynamic () const
| Returns true if the actor is dynamic.
bool | is_sleeping () const
| Returns true if this body is sleeping.
void | link (NxActor *ptr)
void | link_controller (PhysxController *controller)
void | ls () const
void | ls (std::ostream &out, int indent_level=0) const
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 | move_global_mat (const LMatrix4f &mat)
| The move_global_* calls serve to move kinematically controlled dynamic actors through the game world.
void | move_global_pos (const LPoint3f &pos)
| The move_global_* calls serve to move kinematically controlled dynamic actors through the game world.
NxActor * | ptr () const
void | put_to_sleep ()
| Forces the actor to sleep.
void | release ()
bool | save_body_to_desc (PhysxBodyDesc &bodyDesc) const
| Saves the body information of a dynamic actor to the passed body descriptor.
void | save_to_desc (PhysxActorDesc &actorDesc) const
| Saves the state of the actor to the passed descriptor.
void | set_actor_flag (PhysxActorFlag flag, bool value)
| Raise or lower individual ActorFlag flags.
void | set_angular_damping (float angDamp)
| Sets the angular damping coefficient.
void | set_angular_momentum (const LVector3f &momentum)
| Sets the angular momentum of the actor.
void | set_angular_velocity (const LVector3f &angVel)
| Sets the angular velocity of the actor.
void | set_body_flag (PhysxBodyFlag flag, bool value)
| Raise or lower individual BodyFlag flags.
void | set_c_mass_global_mat (const LMatrix4f &mat)
| Moves the actor by setting the transform of the center of mass.
void | set_c_mass_global_orientation (const LMatrix3f &mat)
| Moves the actor by setting the orientation of the center of mass.
void | set_c_mass_global_pos (const LPoint3f &pos)
| Moves the actor by setting the position of the center of mass.
void | set_c_mass_offset_global_mat (const LMatrix4f &mat)
| Sets the matrix of the center of mass relative to world space.
void | set_c_mass_offset_global_orientation (const LMatrix3f &mat)
| Sets the orientation of the center of mass relative to world space.
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_offset_local_mat (const LMatrix4f &mat)
| Sets the matrix of the center of mass relative to the actor.
void | set_c_mass_offset_local_orientation (const LMatrix3f &mat)
| Sets the orientation of the center of mass relative to the 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_contact_report_flag (PhysxContactPairFlag flag, bool value)
| Sets the actor's contact report flags.
void | set_contact_report_threshold (float threshold)
| Sets the force threshold for contact reports.
void | set_dominance_group (unsigned int group)
| Assigns dynamic actors a dominance group identifier.
void | set_global_hpr (float h, float p, float r)
| Method for setting a dynamic actor's orientation in the world.
void | set_global_mat (const LMatrix4f &mat)
| Method for setting a dynamic actor's transform matrix in the world.
void | set_global_pos (const LPoint3f &pos)
| Method for setting a dynamic actor's position in the world.
void | set_group (unsigned int group)
| Assigns the actor to a user defined group of actors.
void | set_linear_damping (float linDamp)
| Sets the linear damping coefficient.
void | set_linear_momentum (const LVector3f &momentum)
| Sets the linear momentum of the actor.
void | set_linear_velocity (const LVector3f &linVel)
| Sets the linear velocity of the actor.
void | set_mass (float mass)
| Sets the mass of a dynamic actor.
void | set_mass_space_inertia_tensor (const LVector3f &m)
| Sets the inertia tensor, using a parameter specified in mass space coordinates.
void | set_max_angular_velocity (float maxAngVel)
| Lets you set the maximum angular velocity permitted for this actor.
void | set_name (const char *name)
| Sets a name string for the object that can be retrieved with get_name().
void | set_shape_group (unsigned int group)
| Sets the collision group for all shapes of this actor.
void | set_sleep_angular_velocity (float threshold)
| Sets the angular velocity below which an actor may go to sleep.
void | set_sleep_energy_threshold (float threshold)
| Sets the energy threshold below which an actor may go to sleep.
void | set_sleep_linear_velocity (float threshold)
| Sets the linear velocity below which an actor may go to sleep.
void | unlink ()
bool | update_mass_from_shapes (float density, float totalMass)
| Recomputes a dynamic actor's mass properties from its shapes.
void | update_transform (const LMatrix4f &m)
| Updates the transform of an assigned NodePath.
void | wake_up (float wakeCounterValue=NX_SLEEP_INTERVAL)
| Wakes up the actor if it is sleeping.
Public Member Functions inherited from TypedReferenceCount
| TypedReferenceCount (const TypedReferenceCount &copy)
void | operator= (const TypedReferenceCount &copy)
Public Member Functions inherited from TypedObject
| TypedObject (const TypedObject &copy)=default
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_typed_object () const
| Returns the object, upcast (if necessary) to a TypedObject pointer.
int | get_best_parent_from_Set (const std::set< int > &) const
int | get_type_index () const
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
bool | is_exact_type (TypeHandle handle) const
| Returns true if the current object is the indicated type exactly.
bool | is_of_type (TypeHandle handle) const
| Returns true if the current object is or derives from the indicated type.
TypedObject & | operator= (const TypedObject &copy)=default
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)
Public Member Functions inherited from ReferenceCount
int | get_ref_count () const
WeakReferenceList * | get_weak_list () const
| Returns the WeakReferenceList associated with this ReferenceCount object.
bool | has_weak_list () const
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
void | local_object ()
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void | ref () const
| Explicitly increments the reference count.
bool | ref_if_nonzero () const
| Atomically increases the reference count of this object if it is not zero.
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus.
bool | test_ref_count_nonzero () const
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
virtual bool | unref () const
| Explicitly decrements the reference count.
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one.
WeakReferenceList * | weak_ref ()
| Adds the indicated PointerToVoid as a weak reference to this object.
void | weak_unref ()
| Removes the indicated PointerToVoid as a weak reference to this object.

## Static Public Member Functions
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from PhysxObject
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedObject
static TypeHandle | get_class_type ()
static void | init_type ()
| This function is declared non-inline to work around a compiler bug in g++ 2.96.
Static Public Member Functions inherited from ReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()

## Public Attributes
PhysxObjectCollection< PhysxShape > | _shapes
| get_num_shapes
| Returns the number of shapes assigned to the actor.
| get_shape
| Retrieves an individual shape from the actor's array of shapes.
Public Attributes inherited from TypedObject
| get_type
Public Attributes inherited from ReferenceCount
| get_ref_count
| Returns the current reference count.

## Additional Inherited Members
Public Types inherited from PhysxEnums
enum | PhysxActorFlag { AF_disable_collision = NX_AF_DISABLE_COLLISION , AF_disable_response = NX_AF_DISABLE_RESPONSE , AF_lock_com = NX_AF_LOCK_COM , AF_fluid_disable_collision = NX_AF_FLUID_DISABLE_COLLISION , AF_contact_modification = NX_AF_CONTACT_MODIFICATION , AF_force_cone_friction = NX_AF_FORCE_CONE_FRICTION , AF_user_actor_pair_filtering = NX_AF_USER_ACTOR_PAIR_FILTERING }
enum | PhysxBodyFlag { BF_disable_gravity = NX_BF_DISABLE_GRAVITY , Bf_frozen_pos_x = NX_BF_FROZEN_POS_X , BF_frozen_pos_y = NX_BF_FROZEN_POS_Y , BF_frozen_pos_z = NX_BF_FROZEN_POS_Z , BF_frozen_rot_x = NX_BF_FROZEN_ROT_X , BF_frozen_rot_y = NX_BF_FROZEN_ROT_Y , BF_frozen_rot_z = NX_BF_FROZEN_ROT_Z , BF_frozen_pos = NX_BF_FROZEN_POS , BF_frozen_rot = NX_BF_FROZEN_ROT , BF_frozen = NX_BF_FROZEN , BF_kinematic = NX_BF_KINEMATIC , BF_visualization = NX_BF_VISUALIZATION , BF_filter_sleep_vel = NX_BF_FILTER_SLEEP_VEL , BF_energy_sleep_test = NX_BF_ENERGY_SLEEP_TEST }
enum | PhysxBroadPhaseType { BPT_sap_single = NX_BP_TYPE_SAP_SINGLE , BPT_sap_multi = NX_BP_TYPE_SAP_MULTI }
enum | PhysxClothFlag { CLF_pressure = NX_CLF_PRESSURE , CLF_static = NX_CLF_STATIC , CLF_disable_collision = NX_CLF_DISABLE_COLLISION , CLF_selfcollision = NX_CLF_SELFCOLLISION , CLF_visualization = NX_CLF_VISUALIZATION , CLF_gravity = NX_CLF_GRAVITY , CLF_bending = NX_CLF_BENDING , CLF_bending_ortho = NX_CLF_BENDING_ORTHO , CLF_damping = NX_CLF_DAMPING , CLF_collision_twoway = NX_CLF_COLLISION_TWOWAY , CLF_triangle_collision = NX_CLF_TRIANGLE_COLLISION , CLF_tearable = NX_CLF_TEARABLE , CLF_hardware = NX_CLF_HARDWARE , CLF_comdamping = NX_CLF_COMDAMPING , CLF_validbounds = NX_CLF_VALIDBOUNDS , CLF_fluid_collision = NX_CLF_FLUID_COLLISION , CLF_disable_dynamic_ccd = NX_CLF_DISABLE_DYNAMIC_CCD , CLF_adhere = NX_CLF_ADHERE }
enum | PhysxCombineMode { CM_average = NX_CM_AVERAGE , CM_min = NX_CM_MIN , CM_multiply = NX_CM_MULTIPLY , CM_max = NX_CM_MAX }
enum | PhysxContactPairFlag { CPF_ignore_pair = NX_IGNORE_PAIR , CPF_notify_on_start_touch = NX_NOTIFY_ON_START_TOUCH , CPF_notify_on_end_touch = NX_NOTIFY_ON_END_TOUCH , CPF_notify_on_touch = NX_NOTIFY_ON_TOUCH , CPF_notify_on_impact = NX_NOTIFY_ON_IMPACT , CPF_notify_on_roll = NX_NOTIFY_ON_ROLL , CPF_notify_on_slide = NX_NOTIFY_ON_SLIDE , CPF_notify_forces = NX_NOTIFY_FORCES , CPF_notify_on_start_touch_threshold = NX_NOTIFY_ON_START_TOUCH_FORCE_THRESHOLD , CPF_notify_on_end_touch_threshold = NX_NOTIFY_ON_END_TOUCH_FORCE_THRESHOLD , CPF_notify_on_touch_threshold = NX_NOTIFY_ON_TOUCH_FORCE_THRESHOLD , CPF_notify_contact_modifications = NX_NOTIFY_CONTACT_MODIFICATION }
enum | PhysxD6JointDriveType { D6_joint_drive_position = NX_D6JOINT_DRIVE_POSITION , D6_joint_drive_velocity = NX_D6JOINT_DRIVE_VELOCITY }
enum | PhysxD6JointFlag { D6_joint_slerp_drive = NX_D6JOINT_SLERP_DRIVE , D6_joint_gear_disabled = NX_D6JOINT_GEAR_ENABLED }
enum | PhysxD6JointMotion { D6_joint_motion_locked = NX_D6JOINT_MOTION_LOCKED , D6_joint_motion_limited = NX_D6JOINT_MOTION_LIMITED , D6_joint_motion_free = NX_D6JOINT_MOTION_FREE }
enum | PhysxDistanceJointFlag { DJF_max_distance_enabled = NX_DJF_MAX_DISTANCE_ENABLED , DJF_mix_distance_enabled = NX_DJF_MIN_DISTANCE_ENABLED , DJF_spring_enabled = NX_DJF_SPRING_ENABLED }
enum | PhysxFilterOp { FO_and = NX_FILTEROP_AND , FO_or = NX_FILTEROP_OR , FO_xor = NX_FILTEROP_XOR , FO_nand = NX_FILTEROP_NAND , FO_nor = NX_FILTEROP_NOR , FO_nxor = NX_FILTEROP_NXOR , FO_swap_and = NX_FILTEROP_SWAP_AND }
enum | PhysxForceFieldCoordinates { FFC_cartesian , FFC_spherical , FFC_cylindrical , FFC_toroidal }
enum | PhysxForceFieldShapeGroupFlag { FFSG_exclude_group = NX_FFSG_EXCLUDE_GROUP }
enum | PhysxForceMode { FM_force = NX_FORCE , FM_impulse = NX_IMPULSE , FM_velocity_change = NX_VELOCITY_CHANGE , FM_smooth_impulse = NX_SMOOTH_IMPULSE , FM_smooth_velocity_change = NX_SMOOTH_VELOCITY_CHANGE , FM_acceleration = NX_ACCELERATION }
enum | PhysxJointFlag { JF_collision_enabled = NX_JF_COLLISION_ENABLED , JF_visualization = NX_JF_VISUALIZATION }
enum | PhysxMaterialFlag { MF_anisotropic = NX_MF_ANISOTROPIC , MF_disable_friction = NX_MF_DISABLE_FRICTION , MF_disable_strong_friction = NX_MF_DISABLE_STRONG_FRICTION }
enum | PhysxParameter { P_penalty_force = NX_PENALTY_FORCE , P_skin_width = NX_SKIN_WIDTH , P_default_sleep_lin_vel_squared = NX_DEFAULT_SLEEP_LIN_VEL_SQUARED , P_default_sleep_ang_vel_squared = NX_DEFAULT_SLEEP_ANG_VEL_SQUARED , P_bounce_threshold = NX_BOUNCE_THRESHOLD , P_dyn_frict_scaling = NX_DYN_FRICT_SCALING , P_sta_frict_scaling = NX_STA_FRICT_SCALING , P_max_angular_velocity = NX_MAX_ANGULAR_VELOCITY , P_continuous_cd = NX_CONTINUOUS_CD , P_visualization_scale = NX_VISUALIZATION_SCALE , P_adaptive_force = NX_ADAPTIVE_FORCE , P_coll_veta_jointed = NX_COLL_VETO_JOINTED , P_trigger_trigger_callback = NX_TRIGGER_TRIGGER_CALLBACK , P_select_hw_algo = NX_SELECT_HW_ALGO , P_ccd_epsilon = NX_CCD_EPSILON , P_solver_convergence_threshold = NX_SOLVER_CONVERGENCE_THRESHOLD , P_bbox_noise_level = NX_BBOX_NOISE_LEVEL , P_implicit_sweep_cache_size = NX_IMPLICIT_SWEEP_CACHE_SIZE , P_default_sleep_energy = NX_DEFAULT_SLEEP_ENERGY , P_constant_fluid_max_packets = NX_CONSTANT_FLUID_MAX_PACKETS , P_constant_fluid_max_particles_per_step = NX_CONSTANT_FLUID_MAX_PARTICLES_PER_STEP , P_asynchronous_mesh_creation = NX_ASYNCHRONOUS_MESH_CREATION , P_force_field_custom_kernel_epsilon = NX_FORCE_FIELD_CUSTOM_KERNEL_EPSILON , P_improved_spring_solver = NX_IMPROVED_SPRING_SOLVER , P_visualize_world_axes = NX_VISUALIZE_WORLD_AXES , P_visualize_body_axes = NX_VISUALIZE_BODY_AXES , P_visualize_body_mass_axes = NX_VISUALIZE_BODY_MASS_AXES , P_visualize_body_lin_velocity = NX_VISUALIZE_BODY_LIN_VELOCITY , P_visualize_body_ang_velocity = NX_VISUALIZE_BODY_ANG_VELOCITY , P_visualize_body_joint_groups = NX_VISUALIZE_BODY_JOINT_GROUPS , P_visualize_joint_local_axes = NX_VISUALIZE_JOINT_LOCAL_AXES , P_visualize_joint_world_axes = NX_VISUALIZE_JOINT_WORLD_AXES , P_visualize_joint_limits = NX_VISUALIZE_JOINT_LIMITS , P_visualize_contact_point = NX_VISUALIZE_CONTACT_POINT , P_visualize_contact_normal = NX_VISUALIZE_CONTACT_NORMAL , P_visualize_contact_error = NX_VISUALIZE_CONTACT_ERROR , P_visualize_contact_force = NX_VISUALIZE_CONTACT_FORCE , P_visualize_actor_axes = NX_VISUALIZE_ACTOR_AXES , P_visualize_collision_aabbs = NX_VISUALIZE_COLLISION_AABBS , P_visualize_collision_shapes = NX_VISUALIZE_COLLISION_SHAPES , P_visualize_collision_axes = NX_VISUALIZE_COLLISION_AXES , P_visualize_collision_compounds = NX_VISUALIZE_COLLISION_COMPOUNDS , P_visualize_collision_vnormals = NX_VISUALIZE_COLLISION_VNORMALS , P_visualize_collision_fnormals = NX_VISUALIZE_COLLISION_FNORMALS , P_visualize_collision_edges = NX_VISUALIZE_COLLISION_EDGES , P_visualize_collision_spheres = NX_VISUALIZE_COLLISION_SPHERES , P_visualize_collision_static = NX_VISUALIZE_COLLISION_STATIC , P_visualize_collision_dynamic = NX_VISUALIZE_COLLISION_DYNAMIC , P_visualize_collision_free = NX_VISUALIZE_COLLISION_FREE , P_visualize_collision_ccd = NX_VISUALIZE_COLLISION_CCD , P_visualize_collision_skeletons = NX_VISUALIZE_COLLISION_SKELETONS , P_visualize_fluid_emitters = NX_VISUALIZE_FLUID_EMITTERS , P_visualize_fluid_position = NX_VISUALIZE_FLUID_POSITION , P_visualize_fluid_velocity = NX_VISUALIZE_FLUID_VELOCITY , P_visualize_fluid_kernel_radius = NX_VISUALIZE_FLUID_KERNEL_RADIUS , P_visualize_fluid_bounds = NX_VISUALIZE_FLUID_BOUNDS , P_visualize_fluid_packets = NX_VISUALIZE_FLUID_PACKETS , P_visualize_fluid_motion_limit = NX_VISUALIZE_FLUID_MOTION_LIMIT , P_visualize_fluid_dyn_collision = NX_VISUALIZE_FLUID_DYN_COLLISION , P_visualize_fluid_stc_collision = NX_VISUALIZE_FLUID_STC_COLLISION , P_visualize_fluid_mesh_packets = NX_VISUALIZE_FLUID_MESH_PACKETS , P_visualize_fluid_drains = NX_VISUALIZE_FLUID_DRAINS , P_visualize_fluid_packet_data = NX_VISUALIZE_FLUID_PACKET_DATA , P_visualize_cloth_mesh = NX_VISUALIZE_CLOTH_MESH , P_visualize_cloth_collisions = NX_VISUALIZE_CLOTH_COLLISIONS , P_visualize_cloth_selfcollisions = NX_VISUALIZE_CLOTH_SELFCOLLISIONS , P_visualize_cloth_workpackets = NX_VISUALIZE_CLOTH_WORKPACKETS , P_visualize_cloth_sleep = NX_VISUALIZE_CLOTH_SLEEP , P_visualize_cloth_sleep_vertex = NX_VISUALIZE_CLOTH_SLEEP_VERTEX , P_visualize_cloth_tearable_vertices = NX_VISUALIZE_CLOTH_TEARABLE_VERTICES , P_visualize_cloth_tearing = NX_VISUALIZE_CLOTH_TEARING , P_visualize_cloth_attachment = NX_VISUALIZE_CLOTH_ATTACHMENT , P_visualize_cloth_validbounds = NX_VISUALIZE_CLOTH_VALIDBOUNDS , P_visualize_softbody_mesh = NX_VISUALIZE_SOFTBODY_MESH , P_visualize_softbody_collisions = NX_VISUALIZE_SOFTBODY_COLLISIONS , P_visualize_softbody_workpackets = NX_VISUALIZE_SOFTBODY_WORKPACKETS , P_visualize_softbody_sleep = NX_VISUALIZE_SOFTBODY_SLEEP , P_visualize_softbody_sleep_vertex = NX_VISUALIZE_SOFTBODY_SLEEP_VERTEX , P_visualize_softbody_tearable_vertices = NX_VISUALIZE_SOFTBODY_TEARABLE_VERTICES , P_visualize_softbody_tearing = NX_VISUALIZE_SOFTBODY_TEARING , P_visualize_softbody_attachment = NX_VISUALIZE_SOFTBODY_ATTACHMENT , P_visualize_softbody_validbounds = NX_VISUALIZE_SOFTBODY_VALIDBOUNDS , P_visualize_active_vertices = NX_VISUALIZE_ACTIVE_VERTICES , P_visualize_force_fields = NX_VISUALIZE_FORCE_FIELDS }
enum | PhysxProjectionMode { PM_none = NX_JPM_NONE , PM_point_mindist = NX_JPM_POINT_MINDIST , PM_linear_mindist = NX_JPM_LINEAR_MINDIST }
enum | PhysxPruningStructure { PS_none = NX_PRUNING_NONE , PS_octree = NX_PRUNING_OCTREE , PS_quadtree = NX_PRUNING_QUADTREE , PS_dynamic_aabb_tree = NX_PRUNING_DYNAMIC_AABB_TREE , PS_static_aabb_tree = NX_PRUNING_STATIC_AABB_TREE }
enum | PhysxPulleyJointFlag { PJF_is_rigid = NX_PJF_IS_RIGID , PJF_motor_enabled = NX_PJF_MOTOR_ENABLED }
enum | PhysxRevoluteJointFlag { RJF_limit_enabled = NX_RJF_LIMIT_ENABLED , RJF_motor_enabled = NX_RJF_MOTOR_ENABLED , RJF_spring_enabled = NX_RJF_SPRING_ENABLED }
enum | PhysxSceneFlag { SF_disable_sse = NX_SF_DISABLE_SSE , SF_disable_collisions = NX_SF_DISABLE_COLLISIONS , SF_restricted_scene = NX_SF_RESTRICTED_SCENE , SF_disable_scene_mutex = NX_SF_DISABLE_SCENE_MUTEX , SF_force_cone_friction = NX_SF_FORCE_CONE_FRICTION , SF_sequential_primary = NX_SF_SEQUENTIAL_PRIMARY , SF_fluid_performance_hint = NX_SF_FLUID_PERFORMANCE_HINT }
enum | PhysxShapeFlag { SF_trigger_on_enter = NX_TRIGGER_ON_ENTER , SF_trigger_on_leave = NX_TRIGGER_ON_LEAVE , SF_trigger_on_stay = NX_TRIGGER_ON_STAY , SF_trigger_enable = NX_TRIGGER_ENABLE , SF_visualization = NX_SF_VISUALIZATION , SF_disable_collision = NX_SF_DISABLE_COLLISION , SF_disable_raycasting = NX_SF_DISABLE_RAYCASTING , SF_disable_response = NX_SF_DISABLE_RESPONSE , SF_disable_scene_queries = NX_SF_DISABLE_SCENE_QUERIES , SF_point_contact_force = NX_SF_POINT_CONTACT_FORCE , SF_feature_indices = NX_SF_FEATURE_INDICES , SF_dynamic_dynamic_ccd = NX_SF_DYNAMIC_DYNAMIC_CCD , SF_fluid_drain = NX_SF_FLUID_DRAIN , SF_fluid_disable_collision = NX_SF_FLUID_DISABLE_COLLISION , SF_fluid_twoway = NX_SF_FLUID_TWOWAY , SF_cloth_drain = NX_SF_CLOTH_DRAIN , SF_cloth_disable_collision = NX_SF_CLOTH_DISABLE_COLLISION , SF_cloth_twoway = NX_SF_CLOTH_TWOWAY , SF_softbody_drain = NX_SF_SOFTBODY_DRAIN , SF_softbody_disable_collision = NX_SF_SOFTBODY_DISABLE_COLLISION , SF_softbody_twoway = NX_SF_SOFTBODY_TWOWAY }
enum | PhysxShapesType { ST_static = NX_STATIC_SHAPES , ST_dynamic = NX_DYNAMIC_SHAPES , ST_all = NX_ALL_SHAPES }
enum | PhysxSoftBodyFlag { SBF_static = NX_SBF_STATIC , SBF_disable_collision = NX_SBF_DISABLE_COLLISION , SBF_selfcollision = NX_SBF_SELFCOLLISION , SBF_visualization = NX_SBF_VISUALIZATION , SBF_gravity = NX_SBF_GRAVITY , SBF_volume_conservtion = NX_SBF_VOLUME_CONSERVATION , SBF_damping = NX_SBF_DAMPING , SBF_collision_twoway = NX_SBF_COLLISION_TWOWAY , SBF_tearable = NX_SBF_TEARABLE , SBF_hardware = NX_SBF_HARDWARE , SBF_comdamping = NX_SBF_COMDAMPING , SBF_validbounds = NX_SBF_VALIDBOUNDS , SBF_fluid_collision = NX_SBF_FLUID_COLLISION , SBF_disable_dynamic_ccd = NX_SBF_DISABLE_DYNAMIC_CCD , SBF_adhere = NX_SBF_ADHERE }
enum | PhysxSphericalJointFlag { SJF_twist_limit_enabled = NX_SJF_TWIST_LIMIT_ENABLED , SJF_swing_limit_enabled = NX_SJF_SWING_LIMIT_ENABLED , SJF_twist_spring_enabled = NX_SJF_TWIST_SPRING_ENABLED , SJF_swing_spring_enabled = NX_SJF_SWING_SPRING_ENABLED , SJF_joint_spring_enabled = NX_SJF_JOINT_SPRING_ENABLED , SJF_perpendicular_dir_constraints = NX_SJF_PERPENDICULAR_DIR_CONSTRAINTS }
enum | PhysxUpAxis { X_up = NX_X , Y_up = NX_Y , Z_up = NX_Z }
enum | PhysxVertexAttachmentStatus { VAS_none = NX_CLOTH_VERTEX_ATTACHMENT_NONE , VAS_global = NX_CLOTH_VERTEX_ATTACHMENT_GLOBAL , VAS_shape = NX_CLOTH_VERTEX_ATTACHMENT_SHAPE }
enum | PhysxWheelFlag { WF_steerable_input = 1<<0 , WF_steerable_auto = 1<<1 , WF_affected_by_handbrake = 1<<2 , WF_accelerated = 1<<3 }
enum | PhysxWheelShapeFlag { WSF_wheel_axis_contact_normal = NX_WF_WHEEL_AXIS_CONTACT_NORMAL , WSF_input_lat_slipvelocity = NX_WF_INPUT_LAT_SLIPVELOCITY , WSF_input_lng_slipvelocity = NX_WF_INPUT_LNG_SLIPVELOCITY , WSF_unscaled_spring_behavior = NX_WF_UNSCALED_SPRING_BEHAVIOR , WSF_axle_speed_override = NX_WF_AXLE_SPEED_OVERRIDE , WSF_emulate_legacy_wheel = NX_WF_EMULATE_LEGACY_WHEEL , WSF_clamped_friction = NX_WF_CLAMPED_FRICTION }

## Detailed Description

Actors are the main simulation objects.

Actors are owned by a scene (PhysxScene).

An actor may optionally encapsulate a dynamic rigid body by setting the body member of the actor's descriptor when it is created. Otherwise the actor will be static (fixed in the world).

Instances of PhysxActor are created by calling PhysxScene::create_actor() and destroyed by calling PhysxActor::release().

Definition at line 44 of file physxActor.h.

## Constructor & Destructor Documentation

## ◆ PhysxActor()

PhysxActor::PhysxActor | ( |  | ) |
| inline

Definition at line 17 of file physxActor.I.

## ◆ ~PhysxActor()

PhysxActor::~PhysxActor | ( |  | ) |
| inline

Definition at line 25 of file physxActor.I.

## Member Function Documentation

## ◆ add_force()

void PhysxActor::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.

This will not induce a torque.

Mode determines if the torque is to be conventional or impulsive.

The actor must be dynamic. This call wakes the actor if it is sleeping and the wakeup parameter is true (default).

Definition at line 457 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ add_force_at_local_pos()

void PhysxActor::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 local coordinates, to the actor.

Note that if the force does not act along the center of mass of the actor, this will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a total external force on an object by calling this once every frame.

Mode determines if the torque is to be conventional or impulsive.

The actor must be dynamic. This call wakes the actor if it is sleeping and the wakeup parameter is true (default).

Definition at line 504 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3(), and PhysxManager::vec3_to_nxVec3().

## ◆ add_force_at_pos()

void PhysxActor::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 global coordinates, to the actor.

Note that if the force does not act along the center of mass of the actor, this will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a total external force on an object by calling this once every frame.

Mode determines if the torque is to be conventional or impulsive.

The actor must be dynamic. This call wakes the actor if it is sleeping and the wakeup parameter is true (default).

Definition at line 480 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3(), and PhysxManager::vec3_to_nxVec3().

## ◆ add_local_force()

void PhysxActor::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.

This will not induce a torque.

Mode determines if the torque is to be conventional or impulsive.

The actor must be dynamic. This call wakes the actor if it is sleeping and the wakeup parameter is true (default).

Definition at line 541 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ add_local_force_at_local_pos()

void PhysxActor::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 point in local coordinates, to the actor.

Note that if the force does not act along the center of mass of the actor, this will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a total external force on an object by calling this once every frame.

Mode determines if the torque is to be conventional or impulsive.

The actor must be dynamic. This call wakes the actor if it is sleeping and the wakeup parameter is true (default).

Definition at line 588 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3(), and PhysxManager::vec3_to_nxVec3().

## ◆ add_local_force_at_pos()

void PhysxActor::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 point in global coordinates, to the actor.

Note that if the force does not act along the center of mass of the actor, this will also add the corresponding torque. Because forces are reset at the end of every timestep, you can maintain a total external force on an object by calling this once every frame.

Mode determines if the torque is to be conventional or impulsive.

The actor must be dynamic. This call wakes the actor if it is sleeping and the wakeup parameter is true (default).

Definition at line 564 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3(), and PhysxManager::vec3_to_nxVec3().

## ◆ add_local_torque()

void PhysxActor::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.

Mode determines if the torque is to be conventional or impulsive.

The actor must be dynamic. This call wakes the actor if it is sleeping and the wakeup parameter is true (default).

Definition at line 607 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ add_torque()

void PhysxActor::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.

Mode determines if the torque is to be conventional or impulsive.

The actor must be dynamic. This call wakes the actor if it is sleeping and the wakeup parameter is true (default).

Definition at line 523 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ attach_node_path()

void PhysxActor::attach_node_path | ( | const NodePath & | np | ) |

Attaches a node path to this actor.

The node path's transform will be updated automatically if the actor's transform changes (and only then).

Note: any non-uniform scale or shear set on the NodePath's transform will be overwritten at the time of the first update.

Definition at line 322 of file physxActor.cxx.

References NodePath::is_empty().

## ◆ compute_kinetic_energy()

float PhysxActor::compute_kinetic_energy | ( |  | ) | const

Computes the total kinetic (rotational and translational) energy of the object.

The actor must be dynamic.

Definition at line 653 of file physxActor.cxx.

## ◆ create_shape()

PhysxShape * PhysxActor::create_shape | ( | PhysxShapeDesc & | desc | ) |

Creates a new shape and adds it to the list of shapes of this actor.

Mass properties of dynamic actors will not automatically be recomputed to reflect the new mass distribution implied by the shape. Follow this call with a call to update_mass_from_shapes() to do that.

Definition at line 387 of file physxActor.cxx.

## ◆ detach_node_path()

void PhysxActor::detach_node_path | ( |  | ) |

Detaches a previously assigned NodePath from this actor.

The NodePath's transform will no longer be updated from the actor's transform.

Definition at line 335 of file physxActor.cxx.

## ◆ force_init_type()

virtual TypeHandle PhysxActor::force_init_type | ( |  | ) |
| inline virtual

Reimplemented from PhysxObject.

Definition at line 211 of file physxActor.h.

## ◆ get_actor_flag()

bool PhysxActor::get_actor_flag | ( | PhysxActorFlag | flag | ) | const

Return the specified ActorFlag flag.

Definition at line 729 of file physxActor.cxx.

## ◆ get_angular_damping()

float PhysxActor::get_angular_damping | ( |  | ) | const

Returns the angular damping coefficient.

The actor must be dynamic.

Definition at line 858 of file physxActor.cxx.

## ◆ get_angular_momentum()

LVector3f PhysxActor::get_angular_momentum | ( |  | ) | const

Retrieves the angular momentum of an actor.

The angular momentum is equal to the angular velocity times the global space inertia tensor. The actor must be dynamic.

Definition at line 1058 of file physxActor.cxx.

References PhysxManager::nxVec3_to_vec3().

## ◆ get_angular_velocity()

LVector3f PhysxActor::get_angular_velocity | ( |  | ) | const

Returns the angular velocity of the actor.

The actor must be dynamic.

Definition at line 966 of file physxActor.cxx.

References PhysxManager::nxVec3_to_vec3().

## ◆ get_body_flag()

bool PhysxActor::get_body_flag | ( | PhysxBodyFlag | flag | ) | const

Return the specified BodyFlag flag.

Definition at line 705 of file physxActor.cxx.

## ◆ get_c_mass_global_mat()

LMatrix4f PhysxActor::get_c_mass_global_mat | ( |  | ) | const

Returns the center of mass transform in world space.

Definition at line 1324 of file physxActor.cxx.

References PhysxManager::nxMat34_to_mat4().

## ◆ get_c_mass_global_orientation()

LMatrix3f PhysxActor::get_c_mass_global_orientation | ( |  | ) | const

Returns the center of mass orientation in world space.

Definition at line 1344 of file physxActor.cxx.

References PhysxManager::nxMat33_to_mat3().

## ◆ get_c_mass_global_pos()

LPoint3f PhysxActor::get_c_mass_global_pos | ( |  | ) | const

Returns the center of mass position in world space.

Definition at line 1334 of file physxActor.cxx.

References PhysxManager::nxVec3_to_point3().

## ◆ get_c_mass_local_mat()

LMatrix4f PhysxActor::get_c_mass_local_mat | ( |  | ) | const

Returns the center of mass transform relative to the actor.

Definition at line 1354 of file physxActor.cxx.

References PhysxManager::nxMat34_to_mat4().

## ◆ get_c_mass_local_orientation()

LMatrix3f PhysxActor::get_c_mass_local_orientation | ( |  | ) | const

Returns the center of mass orientation relative to the actor.

Definition at line 1374 of file physxActor.cxx.

References PhysxManager::nxMat33_to_mat3().

## ◆ get_c_mass_local_pos()

LPoint3f PhysxActor::get_c_mass_local_pos | ( |  | ) | const

Returns the center of mass position relative to the actor.

Definition at line 1364 of file physxActor.cxx.

References PhysxManager::nxVec3_to_point3().

## ◆ get_class_type()

static TypeHandle PhysxActor::get_class_type | ( |  | ) |
| inline static

Definition at line 200 of file physxActor.h.

## ◆ get_dominance_group()

unsigned int PhysxActor::get_dominance_group | ( |  | ) | const

Retrieves the dominance group of this actor.

Definition at line 833 of file physxActor.cxx.

## ◆ get_global_inertia_tensor()

LMatrix3f PhysxActor::get_global_inertia_tensor | ( |  | ) | const

Returns the inertia tensor of the actor relative to the world coordinate frame.

Definition at line 1396 of file physxActor.cxx.

References PhysxManager::nxMat33_to_mat3().

## ◆ get_global_inertia_tensor_inverse()

LMatrix3f PhysxActor::get_global_inertia_tensor_inverse | ( |  | ) | const

Returns the inverse of the inertia tensor of the actor relative to the world coordinate frame.

Definition at line 1407 of file physxActor.cxx.

References PhysxManager::nxMat33_to_mat3().

## ◆ get_global_mat()

LMatrix4f PhysxActor::get_global_mat | ( |  | ) | const

Retrieves the actors world space transform.

Definition at line 176 of file physxActor.cxx.

References PhysxManager::nxMat34_to_mat4().

## ◆ get_global_pos()

LPoint3f PhysxActor::get_global_pos | ( |  | ) | const

Retrieves the actors world space position.

Definition at line 166 of file physxActor.cxx.

References PhysxManager::nxVec3_to_point3().

## ◆ get_global_quat()

LQuaternionf PhysxActor::get_global_quat | ( |  | ) | const

Retrieves the actors world space orientation.

Definition at line 186 of file physxActor.cxx.

References PhysxManager::nxQuat_to_quat().

## ◆ get_group()

unsigned int PhysxActor::get_group | ( |  | ) | const

Retrieves the actor group this actor is assigned to.

Definition at line 800 of file physxActor.cxx.

## ◆ get_linear_damping()

float PhysxActor::get_linear_damping | ( |  | ) | const

Retrieves the linear damping coefficient.

The actor must be dynamic.

Definition at line 882 of file physxActor.cxx.

## ◆ get_linear_momentum()

LVector3f PhysxActor::get_linear_momentum | ( |  | ) | const

Retrieves the linear momentum of an actor.

The momentum is equal to the velocity times the mass. The actor must be dynamic.

Definition at line 1046 of file physxActor.cxx.

References PhysxManager::nxVec3_to_vec3().

## ◆ get_linear_velocity()

LVector3f PhysxActor::get_linear_velocity | ( |  | ) | const

Returns the linear velocity of an actor.

The actor must be dynamic.

Definition at line 956 of file physxActor.cxx.

References PhysxManager::nxVec3_to_vec3().

## ◆ get_local_point_velocity()

LVector3f PhysxActor::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 and moving with it.

The actor must be dynamic.

Definition at line 1005 of file physxActor.cxx.

References PhysxManager::nxVec3_to_vec3(), and PhysxManager::point3_to_nxVec3().

## ◆ get_mass()

float PhysxActor::get_mass | ( |  | ) | const

Returns the mass of the actor.

Definition at line 1213 of file physxActor.cxx.

## ◆ get_mass_space_inertia_tensor()

LVector3f PhysxActor::get_mass_space_inertia_tensor | ( |  | ) | const

Returns the diagonal inertia tensor of the actor relative to the mass coordinate frame.

Definition at line 1385 of file physxActor.cxx.

References PhysxManager::nxVec3_to_vec3().

## ◆ get_max_angular_velocity()

float PhysxActor::get_max_angular_velocity | ( |  | ) | const

Returns the maximum angular velocity permitted for this actor.

Definition at line 976 of file physxActor.cxx.

## ◆ get_name()

const char * PhysxActor::get_name | ( |  | ) | const

Retrieves the name string.

Definition at line 130 of file physxActor.cxx.

## ◆ get_node_path()

NodePath PhysxActor::get_node_path | ( |  | ) | const

Retrieves a previously attached NodePath.

An empty NodePath will be returned if no NodePath has been attached to this actor.

Definition at line 347 of file physxActor.cxx.

References NodePath::fail().

Referenced by PhysxController::set_local_speed().

## ◆ get_point_velocity()

LVector3f PhysxActor::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 moving with it.

The actor must be dynamic.

Definition at line 989 of file physxActor.cxx.

References PhysxManager::nxVec3_to_vec3(), and PhysxManager::point3_to_nxVec3().

## ◆ get_scene()

PhysxScene * PhysxActor::get_scene | ( |  | ) | const

Retrieves the scene which this actor belongs to.

Definition at line 358 of file physxActor.cxx.

## ◆ get_shape_by_name()

PhysxShape * PhysxActor::get_shape_by_name | ( | const char * | name | ) | const

Retrieves an individual shape from the actor's array of shapes.

The first shape for which the shape's name matches the specified name is returned, or NULL if no shape has a matching name.

Definition at line 426 of file physxActor.cxx.

## ◆ get_sleep_angular_velocity()

float PhysxActor::get_sleep_angular_velocity | ( |  | ) | const

Returns the angular velocity below which an actor may go to sleep.

Actors whose angular velocity is above this threshold will not be put to sleep. The actor must be dynamic.

Definition at line 1131 of file physxActor.cxx.

## ◆ get_sleep_energy_threshold()

float PhysxActor::get_sleep_energy_threshold | ( |  | ) | const

Returns the energy below which an actor may go to sleep.

Actors whose energy is above this threshold will not be put to sleep. The actor must be dynamic.

Definition at line 1143 of file physxActor.cxx.

## ◆ get_sleep_linear_velocity()

float PhysxActor::get_sleep_linear_velocity | ( |  | ) | const

Returns the linear velocity below which an actor may go to sleep.

Actors whose linear velocity is above this threshold will not be put to sleep. The actor must be dynamic.

Definition at line 1119 of file physxActor.cxx.

## ◆ get_type()

virtual TypeHandle PhysxActor::get_type | ( |  | ) | const
| inline virtual

Reimplemented from PhysxObject.

Definition at line 208 of file physxActor.h.

## ◆ init_type()

static void PhysxActor::init_type | ( |  | ) |
| inline static

Definition at line 203 of file physxActor.h.

## ◆ is_dynamic()

bool PhysxActor::is_dynamic | ( |  | ) | const

Returns true if the actor is dynamic.

Definition at line 663 of file physxActor.cxx.

Referenced by set_dominance_group().

## ◆ is_sleeping()

bool PhysxActor::is_sleeping | ( |  | ) | const

Returns true if this body is sleeping.

When an actor does not move for a period of time, it is no longer simulated in order to save time. This state is called sleeping. However, because the object automatically wakes up when it is either touched by an awake object, or one of its properties is changed by the user, the entire sleep mechanism should be transparent to the user.

The actor must be dynamic.

Definition at line 1161 of file physxActor.cxx.

## ◆ link()

void PhysxActor::link | ( | NxActor * | ptr | ) |

Definition at line 25 of file physxActor.cxx.

## ◆ link_controller()

void PhysxActor::link_controller | ( | PhysxController * | controller | ) |

Definition at line 87 of file physxActor.cxx.

## ◆ ls() [1/2]

void PhysxActor::ls | ( |  | ) | const
| inline virtual

Implements PhysxObject.

Definition at line 33 of file physxActor.I.

## ◆ ls() [2/2]

void PhysxActor::ls | ( | std::ostream & | out,
|  | int | indent_level = 0 ) const
| inline virtual

Implements PhysxObject.

Definition at line 42 of file physxActor.I.

## ◆ move_global_hpr()

void PhysxActor::move_global_hpr | ( | float | h,
|  | float | p,
|  | float | r )

The move_global_* calls serve to move kinematically controlled dynamic actors through the game world.

See move_global_mat() for more information.

This call wakes the actor if it is sleeping.

Definition at line 305 of file physxActor.cxx.

References PhysxManager::quat_to_nxQuat().

## ◆ move_global_mat()

void PhysxActor::move_global_mat | ( | const LMatrix4f & | mat | ) |

The move_global_* calls serve to move kinematically controlled dynamic actors through the game world.

You set a dynamic actor to be kinematic using the BF_KINEMATIC body flag, used either in the PhysBodyDesc or with set_body_flag().

The move command will result in a velocity that, when successfully carried out (i.e. the motion is not blocked due to joints or collisions) inside run*(), will move the body into the desired pose. After the move is carried out during a single time step, the velocity is returned to zero. Thus, you must continuously call this in every time step for kinematic actors so that they move along a path.

These functions simply store the move destination until run*() is called, so consecutive calls will simply overwrite the stored target variable.

This call wakes the actor if it is sleeping.

Definition at line 288 of file physxActor.cxx.

References PhysxManager::mat4_to_nxMat34().

## ◆ move_global_pos()

void PhysxActor::move_global_pos | ( | const LPoint3f & | pos | ) |

The move_global_* calls serve to move kinematically controlled dynamic actors through the game world.

See move_global_mat() for more information.

This call wakes the actor if it is sleeping.

Definition at line 260 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3().

## ◆ ptr()

NxActor * PhysxActor::ptr | ( |  | ) | const
| inline

Definition at line 185 of file physxActor.h.

## ◆ put_to_sleep()

void PhysxActor::put_to_sleep | ( |  | ) |

Forces the actor to sleep.

The actor will stay asleep until the next call to simulate, and will not wake up until then even when otherwise it would (for example a force is applied to it). It can however wake up during the next do_physics call.

The actor must be dynamic.

Definition at line 1193 of file physxActor.cxx.

## ◆ release()

void PhysxActor::release | ( |  | ) |

Definition at line 74 of file physxActor.cxx.

## ◆ save_body_to_desc()

bool PhysxActor::save_body_to_desc | ( | PhysxBodyDesc & | bodyDesc | ) | const

Saves the body information of a dynamic actor to the passed body descriptor.

Definition at line 97 of file physxActor.cxx.

## ◆ save_to_desc()

void PhysxActor::save_to_desc | ( | PhysxActorDesc & | actorDesc | ) | const

Saves the state of the actor to the passed descriptor.

Definition at line 107 of file physxActor.cxx.

## ◆ set_actor_flag()

void PhysxActor::set_actor_flag | ( | PhysxActorFlag | flag,
|  | bool | value )

Raise or lower individual ActorFlag flags.

Definition at line 715 of file physxActor.cxx.

## ◆ set_angular_damping()

void PhysxActor::set_angular_damping | ( | float | angDamp | ) |

Sets the angular damping coefficient.

Zero represents no damping. The angular damping coefficient must be nonnegative. The actor must be dynamic. Default: 0.05

Definition at line 846 of file physxActor.cxx.

## ◆ set_angular_momentum()

void PhysxActor::set_angular_momentum | ( | const LVector3f & | momentum | ) |

Sets the angular momentum of the actor.

Note that if you continuously set the angular velocity of an actor yourself, forces such as friction will not be able to rotate the actor, because forces directly influence only the velocity of actor. The actor must be dynamic.

Definition at line 1035 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ set_angular_velocity()

void PhysxActor::set_angular_velocity | ( | const LVector3f & | angVel | ) |

Sets the angular velocity of the actor.

Note that if you continuously set the angular velocity of an actor yourself, forces such as friction will not be able to rotate the actor, because forces directly influence only the velocity/momentum.

The actor must be dynamic.

Definition at line 916 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ set_body_flag()

void PhysxActor::set_body_flag | ( | PhysxBodyFlag | flag,
|  | bool | value )

Raise or lower individual BodyFlag flags.

Definition at line 691 of file physxActor.cxx.

## ◆ set_c_mass_global_mat()

void PhysxActor::set_c_mass_global_mat | ( | const LMatrix4f & | mat | ) |

Moves the actor by setting the transform of the center of mass.

Definition at line 1283 of file physxActor.cxx.

References PhysxManager::mat4_to_nxMat34().

## ◆ set_c_mass_global_orientation()

void PhysxActor::set_c_mass_global_orientation | ( | const LMatrix3f & | mat | ) |

Moves the actor by setting the orientation of the center of mass.

Definition at line 1303 of file physxActor.cxx.

References PhysxManager::mat3_to_nxMat33().

## ◆ set_c_mass_global_pos()

void PhysxActor::set_c_mass_global_pos | ( | const LPoint3f & | pos | ) |

Moves the actor by setting the position of the center of mass.

Definition at line 1293 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3().

## ◆ set_c_mass_offset_global_mat()

void PhysxActor::set_c_mass_offset_global_mat | ( | const LMatrix4f & | mat | ) |

Sets the matrix of the center of mass relative to world space.

Definition at line 1253 of file physxActor.cxx.

References PhysxManager::mat4_to_nxMat34().

## ◆ set_c_mass_offset_global_orientation()

void PhysxActor::set_c_mass_offset_global_orientation | ( | const LMatrix3f & | mat | ) |

Sets the orientation of the center of mass relative to world space.

Definition at line 1273 of file physxActor.cxx.

References PhysxManager::mat3_to_nxMat33().

## ◆ set_c_mass_offset_global_pos()

void PhysxActor::set_c_mass_offset_global_pos | ( | const LPoint3f & | pos | ) |

Sets the position of the center of mass relative to world space.

Definition at line 1263 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3().

## ◆ set_c_mass_offset_local_mat()

void PhysxActor::set_c_mass_offset_local_mat | ( | const LMatrix4f & | mat | ) |

Sets the matrix of the center of mass relative to the actor.

Definition at line 1223 of file physxActor.cxx.

References PhysxManager::mat4_to_nxMat34().

## ◆ set_c_mass_offset_local_orientation()

void PhysxActor::set_c_mass_offset_local_orientation | ( | const LMatrix3f & | mat | ) |

Sets the orientation of the center of mass relative to the actor.

Definition at line 1243 of file physxActor.cxx.

References PhysxManager::mat3_to_nxMat33().

## ◆ set_c_mass_offset_local_pos()

void PhysxActor::set_c_mass_offset_local_pos | ( | const LPoint3f & | pos | ) |

Sets the position of the center of mass relative to the actor.

Definition at line 1233 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3().

## ◆ set_contact_report_flag()

void PhysxActor::set_contact_report_flag | ( | PhysxContactPairFlag | flag,
|  | bool | value )

Sets the actor's contact report flags.

These flags are used to determine the kind of report that is generated for interactions with other actors.

Please note: If the actor is part of an interacting pair for which the contact report generation is controlled already through any other mechanism (for example by use of PhysxScene::set_actor_pair_flags) then the union of all the specified contact report flags will be used to generate the report.

Definition at line 747 of file physxActor.cxx.

## ◆ set_contact_report_threshold()

void PhysxActor::set_contact_report_threshold | ( | float | threshold | ) |

Sets the force threshold for contact reports.

The actor must be dynamic.

Definition at line 767 of file physxActor.cxx.

## ◆ set_dominance_group()

void PhysxActor::set_dominance_group | ( | unsigned int | group | ) |

Assigns dynamic actors a dominance group identifier.

Dominance groups are integere in the range from 0 to 31.

This is similar to shape groups, except those serve a different purpose.

The PhysxScene::set_dominance_group_pair() lets you set certain behaviors for pairs of dominance groups.

By default every actor is created in group 0. Static actors must stay in group 0; thus you can only call this on dynamic actors.

Definition at line 820 of file physxActor.cxx.

References is_dynamic().

## ◆ set_global_hpr()

void PhysxActor::set_global_hpr | ( | float | h,
|  | float | p,
|  | float | r )

Method for setting a dynamic actor's orientation in the world.

Please see set_global_mat for some caveats.

Definition at line 242 of file physxActor.cxx.

References PhysxManager::quat_to_nxQuat().

## ◆ set_global_mat()

void PhysxActor::set_global_mat | ( | const LMatrix4f & | mat | ) |

Method for setting a dynamic actor's transform matrix in the world.

This method instantaneously changes the actor space to world space transformation.

One should exercise restraint in making use of these methods.

Static actors should not be moved at all. There are various internal data structures for static actors which may need to be recomputed when one moves. Also, moving static actors will not interact correctly with dynamic actors or joints. If you would like to directly control an actor's position and would like to have it correctly interact with dynamic bodies and joints, you should create a dynamic body with the BF_kinematic flag, and then use the move_global_*() commands to move it along a path!

When briefly moving dynamic actors, one should not: - Move actors into other actors, thus causing interpenetration (an invalid physical state). - Move an actor that is connected by a joint to another away from the other (thus causing joint error). - When moving jointed actors the joints' cached transform information is destroyed and recreated next frame; thus this call is expensive for jointed actors.

Definition at line 229 of file physxActor.cxx.

References PhysxManager::mat4_to_nxMat34().

## ◆ set_global_pos()

void PhysxActor::set_global_pos | ( | const LPoint3f & | pos | ) |

Method for setting a dynamic actor's position in the world.

Please see set_global_mat for some caveats.

Definition at line 197 of file physxActor.cxx.

References PhysxManager::point3_to_nxVec3().

## ◆ set_group()

void PhysxActor::set_group | ( | unsigned int | group | ) |

Assigns the actor to a user defined group of actors.

The actor group must be an integer in between 0 and 0x7fff (32767).

This is similar to NxShape groups, except those are only five bits and serve a different purpose.

The PhysxScene::set_actor_group_pair_flags() lets you set certain behaviors for pairs of actor groups.

By default every actor is created in group 0.

Definition at line 788 of file physxActor.cxx.

## ◆ set_linear_damping()

void PhysxActor::set_linear_damping | ( | float | linDamp | ) |

Sets the linear damping coefficient.

Zero represents no damping. The damping coefficient must be nonnegative. The actor must be dynamic. Default: 0

Definition at line 870 of file physxActor.cxx.

## ◆ set_linear_momentum()

void PhysxActor::set_linear_momentum | ( | const LVector3f & | momentum | ) |

Sets the linear momentum of the actor.

Note that if you continuously set the linear momentum of an actor yourself, forces such as gravity or friction will not be able to manifest themselves, because forces directly influence only the velocity/momentum of a actor. The actor must be dynamic.

Definition at line 1022 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ set_linear_velocity()

void PhysxActor::set_linear_velocity | ( | const LVector3f & | linVel | ) |

Sets the linear velocity of the actor.

Note that if you continuously set the velocity of an actor yourself, forces such as gravity or friction will not be able to manifest themselves, because forces directly influence only the velocity/momentum of an actor.

The actor must be dynamic.

Definition at line 898 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ set_mass()

void PhysxActor::set_mass | ( | float | mass | ) |

Sets the mass of a dynamic actor.

Definition at line 1203 of file physxActor.cxx.

## ◆ set_mass_space_inertia_tensor()

void PhysxActor::set_mass_space_inertia_tensor | ( | const LVector3f & | m | ) |

Sets the inertia tensor, using a parameter specified in mass space coordinates.

Definition at line 1314 of file physxActor.cxx.

References PhysxManager::vec3_to_nxVec3().

## ◆ set_max_angular_velocity()

void PhysxActor::set_max_angular_velocity | ( | float | maxAngVel | ) |

Lets you set the maximum angular velocity permitted for this actor.

Because for various internal computations, very quickly rotating actors introduce error into the simulation, which leads to undesired results.

With PhysxManager::set_parameter(PP_max_angular_velocity) you can set the default maximum velocity for actors created after the call. Bodies' high angular velocities are clamped to this value.

However, because some actors, such as car wheels, should be able to rotate quickly, you can override the default setting on a per-actor basis with the below call. Note that objects such as wheels which are approximated with spherical or other smooth collision primitives can be simulated with stability at a much higher angular velocity than, say, a box that has corners.

The actor must be dynamic.

Definition at line 944 of file physxActor.cxx.

## ◆ set_name()

void PhysxActor::set_name | ( | const char * | name | ) |

Sets a name string for the object that can be retrieved with get_name().

This is for debugging and is not used by the engine.

Definition at line 118 of file physxActor.cxx.

Referenced by PhysxScene::create_controller().

## ◆ set_shape_group()

void PhysxActor::set_shape_group | ( | unsigned int | group | ) |

Sets the collision group for all shapes of this actor.

See PhysxShape.setGroup().

Definition at line 674 of file physxActor.cxx.

## ◆ set_sleep_angular_velocity()

void PhysxActor::set_sleep_angular_velocity | ( | float | threshold | ) |

Sets the angular velocity below which an actor may go to sleep.

Actors whose angular velocity is above this threshold will not be put to sleep.

Setting the sleep angular/linear velocity only makes sense when the BF_energy_sleep_test is not set.

The actor must be dynamic.

Definition at line 1090 of file physxActor.cxx.

## ◆ set_sleep_energy_threshold()

void PhysxActor::set_sleep_energy_threshold | ( | float | threshold | ) |

Sets the energy threshold below which an actor may go to sleep.

Actors whose kinematic energy is above this threshold will not be put to sleep.

Setting the sleep energy threshold only makes sense when the BF_energy_sleep_test is set. There are also other types of sleeping that uses the linear and angular velocities directly instead of the energy.

The actor must be dynamic.

Definition at line 1107 of file physxActor.cxx.

## ◆ set_sleep_linear_velocity()

void PhysxActor::set_sleep_linear_velocity | ( | float | threshold | ) |

Sets the linear velocity below which an actor may go to sleep.

Actors whose linear velocity is above this threshold will not be put to sleep.

Setting the sleep angular/linear velocity only makes sense when the BF_energy_sleep_test is not set.

The actor must be dynamic.

Definition at line 1074 of file physxActor.cxx.

## ◆ unlink()

void PhysxActor::unlink | ( |  | ) |

Definition at line 51 of file physxActor.cxx.

## ◆ update_mass_from_shapes()

bool PhysxActor::update_mass_from_shapes | ( | float | density,
|  | float | totalMass )

Recomputes a dynamic actor's mass properties from its shapes.

Given a constant density or total mass, the actors mass properties can be recomputed using the shapes attached to the actor. If the actor has no shapes, then only the totalMass parameter can be used. If all shapes in the actor are trigger shapes (non-physical), the call will fail.

The mass of each shape is either the shape's local density (as specified in the PhysxShapeDesc; default 1.0) multiplied by the shape's volume or a directly specified shape mass.

The inertia tensor, mass frame and center of mass will always be recomputed. If there are no shapes in the actor, the mass will be totalMass, and the mass frame will be set to the center of the actor.

If you supply a non-zero total mass, the actor's mass and inertia will first be computed as above and then scaled to fit this total mass.

If you supply a non-zero density, the actor's mass and inertia will first be computed as above and then scaled by this factor.

Either totalMass or density must be non-zero.

The actor must be dynamic.

Definition at line 642 of file physxActor.cxx.

## ◆ update_transform()

void PhysxActor::update_transform | ( | const LMatrix4f & | m | ) |

Updates the transform of an assigned NodePath.

If the actor has been created by a PhysxController then this method will update the NodePath's transform from the controller's transform.

Definition at line 142 of file physxActor.cxx.

Referenced by PhysxScene::fetch_results().

## ◆ wake_up()

void PhysxActor::wake_up | ( | float | wakeCounterValue = NX_SLEEP_INTERVAL | ) |

Wakes up the actor if it is sleeping.

The wakeCounterValue determines how long until the body is put to sleep, a value of zero means that the body is sleeping. wake_up(0) is equivalent to PhysxActor::put_to_sleep().

The actor must be dynamic.

Definition at line 1177 of file physxActor.cxx.

## Member Data Documentation

## ◆ _shapes

PhysxObjectCollection<PhysxShape> PhysxActor::_shapes

Definition at line 191 of file physxActor.h.

## ◆ get_num_shapes

unsigned int PhysxActor::get_num_shapes

Returns the number of shapes assigned to the actor.

Definition at line 90 of file physxActor.h.

## ◆ get_shape

PhysxShape * PhysxActor::get_shape

Retrieves an individual shape from the actor's array of shapes.

Index must be in the range from zero to (number-of-shapes minus 1).

Definition at line 90 of file physxActor.h.

The documentation for this class was generated from the following files:

- panda/src/physx/physxActor.h
- panda/src/physx/physxActor.cxx
- panda/src/physx/physxActor.I